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

Migrate and init should move to mini-css-extract-plugin #373

Closed
ematipico opened this issue Apr 5, 2018 · 16 comments
Closed

Migrate and init should move to mini-css-extract-plugin #373

ematipico opened this issue Apr 5, 2018 · 16 comments

Comments

@ematipico
Copy link
Contributor

ematipico commented Apr 5, 2018

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
At the moment, when migrating or initiating a new configuration ExtractTextPlugin it still uses ExtractTextPlugin. ExtractTextPlugin should become MiniCssExtractPlugin

What is the expected behavior?
The cli should ask it the user wants to migrate to v3 or v4 of webpack. If v4, it should migrate to MiniCssExtractPlugin. The init feature should use MiniCssExtractPlugin as well.

If this is a feature request, what is motivation or use case for changing the behavior?
Supporting the new MiniCssExtractPlugin

@ematipico ematipico changed the title Migrate should move to mini-css-extract-plugi Migrate should move to mini-css-extract-plugin Apr 5, 2018
@matheus1lva
Copy link
Member

matheus1lva commented Apr 5, 2018

Do we want to keep v1->v2 migration or deprecate it and just have v3->v4?

@ematipico
Copy link
Contributor Author

Honestly I'd propose a breaking change and going straight from v3 to v4

@matheus1lva
Copy link
Member

Sounds reasonable!

@bitpshr
Copy link
Member

bitpshr commented Apr 6, 2018

I'll work on this feature if no one else has started it.

@evenstensberg evenstensberg changed the title Migrate should move to mini-css-extract-plugin Migrate and init should move to mini-css-extract-plugin Apr 7, 2018
@ematipico
Copy link
Contributor Author

@bitpshr Thanks! You can pick it up! Consider that half of the job is already done here #363
You'd just need to work on the migrate part

@bitpshr
Copy link
Member

bitpshr commented Apr 8, 2018

@ematipico To confirm, we should be replacing the existing v1 -> v2 ExtractTextPlugin transform with a v3 -> v4 transform that switches ExtractTextPlugin with MiniCssExtractPlugin? Are other transforms also v3 - v4 now and not v1 -> v2?

@matheus1lva
Copy link
Member

matheus1lva commented Apr 9, 2018

@bitpshr yes, we are creating a breaking change here. V3->V4. Yes again, Change extract-text to mini-css.
I don't really think that there are any more needed changes

@ematipico
Copy link
Contributor Author

Exactly. Inside the migrate folder we have all the configuration options that we currently support. That's a meaty change and we have also add snapshot tests. Ideally you could also make WIP PR if you require some help or advice

@bitpshr
Copy link
Member

bitpshr commented Apr 9, 2018

Thanks @ematipico and @playma256. I've completed an initial upgrade of the ExtractTextPlugin transformation on my branch. It now transforms v3 configuration to v4 instead of v1 to v2 and uses MiniCssExtractPlugin.

Was the intention to use this issue / PR to track all other transformation upgrades as well, or should I submit my PR as-is and we can open individual tickets for remaining v3 -> v4 changes?

@matheus1lva
Copy link
Member

matheus1lva commented Apr 9, 2018

Just open a pr for that. Since this issue just refeers to miniCss lets stick with that. If any other transformations are required, we can open more.

@ematipico
Copy link
Contributor Author

ematipico commented Apr 9, 2018

After an internal discussion about the migrate, where the intention is to migrate the configuration always the most up to date version, so in this case webpack 4, I think that a breaking change is not necessary and we should move straight to MiniCssExtractPlugin. What do you guys think?

@matheus1lva
Copy link
Member

matheus1lva commented Apr 9, 2018

Well, this is sort of a "breaking change" anyways, since we are removing the option to migrate to older versions. And yes, i started touching onto some files, but bitshr already said he would like to work, so i let him do that and my initial idea was to remove the extractTextPlugin folder and have just a miniCssExtractPlugin folder and in there all these transformations. In this way it would be much cleaner.

@bitpshr could you move all this code to a miniCssExtractPlugin folder? That would be much more cleaner for future devs.

@bitpshr
Copy link
Member

bitpshr commented Apr 9, 2018

@ematipico @playma256 I agree that we should always migrate to the latest version, but do we support migrating from v1 -> v4, v2 -> v4, and v3 -> v4, or just v3 -> v4? If we decide to make our transformations be able to upgrade any previous version to the latest version, the AST logic will get incredibly complex.

I vote that we move to actively support upgrading the previous version to the latest version, so v3 -> v4 in this case. When v5 is released, we should upgrade our transforms to instead support upgrading v4 - v5, and so on.

@matheus1lva
Copy link
Member

matheus1lva commented Apr 9, 2018

I made the same question, when i first read this issue.
ematipico answer was:

Honestly I'd propose a breaking change and going straight from v3 to v4

You comment resonates with what he said, and i do agree too. Let's just support newest versions of the webpack config, otherwise the whole migration folder would be such a mess.

@ematipico
Copy link
Contributor Author

I also think that the usage of webpack v1 is now deprecated.
Yeah, I think we should just focus from v3 to v4

@bitpshr
Copy link
Member

bitpshr commented Apr 9, 2018

Sounds good to me. PR submitted for the extractTextPlugin transform. Issues opened to track updates to the remaining transforms as well.

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

No branches or pull requests

4 participants