Skip to content

Cleanup node warnings in build #3010

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

Merged
merged 4 commits into from
Feb 18, 2025
Merged

Conversation

OyvindLGjesdal
Copy link
Contributor

@OyvindLGjesdal OyvindLGjesdal commented Feb 14, 2025

GitHub issue resolved #

Pull request Description:

Going through node warnings from the GH-action build.

Changing legacy node-sass api to modern and adding peer dependencies solves the warnings. while the other changes just silences them (1250kb as a bundle limit sounds huge to me). Since the largest number of SASS warnings are inherited from bootstrap, I thought it could make sense to hide them. I am more unsure if it makes sense to up the bundle limit for less noise in the build output (since it looks like an issue).


  • Tests are included.
  • Documentation change and updates are provided for the Apache Jena website
  • Commits have been squashed to remove intermediate development commit messages.
  • Key commit messages start with the issue number (GH-xxxx)

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.

Removes:
warning [INFO] DEPRECATION WARNING [legacy-js-api]: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.

Uses sass-embedded as recommended by vite docs https://vite.dev/config/shared-options.html#css-preprocessoroptions
yarn add --dev @babel/core@^7.0.1 @babel/preset-env@^7.0.0 babel-loader@^9 webpack@^5
related warnings are being adressed in twbs/bootstrap#40849
@afs afs requested a review from kinow February 14, 2025 19:06
@@ -65,14 +68,14 @@
"nanoid": "^5.0.9",
"nodemon": "^3.0.1",
"run-script-os": "^1.1.6",
"sass": "^1.69.4",
"sass-embedded": "^1.85.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// Our largest chunk: dist/assets/yasqe.min-ec8f4984.js 508.16 kB │ gzip: 130.97 kB
chunkSizeWarningLimit: 550,
// Our largest chunk: target/webapp/static/Query-CakHSd_3.js 1,172.48 kB │ gzip: 350.95 kB
chunkSizeWarningLimit: 1250,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the code in a while, but I remember the warnings from s/css and chunk size, but I never had time to check each and see if we had a fix or if we had to simply suppress.

Can't tell whether it's better to simply suppress or leave the warnings in the build log. I'd leave them so I don't forget to fix it later, but if that is an issue for others actively maintaining it then it's probably better to suppress these.

Thanks!

Copy link
Contributor Author

@OyvindLGjesdal OyvindLGjesdal Feb 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kinow and thanks for the review

I'd leave them so I don't forget to fix it later, but if that is an issue for others actively maintaining it then it's probably better to suppress these.

I think there are two different issues:

  • The chunk size warning I think is probably better to leave in the logs, so it is kept visible.
  • the scss (44/60 warnings in the build) warnings I believe are mostly inherited from Bootstrap. There are some scss errors which are local to the Jena Fuseki UI, but most of the warnings are for rules within node_modules which are native to Bootstrap. Waiting (creating an issue?) for the Bootstrap patch to complete and then (fixing the Jena warnings/attempting migration) also make senses, but I silenced it due to it mostly being external and because of the large number of warnings.

Attempting to use the helper for migration (https://sass-lang.com/documentation/breaking-changes/import/) complains about bootstrap, and exits before changing anything. (The docs doesn't mention how to fix manually 🤔)

Hopefully this will be fixed upstream, so that the migration for the UI works:

# after minor fixes to import paths in index.scss to relative, and adding a css file extension:
sass-migrator --migrate-deps --load-path . --dry-run module --migrate-deps src/styles/index.scss --dry-run
Error: The migrator wants to rename a member in node_modules/bootstrap/scss/_functions.scss, but it is not being migrated. You should re-run the migrator with --migrate-deps or with node_modules/bootstrap/scss/_functions.scss as one of your entrypoints.

I'm ok with updating to either, I am unsure of if the warning silencings are helpful or not, but got a bit caught in the moment and tried to get towards 0 warnings in the build 😎

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think dart-sccs / Bootstrap is targetted for Bootstrap6 ... which is not out yet.
twbs/bootstrap#40849 (comment)

Much as I dislike hiding warnings, this may be the better way for jena-fuseki-ui because there are so many lines of output.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objections for that then., and maybe +1 for the chunk size warning (although from time to time I used to use that vue/vite embedded helper app to visualize metrics for the app, and there was a tab/view that shows that too -- so no objection if we suppress that too).

@kinow
Copy link
Member

kinow commented Feb 14, 2025

And about the deps, I think sass-embedded is a good choice, and the other ones (IIRC) were transitive dependencies and somewhere in the log it would say that we were using it but not declaring in package.json. Thanks for fixing those.

@afs afs merged commit 54b1756 into apache:main Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants