Repository navigation
Change sourcemap and add a small increase to chunkSizeWarningLimit - #4250
Conversation
|
I think Edit: See filesize from extracted zip in jena/jena-fuseki2/apache-jena-fuseki/target, after a build on the SNAPSHOT with different sourcemap configs:
|
ca81306 to
2eaeded
Compare
2eaeded to
a7cb3df
Compare
|
I think |
a7cb3df to
7c5bdf7
Compare
|
Hi @kinow does this look ok to you? I could maybe remove the changed attributes and the cy test for the collapsed menu on a small viewport, which were cleanups suggested by Claude, to only focus and fix the bundle size. By the way, I did a first pass at looking at boostrap 6 alpha https://github.com/OyvindLGjesdal/jena/tree/bootstrap6-alpha, which has skills in the bootstrap repo for the migration. Still early with the alpha release, but it looks promising. |
kinow
left a comment
There was a problem hiding this comment.
@OyvindLGjesdal if the menu is displaying correctly, then I think that's OK to keep them. I haven't done JS in a while, so I'm a bit rusty. Thanks for including the info about true/inline (I didn't remember it! 😆 ).
No objection from me to use sourcemap: true. The only thing I'd try, is accessing the browser developer tools, and search for some code from the UI. If you can navigate with the browser, then that means that the sourcemap is working.
I guess using true, the sourcemap will be downloaded only when requested by the browser, and not by all users by default, so that'd be better for production/general users.
Thanks!!!
|
Thank you @kinow for checking it out, I'll try if I can navigate with the browser and inspect the small menu manually |
* Move source maps out of the bundles (sourcemap 'inline' -> true); browsers only fetch the .map files when devtools is open * Only import the Bootstrap components in use (collapse in main, popover in the dataset info and manage views) * Remove Bootstrap's prebuilt CSS, which was included twice * Remove data-bs-* attributes that no Bootstrap plugin handles * Add an e2e test for opening and closing the collapsed navbar menu * Increase chunkSizeWarningLimit for the geo module (target/webapp/static/geo-BWNODv4T.js 154.80 kB, if split to its own)
7c5bdf7 to
6043d55
Compare
|
Great, and thanks for fixing the bug!!! 🚀 |


to handle vite chunk size warning
GitHub issue resolved #
Currently the largest js generated by vite is around 5 MB larger than its limit (6.1 vs 1.25). The main culprit seems to be the option for inline sourcemap, which includes it as part of the bundle.
The default value for sourcemap is false, which would prevent it from being built, and getting relevant debug info out of the minified js.
Options are false, true,
'inline'or'hidden'. https://vite.dev/config/build-options#build-sourcemaptrue and 'hidden' both generate it as a json file, so that it becomes part of the build artifacts. Afaik
truemeans that it is configured while'"hidden"' means that you'd have to let the browser debugger know about the file existing, and its path. If I understand correctly, inline appends it to the file as a data url.I have configured it to use true for now, but am wondering what would be the preferred configuration.
Pull request Description:
comparable output from changed build:
Did also try to chunk using codeSplitting and split out the geo dependency for the frontend, but it became sort of complicated due to having to run codeSplit when running test, while codeSplitting for the production bundle.
So I rather slightly increased the limit with 100 kb.
By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.
See the Apache Jena "Contributing" guide.