Comments (2)
I don't know that we can realistically ship this until April 2026 when Node.js 20 leaves LTS, since we're required by our compatibility policy to continue supporting LTS Node.js releases and npm isn't smart enough to install different packages for different SDK versions.
It's also currently an open question whether WASM actually provides any performance benefits, or how feasible it would be to wrap it with a JS API. One possibility is that we replace the embedded host with WASM as a way of reducing cross-process overhead, but that's also contingent on the runtime performance being comparable with a native executable. Another is that we use the embedded host infrastructure for the main Sass release as a way of exposing the JS API with minimal additional wrapping.
from dart-sass.
I spent some time today doing a bit of preliminary investigation of this. Here are some issues I've identified, in no particular order:
-
There's not a good way to load libraries into a WASM context (dart-lang/sdk#55806). The workarounds for this are no worse than we're already doing for JS interop, though.
-
We'd have to update essentially all our JS interop to use Dart's new
dart:js_interop
library. This isn't a bad idea anyway, but it would probably require us to lead an update of thenode_interop
package which is fairly large. -
Related to the above, we'd need to find new ways of doing any JS sorcery that currently relies on
dart:js_util
or thejs
package, even outside a WASM context, at least until dart-lang/sdk#55801 is fixed and it's possible to use different conditional loads for JS and WASM environments. -
We can't even really start to measure the performance implications until most or all of the above issues are handled. At the bare minimum, we need to be able to build Dart Sass as WASM and run it with at least basic filesystem I/O working.
-
Dart's WASM support is (at present) tightly coupled to JavaScript as a runtime environment. This means a WASM target would not represent a new way for Sass's compilation logic to be re-used across other runtimes, at least in the short term.
-
Dart expects its WASM code to be loaded asynchronously, which could pose a problem given that we're likely to continue to want to expose a CommonJS Sass library for the foreseeable future. This could potentially be worked around by editing the JS wrapper generated by Dart.
If anyone is interested in helping with this effort, the best place to put your energy in the short term would be migrating node_interop
to use dart:js_interop
.
from dart-sass.
Related Issues (20)
- SCSS silently fails to compile lines beginning with `--` HOT 1
- Miscompilation when Using Sass and CSS Variables HOT 1
- Drop support for plain-CSS-like functions and mixins
- update flag doesn't work with absolute source paths HOT 2
- change in distribution format HOT 4
- Does sass encourage terrorism, kidnapping, murder and rape?
- ImportCache of CanonicalizeResult is broken for relative imports handled by any importer that is not a baseImporter HOT 13
- {DELETE ME] HOT 1
- Running Dart Sass in QuickJS? HOT 4
- Unused code elimination and deduplication is not applied when using api: 'legacy' HOT 5
- font-awesome integration HOT 8
- I would like to know which version of dart-sass supports node v10.18.0? HOT 1
- At-rules may not be used within keyframe blocks HOT 1
- Null check operator used on a null value error since 1.76.0 HOT 7
- "braces" dependency vulnerable to "Uncontrolled resource consumption" CVE HOT 2
- --silence-deprecation doesn't work on the CLI HOT 1
- CLI Many-to-Many Mode process .css files HOT 2
- Converting .sass to .scss? HOT 1
- @use file cannot use variables starting with $-- HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-sass.