Skip to content

Automatic Global Registration of Base Components example does not work… #1941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

twickstrom
Copy link
Contributor

Automatic Global Registration of Base Components example does not work if you wanted to include subfolders. This solution has been tested and confirmed. https://stackoverflow.com/questions/53676837/registering-components-globally-in-vuejs-in-subfolders/53678945#53678945

@phanan phanan closed this Jan 17, 2019
@phanan
Copy link
Member

phanan commented Jan 17, 2019

Sorry, I made a mistake :) Reopening.

@phanan phanan reopened this Jan 17, 2019
@chrisvfritz
Copy link
Contributor

@twickstrom I think it's best to just demonstrate the simplest and most common solution necessary, since all we're trying to do is demonstrate the technique so that people can modify it as they'd like for their own projects. It's quite rare from what I've seen for base components to be spread throughout nested subfolders and what you're doing is globally registering all components, rather than just base components, which we don't recommend.

@twickstrom
Copy link
Contributor Author

twickstrom commented Jan 24, 2019

@chrisvfritz I do not think anyone would think that registering all components globally would be a good idea.

This update to the docs was meant to show an example of the JS needed that would work for either including subfoldersor or not. The current example fails and then gives the perception that the docs are buggy to the community. See the stack overflow link for reference.

In large enterprise applications it is very common to have many components that are used through out the system. Putting them in a folder called components/base and then organizing them based on functional grouping or application purposes seems perfectly reasonable to me.

Thanks for considering this commit

@twickstrom
Copy link
Contributor Author

@chrisvfritz submitted a new pull request that just addresses the regex that would allow a developer to simply toggle subfolders to true and it will pick up any files prefixed with Base just like in the current example.

#1959

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants