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

@import migration doesn't work; @use isn't a replacement for include #2402

Closed
garrett opened this issue Oct 23, 2024 · 2 comments
Closed

@import migration doesn't work; @use isn't a replacement for include #2402

garrett opened this issue Oct 23, 2024 · 2 comments

Comments

@garrett
Copy link

garrett commented Oct 23, 2024

Hi, we've been hit by tons of warnings about @import recently in Cockpit, and tried the suggested migration tool. It doesn't work as intended, and even changing to @use ... as *; doesn't provide a transparent migration path.

We have a bug about this @

And a first pass attempt at migration, using only the migration tool at:

We're also importing SCSS files from within JSX files, and SASS complains about that as well.

Additionally, we're using PatternFly 5, which is the current version of the PatternFly component library, and they're only changing some of these things in PatternFly 6, which is a major change that changes the way things work and look, which means nobody can easily upgrade to it. Even if we were able to upgrade Cockpit to fix the "issues" that are a result of the SASS @import deprecation, we won't be able to fix PatternFly 5, and they won't either (as they're concentrating on the new upcoming version instead).

Could SASS have something like @sassimport that works the way that @import works for SASS specific code?

Also: When is version 3.x? Weeks away? Months away? Years away? I see there's a 2.0.0 milestone, but it's 10% done, and I don't see any other plans anywhere.

Thanks!

Quick summary

  1. Migration doesn't work as expected
  2. @use doesn't work as a replacement for @import, even with @use ... as *;
  3. Upgrading a codebase can't work until dependencies themselves are upgraded (and this is tricky)
  4. There's no stated timeline for the breaking change, so we don't know how to plan for this
@nex3
Copy link
Contributor

nex3 commented Oct 23, 2024

First of all: this report comes across as quite rude in how it just states that things "don't work" without providing any details or filing specific issues. I understand that you're frustrated, but that doesn't give you the right to take it out on me. Please reconsider how you interact with people online, especially people you're asking for free support on their product that you're also using for free.


Let's take these issues one by one.

Hi, we've been hit by tons of warnings about @import recently in Cockpit, and tried the suggested migration tool. It doesn't work as intended, and even changing to @use ... as *; doesn't provide a transparent migration path.

If you're experiencing specific bugs with the Sass migrator, please file them at https://github.com/sass/migrator/issues/new. Just saying "it doesn't work as intended" is not helpful; please provide a minimal reproduction as well as an explanation of why you believe that behavior to be incorrect.

We're also importing SCSS files from within JSX files, and SASS complains about that as well.

Sass doesn't natively support anything to do with JSX. If you're seeing problems here, you'll need to report them to whoever maintains the Sass-in-JSX tool you're using. Note that the Sass migrator can only migrate actual Sass files, not Sass embedded in other formats.

Additionally, we're using PatternFly 5, which is the current version of the PatternFly component library, and they're only changing some of these things in PatternFly 6, which is a major change that changes the way things work and look, which means nobody can easily upgrade to it. Even if we were able to upgrade Cockpit to fix the "issues" that are a result of the SASS @import deprecation, we won't be able to fix PatternFly 5, and they won't either (as they're concentrating on the new upcoming version instead).

This sounds like an issue you should bring up with PatternFly. We've done everything we could to make sure users knew that @import was going to be phased out in favor of @use. This was part of the public discussion around the new module system starting in 2015. We announced the launch of the module system five years ago, along with a clear timeline (which we've since extended substantially) for removing @import. The only step further we could take to publicize this was to start emitting warnings for @import uses, which we did this month.

Could SASS have something like @sassimport that works the way that @import works for SASS specific code?

Well, @import still works, and will continue to for at least two years, so in that sense yes. In an ongoing sense, no—the point of the module system is to remove the problems caused by having a global import.

Also: When is version 3.x? Weeks away? Months away? Years away? I see there's a 2.0.0 milestone, but it's 10% done, and I don't see any other plans anywhere.

The @import breaking change page which is linked from the deprecation warning says "Dart Sass 3.0.0 [...] will be released no sooner than two years after Dart Sass 1.80.0." That means October 2026.

@nex3 nex3 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2024
@garrett
Copy link
Author

garrett commented Oct 24, 2024

First of all: this report comes across as quite rude in how it just states that things "don't work" without providing any details or filing specific issues. I understand that you're frustrated, but that doesn't give you the right to take it out on me. Please reconsider how you interact with people online, especially people you're asking for free support on their product that you're also using for free.

Apologies, that was not the intent at all. I'm sorry I wrote it in such a way that it came across like that to you. Sincere apologies.

Thanks for your reply, and thanks for developing SASS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants