Skip to content
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

Plugin modules #145

Closed
insin opened this issue Jul 23, 2016 · 8 comments
Closed

Plugin modules #145

insin opened this issue Jul 23, 2016 · 8 comments

Comments

@insin
Copy link
Contributor

insin commented Jul 23, 2016

Plugin modules would be one way to allow people to tweak for their preferred workflow (having just read the Sass issue #78) while keeping config out of the user's hands. This would also make it easier to port to something else if you ever move away from Webpack.

e.g. here's the complete Sass plugin for nwb - all it does is provide the config and dependencies required to add a new Webpack loader, with a package.json scan for nwb-* modules in nwb itself.

Is there a particular way of implementing plugins which could be supported in create-react-app?

@gaearon
Copy link
Contributor

gaearon commented Jul 23, 2016

Not currently. Please see #99 (comment).
We don’t want people to think in terms of “loaders” and “plugins”. This is not a nice interface to Webpack—it’s a nice way to create React apps. We might switch away from webpack later.

@gaearon gaearon closed this as completed Jul 23, 2016
@insin
Copy link
Contributor Author

insin commented Jul 24, 2016

We might switch away from webpack later.

That would be the beauty of using a plugin module (not a Webpack plugin). Usage would be:

Hey, want to use Sass? npm install react-scripts-sass (which has a peerDependency on react-scripts@1, and is automatically detected and used by react-scripts when available) and it will just work.

If a better build tool emerges, release a new major version of everything and the user is none-the-wiser to what's happening behind the scenes.

@gaearon
Copy link
Contributor

gaearon commented Jul 24, 2016

release a new major version of everything

We don’t want to get into a situation where people created 100 addons for create-react-app using webpack, we switch away from webpack, and 100 addons need to be rewritten.

@gaearon
Copy link
Contributor

gaearon commented Jul 24, 2016

Another problem with this is that people will want to install 10 different plugins, and package.json will be just as hard to maintain as it is with vanilla dependencies today.

Also, how would eject work? It would still leave you with those plugins, I suppose, unless they also have to implement an ejection mechanism (hard to maintain).

@lacker
Copy link
Contributor

lacker commented Jul 24, 2016

I think there's a decent way to do this without any explicit support in create-react-app at all - just have your "plugin" compile sass to css files, and import your css from your javascript code as demonstrated in the create-react-app project. See #78 (comment) for an example gulp task that does this. I think that seems nice because then your css preprocessing is totally decoupled from the create-react-app environment.

@mxstbr
Copy link
Contributor

mxstbr commented Jul 24, 2016

Inb4 somebody makes create-react-app-plugins. Calling it!

@gaearon
Copy link
Contributor

gaearon commented Jul 24, 2016

I think there's a decent way to do this without any explicit support in create-react-app at all - just have your "plugin" compile sass to css files, and import your css from your javascript code as demonstrated in the create-react-app project.

👍

I think this is what we’ll be recommending for SASS users.
Anybody wants to figure out a good command to put into Howto?
We could then close the issue about automatic integration for a few months until/if we decide to revisit this.

@mismith
Copy link

mismith commented Oct 20, 2016

I agree with you @gaearon, @lacker's suggestion sounds like a good one. Might have to string something that up myself to test it out.

kalekseev pushed a commit to kalekseev/create-react-app that referenced this issue Sep 11, 2017
Fixed VSCode warning for tslint trailing-comma
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants