feat: plugin support#5650
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #5650 +/- ##
==========================================
+ Coverage 88.85% 89.08% +0.23%
==========================================
Files 13 13
Lines 5893 5999 +106
==========================================
+ Hits 5236 5344 +108
+ Misses 657 655 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
We should start it in webpack-dev-middleware, currently |
0d79407 to
8664549
Compare
d8084a7 to
9890a76
Compare
9890a76 to
616b803
Compare
bjohansebas
left a comment
There was a problem hiding this comment.
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.
|
cc: @alexander-akait friendly ping for feedback |
|
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 |
|
@bjohansebas let's rebase |
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 |
bb3626c to
9912722
Compare
Those are just flaky tests, like before. You just need to rerun them and that's it. |
|
Looks like problem with lint here |
* feat!: drop support for node <20.9 * feat: update baseline-browser-mapping to version 2.9.16 * chore: remove baseline-browser-mapping dependency
* chore: remove SockJSClient and related files from the project * chore: remove SockJS support and related configurations from the project * chore: remove SockJS example files and configurations * chore: remove SockJS support and related tests from the project * refactor: change sockjs to ws for customclient * fix: update import typedef * fix: update snapshots Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com> * chore: remove SockJS and related type definitions from package.json and package-lock.json * refactor: simplify WebSocket session handling in tests * test: update WebSocket handling in client tests to use CDP sessions * fix: update snapshot for SSL certificate generation log in server options test * docs: update migration guide to reflect removal of SockJS support * refactor: remove SockJS dependency from CustomWebSocketClient * chore: update puppeteer to version 24.35.0 in package.json * fix: update import path for webpack config in client tests * fix: update createCDPSession usage in client tests * refactor: update session creation and subscription handling in tests * fix: update webSocketTransport configuration to include webSocketURL and host --------- Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
* feat: bump to express 5 Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com> * fix: update webpack-dev-middleware to version 7.4.5 and adjust snapshot for response headers * test: remove TODO comment regarding content-type in range-header test * refactor: simplify logger assignment in proxy * test: update expectation for error logging in proxy option test * test: mock console.error for proxy option tests and verify error logging * refactor: replace logger string with server.logger in allowed hosts tests * refactor: update proxy middleware to use 'on' object for request handling * docs: update migration guide to clarify proxy options changes --------- Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>
* feat: remove spdy support * docs: update migration guide to remove spdy server type support
* test: remove async bypass handling from proxy options the router does not allow sending data the way bypass did. In the router we only have the req object, so this test is removed since it is invalid (https://github.com/chimurai/http-proxy-middleware/blob/6436ffc522a3a2485c198bd2fb544db0e33e3821/src/router.ts#L7) * test: remove another test Just like in the previous commit, the router, or any other handler ,does not allow sending data; it only changes where the request should be forwarded via the proxy. Therefore, it doesn’t make sense to keep this test. * test: remove deprecated bypass option tests * test: use only pathRewrite * feat: remove deprecated bypass option from proxy configuration * test: improve tests * test: update pathFilter in proxy option tests * docs: update migration guide to reflect removal of bypass function in proxy configuration * chore: update examples * fixup! * docs: update migration guide to clarify minimum webpack version requirement
* feat: use compiler.platform to determine the target * feat: update WebSocket communication conditions and multi-compiler fallback logic * chore: update qs package to version 6.15.0 * fixup!
…ng in Server class
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.
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
| if (seenFirstDone.has(childCompiler)) return; | ||
| seenFirstDone.add(childCompiler); | ||
| firstDoneCount++; | ||
| if (firstDoneCount < childCompilers.length) return; |
There was a problem hiding this comment.
Can you clarify when we need firstDoneCount?
| childCompiler.hooks.done.tapPromise(pluginName, () => | ||
| onChildDone(childCompiler), | ||
| ); | ||
| childCompiler.hooks.shutdown.tapPromise(pluginName, onChildShutdown); |
There was a problem hiding this comment.
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
| }; | ||
|
|
||
| for (const childCompiler of childCompilers) { | ||
| childCompiler.hooks.beforeCompile.tapPromise(pluginName, ensureSetup); |
There was a problem hiding this comment.
Can we avoid beforeCompile at all, it is unsafe in some cases, ideally we should use only done and shutdown
There was a problem hiding this comment.
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
|
okay tomorrow i will continue with this |
c2dd24b to
4810909
Compare
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?