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

Add breaking change page for legacy-js-api #1193

Merged
merged 4 commits into from
Sep 19, 2024
Merged

Conversation

jathak
Copy link
Member

@jathak jathak commented Sep 19, 2024

No description provided.

Copy link

netlify bot commented Sep 19, 2024

Deploy Preview for sass-lang ready!

Name Link
🔨 Latest commit b00c178
🔍 Latest deploy log https://app.netlify.com/sites/sass-lang/deploys/66eca270461c7100081c452d
😎 Deploy Preview https://deploy-preview-1193--sass-lang.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Modern API [`Importer`]s instead contain two methods: `canonicalize`, which takes
in a rule URL and returns the canonical form of that URL; and `load`, which
takes in a canonical URL and returns an object with the contents
of the loaded stylesheet. Asynchronous importers have both of these methods
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add a sentence here explaining that this split ensures that the same module is only loaded once and that relative URLs work consistently.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

returning a promise.

The modern API also uses a much more robust [`Value`] class that supports
type assertions and easy map and list lookups.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add "all Sass value types" to the list of things the new function API supports

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Vite still defaults to the legacy API, but you can similarly switch it by
setting `api` to `"modern"` or `"modern-compiler"`. See [Vite's documentation]
for more details.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe also add a note that for other bundlers or frameworks, check the documentation or issue tracker for information about supporting the modern Sass API?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@jathak jathak requested a review from nex3 September 19, 2024 22:15
@jathak jathak merged commit a9b0cd1 into main Sep 19, 2024
9 checks passed
@jathak jathak deleted the legacy-js-api-deprecation branch September 19, 2024 22:21
jgerigmeyer added a commit to oddbird/sass-site that referenced this pull request Sep 20, 2024
* main: (23 commits)
  [Playground] Click to Copy (sass#1177)
  Cut a release for a new Dart Sass version
  [Playground] Debug links (sass#1179)
  Add breaking change page for legacy-js-api (sass#1193)
  [Playground] Autocomplete (sass#1166)
  Add a breaking change page for color functions (sass#1192)
  Remove nonexisting `color.saturate()` function (sass#1190)
  Fix unprefixed `color.adjust()` name (sass#1188)
  Sort color functions alphabetically (sass#1187)
  Document color migrator (sass#1186)
  Cut a release for a new Dart Sass version
  Document new color spaces (sass#1055) (sass#1115)
  Cut a release for a new Dart Sass version
  Bump date-fns from 3.6.0 to 4.0.0 (sass#1181)
  Bump rollup from 4.21.2 to 4.21.3 (sass#1182)
  Bump @codemirror/autocomplete from 6.18.0 to 6.18.1 (sass#1183)
  Bump @typescript-eslint/eslint-plugin from 8.5.0 to 8.6.0 (sass#1185)
  Bump markdown-it-anchor from 9.1.0 to 9.2.0 (sass#1184)
  Fix footer not showing the latest versions. (sass#1178)
  [Playground] Code links (sass#1167)
  ...
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

Successfully merging this pull request may close these issues.

2 participants