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

Remove v1 -> v2-specific transformations #405

Merged
merged 1 commit into from
Apr 18, 2018
Merged

Remove v1 -> v2-specific transformations #405

merged 1 commit into from
Apr 18, 2018

Conversation

bitpshr
Copy link
Member

@bitpshr bitpshr commented Apr 15, 2018

What kind of change does this PR introduce?
Feature

Did you add tests for your changes?
Yes

If relevant, did you update the documentation?
N/A

Summary
The loaders, loaderOptionsPlugin, and resolve transformations are specific to v1 -> v2 upgrades and as such are no longer needed. This PR removes these transformations and updates migrations test snapshots accordingly.

Resolves #383
Resolves #384
Resolves #388

Does this PR introduce a breaking change?
Yes. This PR removes previously-existing transformations and aims to produce a v4-compatible configuration instead of a v2-compatible configuration.

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we can keep this for a bit longer. What's the damage around keeping the file?

Copy link
Member

@dhruvdutt dhruvdutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep this code, maybe at some other place.
Can we support migration to different versions by picking the current version from package.json or something?

@evenstensberg
Copy link
Member

no. That would raise an incredible amount of tech debt in the length.

@bitpshr
Copy link
Member Author

bitpshr commented Apr 15, 2018

Thanks for the thoughts @ev1stensberg @dhruvdutt. It sounds like we have three options:

  1. Remove the code altogether. The transformation is firmly v1 -> v2 specific, and git provides historical record of the code if we ever need to reference it or use it in the future (which is unlikely.)
  2. Leave the code in-place so the transformation continues to be tested and maintained, but remove it from the transforms object since it's no longer relevant or supported.
  3. Do nothing; leave the code in place and leave the transformation active.

I personally vote for option 1. While there's technically no harm in leaving the code in-place, it does add to both the bundle size and maintenance burden for functionality that is no longer relevant or supported in any way. Leaving the code in place also misleads anyone who is reading our source code. I feel that if our transformations are now v3 -> v4, we should be uniform across the board.

Regardless of whether we go with option 1 or option 2, I don't think option 3 is valid: we should not be migrating v1 configurations anymore, especially only for specific transformations. At the very least, we need to disable this transformation, but I can't think of a concrete reason not to also remove it.

@dhruvdutt
Copy link
Member

@bitpshr I would say let's keep it till we get the migration for 3 to 4 to a stable point and then we can clean up. :)

@ematipico
Copy link
Contributor

ematipico commented Apr 15, 2018

I personally think that we should move on and stop maintaining code for old versions of webpack, especially version 1. If in the future there would be bugs, we can always go back and make a patch. Versioning systems are made for these kind of situations.

@bitpshr
Copy link
Member Author

bitpshr commented Apr 16, 2018

Thanks for the input @ematipico @ev1stensberg @dhruvdutt . Since it sounds like we're deciding to go ahead and nix the dead v1 - v2 code, let me know if you'd like anything cleaned up before landing.

Copy link
Contributor

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am personally fine with this change. Awesome job!

@ematipico ematipico added the Semver: major 💣 When delivering a new feature that breaks or a complete revamp of the internals label Apr 18, 2018
@evenstensberg
Copy link
Member

Sounds good to me, needs a rebase before merge

@webpack-bot
Copy link

@bitpshr Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@ematipico Please review the new changes.

@webpack-bot
Copy link

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@bitpshr
Copy link
Member Author

bitpshr commented Apr 18, 2018

Thanks @ev1stensberg and @ematipico. Rebased.

@evenstensberg evenstensberg merged commit d8e0c10 into webpack:master Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: CI-ok PR: review-outdated Semver: major 💣 When delivering a new feature that breaks or a complete revamp of the internals
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update transformation: resolve Update transformation: loaders Update transformation: loaderOptionsPlugin
5 participants