GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: plugin support by bjohansebas · Pull Request #5650 · webpack/webpack-dev-server Conversation
Member
Summary What kind of change does this PR introduce? Did you add tests for your changes? Does this PR introduce a breaking change? If relevant, what needs to be documented once your changes are merged or what have you already documented?
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@ ## next #5650 +/- ## ========================================== + Coverage 88.95% 89.23% +0.28% ========================================== Files 13 13 Lines 5964 6082 +118 ========================================== + Hits 5305 5427 +122 + Misses 659 655 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We should start it in webpack-dev-middleware, currently |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
0d79407 to
8664549
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
d8084a7 to
9890a76
Compare
There was an error while loading. Please reload this page.
9890a76 to
616b803
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
These changes should work without requiring any changes to webpack-cli yet. Once this is merged, we can work on a patch for webpack-cli to use the plugin support, but it is independent of changes to webpack-cli.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
cc: @alexander-akait friendly ping for feedback |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Will look soon, I little bit busy, we should make the new major release the next week, I will help you to finish remains tasks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@bjohansebas let's rebase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
1060a9c to
4591762
Compare
|
@bjohansebas can take a look at our failed tests, a lot of PRs without green, we need to resolve it, thanks |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
bb3626c to
9912722
Compare
Those are just flaky tests, like before. You just need to rerun them and that's it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Looks like problem with lint here |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
0102816 to
2d6d746
Compare
| // the user is not in control of the plugin lifecycle here, so we stay | ||
| // silent rather than logging a warning. | ||
| const isBuildMode = () => | ||
| childCompilers.every((child) => !child.watching && !child.options.watch); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Each compiler have watching when it is watching, no need to check on watch, at least I can see situation when watch will be true, but watching undefined
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (seenFirstDone.has(childCompiler)) return; | ||
| seenFirstDone.add(childCompiler); | ||
| firstDoneCount++; | ||
| if (firstDoneCount < childCompilers.length) return; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify when we need firstDoneCount?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| childCompiler.hooks.done.tapPromise(pluginName, () => | ||
| onChildDone(childCompiler), | ||
| ); | ||
| childCompiler.hooks.shutdown.tapPromise(pluginName, onChildShutdown); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should have the same hooks for multi compiler, and so don't use for/of, but we can postpone it and improve later
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| }; | ||
|
|
||
| for (const childCompiler of childCompilers) { | ||
| childCompiler.hooks.beforeCompile.tapPromise(pluginName, ensureSetup); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid beforeCompile at all, it is unsafe in some cases, ideally we should use only done and shutdown
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think we can done everything on done, also please add a test case what we really change outputFileSystem and use it, not webpack built-in the real fs
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Doing it only through done is complicated because there are processes that need to be initialized much earlier. That's why beforeCompile is used.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
okay tomorrow i will continue with this |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
c2dd24b to
4810909
Compare
b2914df to
5be7251
Compare
There was an error while loading. Please reload this page.
🦋 Changeset detectedLatest commit: cda0912 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
5be7251 to
07b85dc
Compare
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Allow webpack-dev-server to run as a webpack plugin. The server can now be created without explicitly passing a compiler, integrates with the compiler lifecycle to prevent multiple starts on recompilation, ensures clean shutdown, and supports MultiCompiler setups with multiple independent plugin servers.
Add e2e coverage for the plugin API (api-plugin.test.js), MultiCompiler and multiple independent plugin servers, build-mode behavior, and related logging snapshots. Add the compile helper and port mappings used by these tests.
Add a runnable example (app, webpack config and README) showing how to configure and use webpack-dev-server as a webpack plugin.
…etter handling of compiler events
6efe969 to
cda0912
Compare
There was an error while loading. Please reload this page.
* feat: add plugin support Allow webpack-dev-server to run as a webpack plugin. The server can now be created without explicitly passing a compiler, integrates with the compiler lifecycle to prevent multiple starts on recompilation, ensures clean shutdown, and supports MultiCompiler setups with multiple independent plugin servers. * test: add tests for plugin support Add e2e coverage for the plugin API (api-plugin.test.js), MultiCompiler and multiple independent plugin servers, build-mode behavior, and related logging snapshots. Add the compile helper and port mappings used by these tests. * docs: add example for using webpack-dev-server as a plugin Add a runnable example (app, webpack config and README) showing how to configure and use webpack-dev-server as a webpack plugin. * chore: add changeset for plugin support * test: add test for in-memory file system behavior in plugin * refactor: update hooks to use watchRun instead of beforeCompile for better handling of compiler events * test: add hot module replacement tests for plugin API * test: enhance output.clean behavior test for in-memory asset serving * test: log listen() failure instead of throwing in server setup * refactor: update constructor to make compiler parameter optional for plugin usage
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.