-
Notifications
You must be signed in to change notification settings - Fork 464
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
[DNM] LibSass 4.0 Alpha Big Bang #3135
Conversation
Since most of the code is changing, does it make sense to setup a formatter like in the (broken) #2324 |
@nschonni Still want to wait with that, I used default formatter of MSVC up to now. |
b90e911
to
71510ee
Compare
(not going to subscribe so if you need to reply, please @-mention me -- thanks!) I took a look at this on stream today and ran into a few things and I think I'm stuck (maybe an api is missing?). here's the notes I have for this:
I also created two PRs against your branch to fix a few small problems I ran into:
excited for the changes here! some of the map / list push / set stuff is really really nice! |
neat! I got a lot further today, here's my next round of feedback! I couldn't get sourcemaps working at all, I'm guessing they're not completed yet or I'm holding it wrong -- probably the latter let's be realistic 😄 I also couldn't get custom function working 🤔 I've got two new PRs for today: mgreter#8 mgreter#9 and I have a bunch of oddities I can't explain :S
compressed mode seems to be overly aggressive, breaking some selectors: $ pysassc testpkg/testpkg/static/scss/a.scss -t compressed
pa{color:red}pb{color:blue}
$ cat testpkg/testpkg/static/scss/a.scss
p {
a {
color: red;
}
b {
color: blue;
}
} the default output mode seems to have changed indentation slightly: $ pysassc test/a.scss # NEW
body {
background-color: green; }
body a {
color: blue; }
$ /tmp/venv/bin/pysassc test/a.scss # OLD
body {
background-color: green; }
body a {
color: blue; }
and lastly, it seems the quotes have changed from single to double: $ pysassc test/d.scss # NEW
@charset "UTF-8";
body {
background-color: green; }
body a {
font: "나눔고딕", sans-serif; }
$ /tmp/venv/bin/pysassc test/d.scss # OLD
@charset "UTF-8";
body {
background-color: green; }
body a {
font: '나눔고딕', sans-serif; } |
SourceMaps and custom functions/importers are indeed last on my list! Was busy the last two weeks implementing use and forward modules.
And yes, that's against the full sass-spec suite! Also some current benchmarks against bolt-bench (compiled via MSVC 2019).
With training we can get this even further down :)
I will now try to get back to the C-API. Not sure I will give it a try to (not) support I really hope I can wrap this all up for X-Mas. |
For the other points you mentioned:
Yep, unfortunately we don't test output modes in sass-spec anymore. For the indentation I try to match dart-sass, so need to check against that. |
50c6da2
to
173014e
Compare
I came from here sass/sass#2737 and saw the huge leaps in performance you've made! Really impressive stuff. My project has one entrypoint file for sass and uses the latest gulp-sass (dart-sass js) to build it. This takes about about 10s to build for every change which is about the same time as node-sass surprisingly (I would have thought node-sass using libsass would be much faster but I think the dart-sass team has made some great gains in performance in the last few years to make the JS version comparable to the libsass binary). Anyway, what surprised me was that dart-sass cli only took 1.734s to build my project. Dart-sass team are working on "Embedded Dart Sass" to leverage this efficiency because this level can't be reached by relying on the JS version. With all that said, if your version is out soon I may change back to node-sass just for the sake of these massive speed gains. Thanks for maintaining and backporting even though this project is listed as deprecated, I always like having options. I would take speed over feature-set until my needs for the project are no longer met, and having survived without most of the new features I think that can last a few more years or until Embedded Dart Sass happens. |
7618bb2
to
c998001
Compare
Sorry for the long silence, but as you know, life and stuff 😃 The C-API part of the todo list is closely to be finished, one of the biggest open points for a LibSass 4.0 alpha release. I guess most other points can be prolonged into the alpha phase, as they are often optional and highly OS dependent (e.g. terminal Color or Unicode recognition). Implementers can often simply disable a feature via options if it turns out to be unreliable or bugged. On the other hand there are so many changes that I would like to get it right in the first place as much as possible. |
64b1fc3
to
af3f362
Compare
Great to see all the progress on this. I've been playing at wrapping a Swift API around this branch; the core of the thing seems really good, here are a few minor problems I found:
Happy to PR at least the easy ones... Some less specific things:
Again I'm really glad to see your efforts here. |
Thx @johnfairh for the feedback, very useful and encouraging as it seems you already got quite far with the current state.
Thanks again and please feel free to poke around more in the code ;) |
Hopefully fixed |
Thanks; fixes look good. Your general approach of prioritising releasing something sounds right to me! I understand your point about CWD as global shared state. Think I agree current behaviour is fine with docs. This is the signal code I meant to link: I don't generally expect a library to grab all these and decide what the right behaviour is for the host program. Output path inference. Old LibSass infers the output path if the user supplies an input file; as you hint the only usage is to fill in the optional 'file' SourceMap field -- so really maybe any behaviour here (1 - infer a path; 2 - assume stdout; 3 - don't fill in the field) is acceptable as long as it's documented; the SourceMap can always be fixed up by the client later. Marginal preference for keeping the old behaviour I suppose. |
a653f76
to
2f499e2
Compare
5bf2b49
to
38f3fd9
Compare
df2d85a
to
d7b2e47
Compare
Minor update as I'm currently trying to rebase sass-spec to latest master. There have been some major additions in dart-sass in regard to "slash" lists and "math.div" which are a bit more complicated to support, mainly because of the deprecation warnings, as LibSass doesn't have a way (yet) to convert Expressions to strings. So this might add another month or two of development to support correctly. So far around +500 new tests and ~30 are not exactly reporting as expected (mostly warning that mismatch). |
751cce1
to
ee8ea51
Compare
Apparently libsass has never actually supported compound selectors (or at least never the way people interpreted it should work). Therefore since libsass 3.5 (July 2017) that is deprecated and emits a warning. Which is problematic because libsass is also hard-coded to emit its deprecation warning to stderr[^1], resulting in a few issues: * because it's not decorated (let alone as a warning) it's not really noticeable on the runbot or in most dev logs * but because it's not associated with a logger it's basically the only thing which shows up when running in `--log-level=warn` (as it's printed at least once per tour) * and it's pretty gnarly to get the information back in Python as, again, hard-coded to stdout odoo#70927 explored messing around with fds to intercept the writes and re-emit them to the proper location, but that was considered a bit too iffy. And of course the intent was always to eventually fix the warning itself, which qsm provided for in [a comment][fix-extend], the important bit was the extension of `:disabled` so that's what's left here to fix the warning. The logic of the fix is that the loader is always used with the `form-control` class (internally) and the `:disabled` part of the `form-control` styling is what we really want to copy over. It's possible that third-party lose the styling if they use `o_wysiwyg_loader` alone (without an explicit `form-control` next to it) but that seems like an unlikely situation. [^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level, and removes the hardcoded / direct stream writing [fix-extend]: odoo#70927 (comment)
Apparently libsass has never actually supported compound selectors (or at least never the way people interpreted it should work). Therefore since libsass 3.5 (July 2017) that is deprecated and emits a warning. Which is problematic because libsass is also hard-coded to emit its deprecation warning to stderr[^1], resulting in a few issues: * because it's not decorated (let alone as a warning) it's not really noticeable on the runbot or in most dev logs * but because it's not associated with a logger it's basically the only thing which shows up when running in `--log-level=warn` (as it's printed at least once per tour) * and it's pretty gnarly to get the information back in Python as, again, hard-coded to stdout #70927 explored messing around with fds to intercept the writes and re-emit them to the proper location, but that was considered a bit too iffy. And of course the intent was always to eventually fix the warning itself, which qsm provided for in [a comment][fix-extend], the important bit was the extension of `:disabled` so that's what's left here to fix the warning. The logic of the fix is that the loader is always used with the `form-control` class (internally) and the `:disabled` part of the `form-control` styling is what we really want to copy over. It's possible that third-party lose the styling if they use `o_wysiwyg_loader` alone (without an explicit `form-control` next to it) but that seems like an unlikely situation. [^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level, and removes the hardcoded / direct stream writing [fix-extend]: #70927 (comment) closes #71587 Signed-off-by: Xavier Morel (xmo) <[email protected]>
Apparently libsass has never actually supported compound selectors (or at least never the way people interpreted it should work). Therefore since libsass 3.5 (July 2017) that is deprecated and emits a warning. Which is problematic because libsass is also hard-coded to emit its deprecation warning to stderr[^1], resulting in a few issues: * because it's not decorated (let alone as a warning) it's not really noticeable on the runbot or in most dev logs * but because it's not associated with a logger it's basically the only thing which shows up when running in `--log-level=warn` (as it's printed at least once per tour) * and it's pretty gnarly to get the information back in Python as, again, hard-coded to stdout odoo#70927 explored messing around with fds to intercept the writes and re-emit them to the proper location, but that was considered a bit too iffy. And of course the intent was always to eventually fix the warning itself, which qsm provided for in [a comment][fix-extend], the important bit was the extension of `:disabled` so that's what's left here to fix the warning. The logic of the fix is that the loader is always used with the `form-control` class (internally) and the `:disabled` part of the `form-control` styling is what we really want to copy over. It's possible that third-party lose the styling if they use `o_wysiwyg_loader` alone (without an explicit `form-control` next to it) but that seems like an unlikely situation. [^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level, and removes the hardcoded / direct stream writing [fix-extend]: odoo#70927 (comment) X-original-commit: 5c2c6b8
Apparently libsass has never actually supported compound selectors (or at least never the way people interpreted it should work). Therefore since libsass 3.5 (July 2017) that is deprecated and emits a warning. Which is problematic because libsass is also hard-coded to emit its deprecation warning to stderr[^1], resulting in a few issues: * because it's not decorated (let alone as a warning) it's not really noticeable on the runbot or in most dev logs * but because it's not associated with a logger it's basically the only thing which shows up when running in `--log-level=warn` (as it's printed at least once per tour) * and it's pretty gnarly to get the information back in Python as, again, hard-coded to stdout odoo#70927 explored messing around with fds to intercept the writes and re-emit them to the proper location, but that was considered a bit too iffy. And of course the intent was always to eventually fix the warning itself, which qsm provided for in [a comment][fix-extend], the important bit was the extension of `:disabled` so that's what's left here to fix the warning. The logic of the fix is that the loader is always used with the `form-control` class (internally) and the `:disabled` part of the `form-control` styling is what we really want to copy over. It's possible that third-party lose the styling if they use `o_wysiwyg_loader` alone (without an explicit `form-control` next to it) but that seems like an unlikely situation. [^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level, and removes the hardcoded / direct stream writing [fix-extend]: odoo#70927 (comment) X-original-commit: 5c2c6b8
Apparently libsass has never actually supported compound selectors (or at least never the way people interpreted it should work). Therefore since libsass 3.5 (July 2017) that is deprecated and emits a warning. Which is problematic because libsass is also hard-coded to emit its deprecation warning to stderr[^1], resulting in a few issues: * because it's not decorated (let alone as a warning) it's not really noticeable on the runbot or in most dev logs * but because it's not associated with a logger it's basically the only thing which shows up when running in `--log-level=warn` (as it's printed at least once per tour) * and it's pretty gnarly to get the information back in Python as, again, hard-coded to stdout odoo#70927 explored messing around with fds to intercept the writes and re-emit them to the proper location, but that was considered a bit too iffy. And of course the intent was always to eventually fix the warning itself, which qsm provided for in [a comment][fix-extend], the important bit was the extension of `:disabled` so that's what's left here to fix the warning. The logic of the fix is that the loader is always used with the `form-control` class (internally) and the `:disabled` part of the `form-control` styling is what we really want to copy over. It's possible that third-party lose the styling if they use `o_wysiwyg_loader` alone (without an explicit `form-control` next to it) but that seems like an unlikely situation. [^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level, and removes the hardcoded / direct stream writing [fix-extend]: odoo#70927 (comment) X-original-commit: 5c2c6b8
Apparently libsass has never actually supported compound selectors (or at least never the way people interpreted it should work). Therefore since libsass 3.5 (July 2017) that is deprecated and emits a warning. Which is problematic because libsass is also hard-coded to emit its deprecation warning to stderr[^1], resulting in a few issues: * because it's not decorated (let alone as a warning) it's not really noticeable on the runbot or in most dev logs * but because it's not associated with a logger it's basically the only thing which shows up when running in `--log-level=warn` (as it's printed at least once per tour) * and it's pretty gnarly to get the information back in Python as, again, hard-coded to stdout odoo#70927 explored messing around with fds to intercept the writes and re-emit them to the proper location, but that was considered a bit too iffy. And of course the intent was always to eventually fix the warning itself, which qsm provided for in [a comment][fix-extend], the important bit was the extension of `:disabled` so that's what's left here to fix the warning. The logic of the fix is that the loader is always used with the `form-control` class (internally) and the `:disabled` part of the `form-control` styling is what we really want to copy over. It's possible that third-party lose the styling if they use `o_wysiwyg_loader` alone (without an explicit `form-control` next to it) but that seems like an unlikely situation. [^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level, and removes the hardcoded / direct stream writing [fix-extend]: odoo#70927 (comment) X-original-commit: 5c2c6b8
Apparently libsass has never actually supported compound selectors (or at least never the way people interpreted it should work). Therefore since libsass 3.5 (July 2017) that is deprecated and emits a warning. Which is problematic because libsass is also hard-coded to emit its deprecation warning to stderr[^1], resulting in a few issues: * because it's not decorated (let alone as a warning) it's not really noticeable on the runbot or in most dev logs * but because it's not associated with a logger it's basically the only thing which shows up when running in `--log-level=warn` (as it's printed at least once per tour) * and it's pretty gnarly to get the information back in Python as, again, hard-coded to stdout #70927 explored messing around with fds to intercept the writes and re-emit them to the proper location, but that was considered a bit too iffy. And of course the intent was always to eventually fix the warning itself, which qsm provided for in [a comment][fix-extend], the important bit was the extension of `:disabled` so that's what's left here to fix the warning. The logic of the fix is that the loader is always used with the `form-control` class (internally) and the `:disabled` part of the `form-control` styling is what we really want to copy over. It's possible that third-party lose the styling if they use `o_wysiwyg_loader` alone (without an explicit `form-control` next to it) but that seems like an unlikely situation. [^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level, and removes the hardcoded / direct stream writing [fix-extend]: #70927 (comment) closes #71657 X-original-commit: 5c2c6b8 Signed-off-by: Xavier Morel (xmo) <[email protected]>
Apparently libsass has never actually supported compound selectors (or at least never the way people interpreted it should work). Therefore since libsass 3.5 (July 2017) that is deprecated and emits a warning. Which is problematic because libsass is also hard-coded to emit its deprecation warning to stderr[^1], resulting in a few issues: * because it's not decorated (let alone as a warning) it's not really noticeable on the runbot or in most dev logs * but because it's not associated with a logger it's basically the only thing which shows up when running in `--log-level=warn` (as it's printed at least once per tour) * and it's pretty gnarly to get the information back in Python as, again, hard-coded to stdout #70927 explored messing around with fds to intercept the writes and re-emit them to the proper location, but that was considered a bit too iffy. And of course the intent was always to eventually fix the warning itself, which qsm provided for in [a comment][fix-extend], the important bit was the extension of `:disabled` so that's what's left here to fix the warning. The logic of the fix is that the loader is always used with the `form-control` class (internally) and the `:disabled` part of the `form-control` styling is what we really want to copy over. It's possible that third-party lose the styling if they use `o_wysiwyg_loader` alone (without an explicit `form-control` next to it) but that seems like an unlikely situation. [^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level, and removes the hardcoded / direct stream writing [fix-extend]: #70927 (comment) closes #71661 X-original-commit: 5c2c6b8 Signed-off-by: Xavier Morel (xmo) <[email protected]>
Apparently libsass has never actually supported compound selectors (or at least never the way people interpreted it should work). Therefore since libsass 3.5 (July 2017) that is deprecated and emits a warning. Which is problematic because libsass is also hard-coded to emit its deprecation warning to stderr[^1], resulting in a few issues: * because it's not decorated (let alone as a warning) it's not really noticeable on the runbot or in most dev logs * but because it's not associated with a logger it's basically the only thing which shows up when running in `--log-level=warn` (as it's printed at least once per tour) * and it's pretty gnarly to get the information back in Python as, again, hard-coded to stdout #70927 explored messing around with fds to intercept the writes and re-emit them to the proper location, but that was considered a bit too iffy. And of course the intent was always to eventually fix the warning itself, which qsm provided for in [a comment][fix-extend], the important bit was the extension of `:disabled` so that's what's left here to fix the warning. The logic of the fix is that the loader is always used with the `form-control` class (internally) and the `:disabled` part of the `form-control` styling is what we really want to copy over. It's possible that third-party lose the styling if they use `o_wysiwyg_loader` alone (without an explicit `form-control` next to it) but that seems like an unlikely situation. [^1] libsass 4 (sass/libsass#3135) surfaces warnings at the API level, and removes the hardcoded / direct stream writing [fix-extend]: #70927 (comment) closes #71667 X-original-commit: 5c2c6b8 Signed-off-by: Xavier Morel (xmo) <[email protected]>
8ef17eb
to
d9e1375
Compare
Continues in https://github.com/mgreter/libsass-ng/tree/develop As a little teaser, here some current benchmarks: bolt-bench-dart: 5.2958406s https://github.com/sass/dart-sass/blob/main/perf.md preceding-sparse-dart: 2.0365426s |
Continued from #2918
Please note that this PR is a little bit bigger than your regular PR :)
During the last year development of LibSass seems to have stagnated, which is certainly partially true!
Although corona has hit us all, I still did enjoy the beautiful summer here in my hometown and took
some time off from GitHub and opensource. None the less I already had invested quite some time into
a dart-sass parser back-port, after the back-port for the extend code already landed in master (not without
any headaches). During the year I've back-ported, refactored or rewritten nearly 90% of the code-base.
I always had a version that was working, but the code behind it was never 100% clean. It still isn't in a lot
of parts, but in many others the code is now reviewed and properly done. The new version will also require
at least a very decent C++11 compiler, as I took great care to use move semantics wherever possible!
Don't bother to try to review this PR, you can just review the whole code base instead ;)
There are still edges not fully reworked or that still have some debugging traits attached!
Corresponding sass-spec branch at https://github.com/mgreter/sass-spec/tree/refactor/libsass-4-alpha
Open points for LibSass 4.0 ALPHA release:
Additional points to be done:
Optional stuff:
@use
etc.I will update those list if I find any other points.
For the release notes I might also want to mention the main improvements:
whiteness
/blackness
are only exposed via module systemBTW I will keep squashing and force pushing this branch!