Skip to content
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

Updated sass code #1328

Merged
merged 2 commits into from
Dec 30, 2024
Merged

Updated sass code #1328

merged 2 commits into from
Dec 30, 2024

Conversation

garrettw
Copy link
Contributor

@garrettw garrettw commented Dec 29, 2024

changed @import to @use and fixed everything that affected

See: https://sass-lang.com/d/import

Webpack does build successfully, and the only Sass warnings now are from upstream (fontawesome).

Fixes #1319

@garrettw garrettw added dependencies Pull requests that update a dependency file frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end labels Dec 29, 2024
@melroy89
Copy link
Member

I also notice these warnings after updating webpack. I didn't know how to solve it. Luckily you do :)

melroy89
melroy89 previously approved these changes Dec 29, 2024
@garrettw
Copy link
Contributor Author

@melroy89 would you be able to test this branch out and verify that no CSS is broken on the front end? Or anyone else for that matter?

Or if I’m able to fully test it myself before anyone else does, I’ll let you know here.

@melroy89
Copy link
Member

Sure I can test it on kbin.melroy.org. There is a small merge conflict though with webpack config file.

@garrettw
Copy link
Contributor Author

I see that now. I’m not near a computer right now so if you want to fix it before I do, feel free. Without seeing what the exact conflict is, I think the correct resolution should be to just rename the file in this branch to .cjs.

@melroy89
Copy link
Member

I see, I fixed it myself :)

@melroy89
Copy link
Member

And... it's running live at: https://kbin.melroy.org now.

With the following warnings left:

99% done plugins FriendlyErrorsWebpackPlugin WARN  Compiled with 8 warnings                                                                                                                                                                          9:44:19 PM

 warn  in ./assets/styles/app.scss                                                                                                                                                                       9:44:19 PM

Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 8, column 8 of file:///var/www/kbin.melroy.org/html/node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss:8:8:
Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

More info and automated migrator: https://sass-lang.com/d/import

8 | @import 'functions';


node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss 9:9  @use
assets/styles/app.scss 1:1                                            root stylesheet


 warn  in ./assets/styles/app.scss                                                                                                                                                                       9:44:19 PM

Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 8, column 26 of file:///var/www/kbin.melroy.org/html/node_modules/@fortawesome/fontawesome-free/scss/_icons.scss:8:26:
Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use string.unquote instead.

More info and automated migrator: https://sass-lang.com/d/import

8 |     #{$fa-icon-property}: unquote("\"#{ $icon }\"");


node_modules/@fortawesome/fontawesome-free/scss/_icons.scss 9:27       @import
node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss 20:9  @use
assets/styles/app.scss 1:1                                             root stylesheet


 warn  in ./assets/styles/app.scss                                                                                                                                                                       9:44:19 PM

Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 9, column 8 of file:///var/www/kbin.melroy.org/html/node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss:9:8:
Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

More info and automated migrator: https://sass-lang.com/d/import

9 | @import 'variables';


node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss 10:9  @use
assets/styles/app.scss 1:1                                             root stylesheet


 warn  in ./assets/styles/app.scss                                                                                                                                                                       9:44:19 PM

Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 10, column 8 of file:///var/www/kbin.melroy.org/html/node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss:10:8:
Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

More info and automated migrator: https://sass-lang.com/d/import

10 | @import 'mixins';


node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss 11:9  @use
assets/styles/app.scss 1:1                                             root stylesheet


 warn  in ./assets/styles/app.scss                                                                                                                                                                       9:44:19 PM

Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 11, column 8 of file:///var/www/kbin.melroy.org/html/node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss:11:8:
Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

More info and automated migrator: https://sass-lang.com/d/import

11 | @import 'core';


node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss 12:9  @use
assets/styles/app.scss 1:1                                             root stylesheet


 warn  in ./assets/styles/app.scss                                                                                                                                                                       9:44:19 PM

Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 12, column 8 of file:///var/www/kbin.melroy.org/html/node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss:12:8:
Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.

More info and automated migrator: https://sass-lang.com/d/import

12 | @import 'sizing';


node_modules/@fortawesome/fontawesome-free/scss/fontawesome.scss 13:9  @use
assets/styles/app.scss 1:1                                             root stylesheet


 warn  in ./assets/styles/app.scss                                                                                                                                                                       9:44:19 PM

Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
Deprecation Warning on line 28, column 54 of file:///var/www/kbin.melroy.org/html/node_modules/@fortawesome/fontawesome-free/scss/brands.scss:28:54:
Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use string.unquote instead.

More info and automated migrator: https://sass-lang.com/d/import

28 |   .#{$fa-css-prefix}-#{$name} { #{$fa-icon-property}: unquote("\"#{ $icon }\""); }


node_modules/@fortawesome/fontawesome-free/scss/brands.scss 29:55  @use
assets/styles/app.scss 3:1                                         root stylesheet


 warn  in ./assets/styles/app.scss                                                                                                                                                                       9:44:19 PM

Module Warning (from ./node_modules/sass-loader/dist/cjs.js):
12 repetitive deprecation warnings omitted.
Run in verbose mode to see all warnings.

But most likely we won't be able to fix these yourselves.

@melroy89
Copy link
Member

melroy89 commented Dec 29, 2024

On the federation page, the 'badges' for each domain seems to be broken (regression on #1329):

image

Statistics pages seems also be broken now:

image

image

And I notice an error in the error console log:

Uncaught ReferenceError: require is not defined
    6283 https://kbin.melroy.org/build/app.30105e73.js:1
    o https://kbin.melroy.org/build/runtime.611f8a05.js:1
    <anonymous> https://kbin.melroy.org/build/app.30105e73.js:1
    O https://kbin.melroy.org/build/runtime.611f8a05.js:1
    <anonymous> https://kbin.melroy.org/build/app.30105e73.js:1
    r https://kbin.melroy.org/build/runtime.611f8a05.js:1
    <anonymous> https://kbin.melroy.org/build/app.30105e73.js:1
app.30105e73.js:1:16946

Here is the same error message in Dev mode:

Uncaught ReferenceError: require is not defined
    js bootstrap.js:4
    Webpack 9
bootstrap.js:4:36

@garrettw
Copy link
Contributor Author

Got it, thanks for the feedback. Feel free to rollback prod and I’ll take a look at fixing this soon.

@melroy89
Copy link
Member

I actually do expect you test your changes 😆 .. Sorry that I approved and let it merge. Please, next time validate your changes yourself as well.

@garrettw
Copy link
Contributor Author

Sorry about that, I thought I had. Guess I didn’t look in enough places.

@garrettw garrettw removed the dependencies Pull requests that update a dependency file label Dec 30, 2024
changed @import to @use and fixed everything that affected
Copy link
Member

@melroy89 melroy89 left a comment

Choose a reason for hiding this comment

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

I also tested this PR, this now seems to work fine as well.

@garrettw garrettw merged commit 1a70d0f into main Dec 30, 2024
7 checks passed
@garrettw garrettw deleted the sass-updates branch December 30, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend Visual issues, improvements, bugs or other aspects relating mostly to the front end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Webpack/Sass warnings
2 participants