Closed vhiairrassary closed 3 years ago
The PR now contains changes to parse warning and errors (I removed the --bail
option as it prevents the plugin to parse the errors: when using it then there is no JSON available on stdout
, the only error is directly written to stderr
by Webpack).
Thanks a lot for opening this PR @vhiairrassary!
Is anyone watching this repository interested in helping?
I could review it as I did webpack 4 but I,m a bit stretched on time
@vhiairrassary Do you think this needs more work? There are a few checkboxes on the description as "pending"
@cquiroz Thank for the review. I just rebased the PR and I think it is good enough for now. If maintainers agree to merge (it means we drop support for webpack < 5, on master at least) we can:
Toughts? On my side I don't have the permission to publish, can you do it please?
I think we should do an RC for testers, it would be great to have a sort of migration guide but I don’t know how feasible is that considering how different webpack configurations are
I can produce releases but not update the documentation site
I rebased the PR to verify tests are still ✅ with GitHub Actions. Can I ask you to produce a release for this PR, without merging it, so interested users can test it? It would allow to get feedbacks, find bugs, help us to write a migration guide, etc.
Also, if we merge it it will require a bump of the major version due to the breaking changes. It might be a good idea to tackle the migration from fastOptJS
to fastLinkJS
.
I'm not sure I can make a release only for test, I could do 0.21.0-RC1
though. I'm not sure if that will trigger scala-steward
updates
It seems this is ready for testing
Since it was released in v0.21.0 already, could we have ChangeLog page updated with the notes, please?
webpack-dev-server
invocation changed as well as the output format for errors and warnings)345,12 Kib
instead of345127
)Built at
log line from stats, as in Webpack 5 (sbt is already outputting a similar line after each task).webpack-dev-server
invocation changed, the server port is not part of the command line but it is injected in the generated webpack configuration (might be a breaking for some users).--bail
flag when invokingwebpack
as it does not return a JSON but print the error instderr
directly (parsing is failing because of that)net.sourceforge.htmlunit
in test to support JS from Webpack 5. Bump some npm dependencies in test to support Webpack 5.Currently I am able to use this version to compile a small application using webpack 5 (including
webpack-dev-server
).Remaining tasks for future 🚧:
Links
Raw Webpack outputs
Webpack 5 (development)
``` asset myapp-fastopt.js 1.34 MiB [emitted] (name: myapp-fastopt) asset index.html 1.72 KiB [emitted] asset icon-32.svg 180 bytes [emitted] [from: assets/icon-32.svg] ./myapp-fastopt.js 1.31 MiB [built] [code generated] webpack 5.12.0 compiled successfully in 544 ms ```Webpack 5 (production)
``` asset myapp-opt-fe44374c39438c893626.js 258 KiB [emitted] [immutable] [minimized] (name: myapp-opt) asset index.html 1.63 KiB [emitted] asset icon-32-51fa7e7e665ad3b294fe37c44f732d62.svg 180 bytes [emitted] [immutable] [from: assets/icon-32.svg] ./myapp-opt.js 260 KiB [built] [code generated] webpack 5.12.0 compiled successfully in 3547 ms ```Webpack 4 (development)
``` Hash: 3d2baa6a7539e076a4f3 Version: webpack 4.44.2 Time: 482ms Built at: 01/09/2021 9:50:03 PM Asset Size Chunks Chunk Names icon-32.svg 180 bytes [emitted] index.html 1.72 KiB [emitted] myapp-fastopt.js 1.34 MiB myapp-fastopt [emitted] myapp-fastopt Entrypoint myapp-fastopt = myapp-fastopt.js [0] multi ./myapp-fastopt.js 28 bytes {myapp-fastopt} [built] [./myapp-fastopt.js] 1.31 MiB {myapp-fastopt} [built] Child HtmlWebpackCompiler: Asset Size Chunks Chunk Names icon-32.svg 180 bytes [emitted] + 1 hidden asset Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0 [./assets/icon-32.svg] 55 bytes {HtmlWebpackPlugin_0} [built] [./node_modules/html-webpack-plugin/lib/loader.js!./assets/index.ejs] 2.04 KiB {HtmlWebpackPlugin_0} [built] ```Webpack 4 (production)
``` Hash: d5a693b21ce4f40515c4 Version: webpack 4.44.2 Time: 391ms Built at: 01/09/2021 9:50:50 AM Asset Size Chunks Chunk Names icon-32-51fa7e7e665ad3b294fe37c44f732d62.svg 180 bytes [emitted] [immutable] index.html 1.76 KiB [emitted] myapp-opt-350577d29ed7f637efda.js 259 KiB 0 [emitted] [immutable] myapp-opt Entrypoint myapp-opt = myapp-opt-350577d29ed7f637efda.js [0] multi ./myapp-opt.js 28 bytes {0} [built] [1] ./myapp-opt.js 260 KiB {0} [built] Child HtmlWebpackCompiler: Asset Size Chunks Chunk Names icon-32-51fa7e7e665ad3b294fe37c44f732d62.svg 180 bytes [emitted] [immutable] + 1 hidden asset Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0 [0] ./assets/icon-32.svg 88 bytes {0} [built] [1] ./node_modules/html-webpack-plugin/lib/loader.js!./assets/index.ejs 2.04 KiB {0} [built] ```Raw warnings
Webpack 5
``` WARNING in ./app-fastopt.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/lihaoyi/Github/scalatags/scalatags/src/scalatags/text/Builder.scala' file: Error: ENOENT: no such file or directory, open '/Users/lihaoyi/Github/scalatags/scalatags/src/scalatags/text/Builder.scala' WARNING in ./app-fastopt.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map from '/Users/lihaoyi/Github/sourcecode/sourcecode/src/sourcecode/SourceContext.scala' file: Error: ENOENT: no such file or directory, open '/Users/lihaoyi/Github/sourcecode/sourcecode/src/sourcecode/SourceContext.scala' WARNING in ./app-fastopt.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map: 'https://raw.githubusercontent.com/scala-js/scala-js-dom/v1.1.0/src/main/scala/org/scalajs/dom/package.scala' URL is not supported WARNING in ./app-fastopt.js Module Warning (from ./node_modules/source-map-loader/dist/cjs.js): Failed to parse source map: 'https://raw.githubusercontent.com/scala-js/scala-js/v1.4.0/javalanglib/src/main/scala/java/lang/Boolean.scala' URL is not supported ```Webpack 5
``` WARNING in ./app-fastopt.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../../../../../../../../../lihaoyi/Github/scalatags/scalatags/src/scalatags/text/Builder.scala': Error: Can't resolve '../../../../../../../../../lihaoyi/Github/scalatags/scalatags/src/scalatags/text/Builder.scala' in '/Users/vhiairrassary/Code/test/test/app/target/scala-2.13/scalajs-bundler/main' @ multi ./app-fastopt.js app-fastopt[0] WARNING in ./app-fastopt.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file '../../../../../../../../../lihaoyi/Github/sourcecode/sourcecode/src/sourcecode/SourceContext.scala': Error: Can't resolve '../../../../../../../../../lihaoyi/Github/sourcecode/sourcecode/src/sourcecode/SourceContext.scala' in '/Users/vhiairrassary/Code/test/test/app/target/scala-2.13/scalajs-bundler/main' @ multi ./app-fastopt.js app-fastopt[0] WARNING in ./app-fastopt.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file 'https://raw.githubusercontent.com/scala-js/scala-js-dom/v1.1.0/src/main/scala/org/scalajs/dom/package.scala': Error: Can't resolve './https://raw.githubusercontent.com/scala-js/scala-js-dom/v1.1.0/src/main/scala/org/scalajs/dom/package.scala' in '/Users/vhiairrassary/Code/test/test/app/target/scala-2.13/scalajs-bundler/main' @ multi ./app-fastopt.js app-fastopt[0] WARNING in ./app-fastopt.js Module Warning (from ./node_modules/source-map-loader/index.js): (Emitted value instead of an instance of Error) Cannot find source file 'https://raw.githubusercontent.com/scala-js/scala-js/v1.4.0/javalanglib/src/main/scala/java/lang/Boolean.scala': Error: Can't resolve './https://raw.githubusercontent.com/scala-js/scala-js/v1.4.0/javalanglib/src/main/scala/java/lang/Boolean.scala' in '/Users/vhiairrassary/Code/test/test/app/target/scala-2.13/scalajs-bundler/main' @ multi ./app-fastopt.js app-fastopt[0] ```