-
-
Notifications
You must be signed in to change notification settings - Fork 611
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 documentation #175
migrate documentation #175
Conversation
Awesome! Great job @thescientist13 ! Will review later this week 💯 |
Thanks @ev1stensberg ! In reviewing it a bit more, I think I should add a section that summarizes the changes to the config specifically, e.g.
It should probably cover all possible changes, which essentially would just be a recap of the relevant bits from webpack v2+ changelog, I figure. |
If you haven't already, could you do that? |
will do! I'll try and get that in tonight. |
all set @ev1stensberg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments
MIGRATE.md
Outdated
1. All loaders now have to have the *loader* suffix, e.g. `babel` -> `babel-loader` | ||
|
||
**Note: This command does NOT handle updating dependencies in _package.json_, it is only a migration tool for the config | ||
file itself. The user is expected to manage dependencies themselves.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The users are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case it would be whomever is running migrate
.
I took inspiration from the language used in the README and used at the start of this guide (emphasis mine)
migrate
also allows users to switch to the new version of webpack without having to extensively refactor.
Happy to update it though if you think it could be better expressed another way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last line is mixing plural and singular, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see what you mean. So something like:
Users are expected to manage dependencies themselves.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all set! 💥
|
||
Given a basic configuration file like so: | ||
|
||
```javascript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code samples are nice, maybe link to the migration guide at webpack.js.org too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link is provided at the start of this doc, which is essentially lifted right from the README
The
migrate
feature eases the transition from version 1 to version 2.migrate
also allows users to switch to the new version of webpack without having to extensively refactor.
It's the link applied to refactor
Let me know if you feel it would be helpful to add it elsewhere as well or maybe instead explicitly call it out in the beginning as a link to the migration guide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right! Nice 👍
@okonet LGTM from me, need your review first. |
🎉 😄 |
* initial draft of migrate documentation * formatting * formatting * added summary of migrate changes * maintain consistent usage of user through documentation
* chore: Use prettier (#173) * build: Add webpack lint settings and style code with eslint --fix We now use the webpack eslint settings that make sense in the cli. Also use the new --fix of eslint to automatically beautify the code * Add additional .eslintrc to /bin to remove unrelated eslint errors * build: Add jest-cli as dev dependency * style: fix lintin errors and coding style according to webpack settings * build: update dependencies and add package-lock to repo * feat: Require quotes only in property names that require it * chore: Add again removed settings by merge conflict solving * tests: Fix failing test * chore: Use husky instead of pre-commit pre-commit package stopped working. See observing/pre-commit#113 husky also requires less boilerplate in the package.json * [Feature] Added support to Flow inside transformations (#174) * [FLOW] Implemented interfaces and flow types inside the transformations * [FLOW] first commit * Added flwo to two other files * Reviewed interfaces * Created different intefaces for expressions * Fixed rest of trasformations * More developments * Updated code after code review * Fixed failing tests * Removed yarn file * Applied linting * Updated packages * Applied lint style to the imports due to code review * docs: Documentation for migrate (#175) * initial draft of migrate documentation * formatting * formatting * added summary of migrate changes * maintain consistent usage of user through documentation * Feature/generate loader (#183) * Add template files for loader yeoman generator * Create yeoman generator for a webpack loader project * Add tests for loader-generator * Add `mkdirp` dependency for loader-generator * Add function to create yeoman env and run loader-generator * Add `generate-loader` command to webpack-cli * Copy loader templates from proper directory * Add template files for plugin generator * Create yeoman generator for webpack plugins * Add function to create yeoman env and run plugin generator * Add cli command to generate plugin * Register generate- commands in yargs * Add template files for loader examples and tests * Copy loader test and example template files in generator * Add template files for plugin examples and tests * Copy plugin test and example template files in generator * Refactor generator file copying, switch .includes with .indexOf in CLI arg parsing * Change `indexOf('foo') > -1` to `indexOf('foo') >= 0` * Factor out generator copy utilities into separate module * Rewrite generators using a function that returns a customized generator class * Fix linting errors * Remove //eslint-disable lines from template files * Add unit tests for CLI and add flow compilation (#186) * add unit tests for everything and flow compilation * add travis builds * add cli to signature & add ignore to trash code * port to jest * remove redundant cli command * Feature/generate loader (#183) * Add template files for loader yeoman generator * Create yeoman generator for a webpack loader project * Add tests for loader-generator * Add `mkdirp` dependency for loader-generator * Add function to create yeoman env and run loader-generator * Add `generate-loader` command to webpack-cli * Copy loader templates from proper directory * Add template files for plugin generator * Create yeoman generator for webpack plugins * Add function to create yeoman env and run plugin generator * Add cli command to generate plugin * Register generate- commands in yargs * Add template files for loader examples and tests * Copy loader test and example template files in generator * Add template files for plugin examples and tests * Copy plugin test and example template files in generator * Refactor generator file copying, switch .includes with .indexOf in CLI arg parsing * Change `indexOf('foo') > -1` to `indexOf('foo') >= 0` * Factor out generator copy utilities into separate module * Rewrite generators using a function that returns a customized generator class * Fix linting errors * Remove //eslint-disable lines from template files * add unit tests for everything and flow compilation * add travis builds * add cli to signature & add ignore to trash code * port to jest * remove redundant cli command * rebase against master * ast for devServer (#185) * feat: replace yarn backup w/ normal yarn (#160) * feat: replace yarn backup w/ normal yarn * upgrade npm & remove yarn * Use yarn if available (#189) * bump version to 1.3.4 * update package.json * 1.3.5 * prepublish -> postinstall * 1.3.6 * temp fix to prepublish issue * 1.3.7 * add propper post install * 1.3.8 * re-add manual build step * 1.3.9 * refactor * bump version * disable published pkg * add ignore patterns * add more ignore patterns for npm
What kind of change does this PR introduce?
Documentation
Did you add tests for your changes?
No tests needed
If relevant, did you update the documentation?
Yes
Summary
This resolves issue #166 by adding documentation for the
migrate
commandDoes this PR introduce a breaking change?
No breaking changes
Other information
I have created a sandbox repo that documents the research / approach / testing done for this PR
https://github.com/thescientist13/webpack-migrate-sandbox
I created a PR that shows the "after" effect of running
webpack-cli migrate
thescientist13/webpack-migrate-sandbox#1
I also have a couple of questions / observations
webpack-cli init
, the prompt for location could make it clearer that an extension isn't required, as it seemed ambiguous if it should be provided or not. Is this something I could open an issue / PR for?migrate
I didn't think about dependencies. So just confirming thatmigrate
will not update package.json, right? (see my Note: at the end of MIGRATE.md) If so, maybe the documentation (in the README?) could be clearer about any assumptions in regards to the scope of this specific command / feature? Maybe provide a checklist for users to make sure their entire project gets updated correctly? For example, UglifyJS should be pulled fromwebpack
itself not the standalone npm package, webpack versions in package.json should be upgraded, e.g.npm install webpack@^2.0.0 webpack-dev-server@^2.0.0 etc
Thanks and let me know your thoughts on this PR and if you need anymore info from me:
cc: @okonet / @pksjce / @ev1stensberg