sasso 0.14.0-x86_64-linux → 0.21.0-x86_64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ba6180eeb0f5ef43f24cb0c5e8427d5bd2a59e0b7ec04083a83ee94a0c3591c
4
- data.tar.gz: 7b45deeed303e21be6a1880ac89f8481a067dedfc5713b886f251758eb509fd8
3
+ metadata.gz: 960431c8d8f501e3f6602e2e6e6d8ff9c1095cab0692ad5a9f7c6f69064efd93
4
+ data.tar.gz: 9d3fda59284fae18e200f54894820558648bb08135613d1fef1f51c16e6d18ed
5
5
  SHA512:
6
- metadata.gz: f1164925ed900845d4866ef5f89d2e77e9ce81407940476c48f3ad4686e7436928638a74ed7c453d63bbd91b74627c8395d324174cd679b6b513a8e332216bbb
7
- data.tar.gz: dd0936aff5384157373441ebabfef00ee6f2de04eb84a4ad7b16fd723e42f395eea5410c799a5e56931867f6e7a54a2a31e6af00bb3291f923474ea2ff2e3d1c
6
+ metadata.gz: 4c73c29afad7e29858893831019c71d5c0896438359e0a118fc2c72524eeb17a8714fd82438fcf8c6e0cd923812ca74b4c700e1768a3af05666f300fa5fa76eb
7
+ data.tar.gz: d97b04cdc301347e1016131c70e4df16e9e592df654fcc10b7775361b4a6f2c32445b7782badb26143caa194abd22312b5b4307897cc0ad4e291080bdd03b20e
data/CHANGELOG.md CHANGED
@@ -9,6 +9,126 @@ the gem independently of the crate.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.21.0] - 2026-10-30
13
+
14
+ _Adopts core `sasso` 0.21.0, nine core releases at once (0.15.0 through 0.21.0)._
15
+
16
+ _The Ruby API is backward compatible and gains one option. The compiler is not:
17
+ some stylesheets that compiled before now fail, and some CSS changes meaning,
18
+ not only bytes. Read **New errors** first, then the output changes marked
19
+ **meaning**._
20
+
21
+ ### Added
22
+
23
+ - **`silence_deprecations:`** (dart-sass `silenceDeprecations`): deprecation ids,
24
+ as Strings or Symbols, whose warnings are dropped wherever they are raised.
25
+ Every other diagnostic still comes through. The core drops a silenced id before
26
+ its repetition cap, so unlike filtering inside `on_warn:` it leaves no
27
+ "N repetitive deprecation warnings omitted" footer. Ids the compiler never
28
+ emits are accepted, as dart accepts them (core 0.17.0).
29
+
30
+ ### Changed (new errors — stylesheets that compiled before)
31
+
32
+ - **A built-in rejects an argument name it does not declare** (core 0.19.1).
33
+ `math.max(1, 2, $x: 999)` was `999`; it is now `Error: No parameter named $x.`
34
+ The color constructors are not checked yet.
35
+ - **An argument given both by position and by name is an error** (0.19.2).
36
+ `color.mix(red, blue, 10%, $color1: green)` was `rgb(10%, 0%, 90%)`; it is now
37
+ `Argument $color1 was passed both by position and by name.`
38
+ - **`@use "sass:color" as *` no longer exposes the members dart removed from
39
+ `sass:color`**, so `saturate(#abcdef, 10%)` reached that way fails (0.19.0).
40
+ - **The color functions reject `var()`, `env()` and a calc that cannot fold**,
41
+ for example `color.invert(var(--c))` (0.19.0).
42
+ - **Plain CSS rejects every `#{…}`**, where some positions used to drop it
43
+ silently, and a style rule inside a keyframe frame of a `.css` file is an
44
+ error (0.19.0).
45
+ - **Selectors follow dart's grammar** (0.19.3). Malformed attributes (`[a=1]`,
46
+ `[a==b]`, `[]`), characters that start no selector (`a^b`), invalid keyframe
47
+ stops (`10px`) and a raw line break inside a quoted string now fail.
48
+
49
+ ### Changed (output)
50
+
51
+ As with 0.14.0, byte-compared output (snapshot tests, asset digests, build
52
+ caches) will differ. Entries marked **meaning** change what a browser does.
53
+
54
+ - **meaning:** **compressed `color()` is valid CSS again** (0.17.0).
55
+ `color(display-p3 0.5 0.2 0.9)` compressed to `color(display-p3.5.2.9)`,
56
+ which browsers drop; it is now `color(display-p3 .5 .2 .9)`.
57
+ - **meaning:** **a non-ASCII space is no longer whitespace** (0.19.3). An NBSP
58
+ inside a selector stays part of it: `[a="x<NBSP>y"]` was rewritten to
59
+ `[a="x y"]`, and `a<NBSP>b` became a descendant selector. Output containing one
60
+ now carries `@charset "UTF-8";`.
61
+ - **meaning:** **whitespace inside a quoted attribute value is kept**:
62
+ `[a="x y"]` used to collapse to `[a="x y"]` (0.19.3). A quoted `(` or `[`
63
+ no longer swallows the rest of the selector list.
64
+ - **meaning:** **an empty at-rule survives compression**: `@font-face {}`
65
+ compressed to nothing and is now `@font-face{}` (0.19.0).
66
+ - **meaning:** **plain `.css` loaded through `@use`/`@import` keeps rules it used
67
+ to drop** (`@keyframes`, a custom `@function`, an at-rule nested in a style
68
+ rule), and stops hoisting at-rules out of a keyframe frame (0.19.0).
69
+ - **meaning:** **legacy color edge cases follow dart**. A degenerate color such
70
+ as `hsl(0, 100%, calc(-infinity * 1%))` is a color rather than a string, so
71
+ `color.mix()` on it gives `hsl(0, 0%, 0%)` instead of `rgb(NaN%, NaN%, NaN%)`.
72
+ `color.change()` on an hsl color no longer flips its hue (0.19.0).
73
+ - **Compressed colors and numbers serialize the way dart's do**, about 1,400
74
+ cases (0.19.0). For example, `oklab(1% 0 0)` compresses to `oklab(.01 0 0)`.
75
+ - **The `rgb()`/`hsl()` form choice follows dart's rules** in both styles
76
+ (0.19.0).
77
+ - **A calc writes `+ -n` as `- n` in compressed output too** (0.17.0).
78
+ - **A `round()` that cannot be folded is a calculation**, so compressed output
79
+ drops the space after its commas (0.19.0).
80
+ - `@import` modifiers are written verbatim, a newline in a complex selector puts
81
+ the next one on its own line, and compressed `[a="x y" i]` drops the space
82
+ before `i` (0.19.0, 0.19.3).
83
+
84
+ ### Changed (diagnostics)
85
+
86
+ - **New warning: `bogus-combinators`** (0.17.0), when a rule whose selector has
87
+ a repeated or leading combinator (`a > + b`) is dropped. sasso already dropped
88
+ those rules, as dart does, but said nothing; the warning is the only sign that
89
+ the CSS lost them. Use `silence_deprecations: [:"bogus-combinators"]` to
90
+ silence it.
91
+ - **New deprecation: `color-module-compat`** (0.19.0), e.g. for
92
+ `color.grayscale(1)`.
93
+ - **CSS filter functions no longer raise `global-builtin`**: for example,
94
+ `filter: grayscale(1)` (0.18.0).
95
+ - **Messages follow dart's wording** for a removed `sass:color` member, a type
96
+ error, which now names the parameter (`$number: (1 2) is not a number.`), and
97
+ a missing attribute operator (0.19.0, 0.19.3).
98
+ - **A stack frame names a path relative to the working directory**, not a
99
+ `file://` URL (0.19.0).
100
+
101
+ ### Changed (build)
102
+
103
+ - **The extension depends on the core with `default-features = false`.** Core
104
+ 0.19.0 added a default-on `cli-clock` feature that pulls `chrono` into Windows
105
+ builds for the CLI's `--watch` timestamp. The library never uses it, so the
106
+ native extension keeps its zero-dependency build.
107
+
108
+ ### Performance
109
+
110
+ The library compile path is faster in every core release in this range, with
111
+ byte-identical output in the releases that only make it faster (0.20.0, 0.21.0).
112
+ Measured as instruction counts on the core's real-world corpus, 0.20.0 alone cut
113
+ vuetify by 24%, bulma by 21% and bootstrap by 8%. 0.21.0 cut uswds by 41%, by
114
+ speeding up variables reached through `@use … as *`.
115
+
116
+ ## [0.14.1] - 2026-10-30
117
+
118
+ _A gem-only patch. The bundled core compiler is still `sasso` 0.14.0, so
119
+ `Sasso::CORE_VERSION` reports 0.14.0 and the CSS output is unchanged._
120
+
121
+ ### Added
122
+
123
+ - **Ruby 4.0 support.** The precompiled platform gems now carry a Ruby 4.0
124
+ binary, and CI tests against 4.0. Previously 4.0 fell back to the source gem,
125
+ which did not compile.
126
+
127
+ ### Fixed
128
+
129
+ - **The source gem compiles on Ruby 4.0.** The extension now builds against
130
+ magnus 0.8 instead of 0.7, whose bindings do not match the Ruby 4.0 headers.
131
+
12
132
  ## [0.14.0] - 2026-09-17
13
133
 
14
134
  _The gem version now tracks the core compiler's. It jumps 0.2.7 → 0.14.0 to meet
@@ -33,7 +153,10 @@ ways listed below._
33
153
 
34
154
  The gem's Ruby API is unchanged, but the CSS it emits moved with the core. If
35
155
  you byte-compare output — snapshot tests, asset digests, build caches — expect
36
- diffs. The CSS is equivalent; only its spelling changed.
156
+ diffs. Every change below is **serialization only** — the CSS still means what
157
+ it meant — with **one exception, the first**: `whiteness()` / `blackness()` stop
158
+ being evaluated, which makes the declaration around them invalid, so a browser
159
+ drops it. That one is worth grepping for; the rest are safe to re-baseline.
37
160
 
38
161
  - **Global `whiteness()` / `blackness()` are no longer built-ins** (core 0.9.0):
39
162
  they are `sass:color`-only, so the bare call is now an unknown function and
data/README.md CHANGED
@@ -19,9 +19,21 @@ gem "sasso"
19
19
  $ bundle install
20
20
  ```
21
21
 
22
- Precompiled native gems ship for common platforms (Linux gnu/musl, macOS, and
23
- Windows on x86_64/arm64), so no Rust toolchain is needed. On other platforms the
24
- gem compiles from source via `cargo` (needs a Rust toolchain).
22
+ **Ruby 3.2, 3.3, 3.4 and 4.0** are supported, and CI tests each of them on
23
+ Linux and macOS. Ruby 4.0 needs sasso 0.14.1 or later.
24
+
25
+ Precompiled native gems for all four Ruby versions ship for these platforms, so
26
+ they need no Rust toolchain:
27
+
28
+ | OS | platforms |
29
+ |---|---|
30
+ | Linux (glibc) | `x86_64-linux`, `aarch64-linux` |
31
+ | Linux (musl) | `x86_64-linux-musl`, `aarch64-linux-musl` |
32
+ | macOS | `x86_64-darwin`, `arm64-darwin` |
33
+ | Windows | `x64-mingw-ucrt` |
34
+
35
+ On any other platform the gem compiles from source with `cargo`, which needs a
36
+ Rust toolchain.
25
37
 
26
38
  ## Usage
27
39
 
@@ -57,6 +69,7 @@ Sasso.compile("app/assets/stylesheets/application.scss",
57
69
  | `source_map_include_sources:` | `false` | embed each source's text in the map's `sourcesContent` |
58
70
  | `quiet:` | `false` | print no `@warn`/`@debug`/deprecation diagnostics |
59
71
  | `quiet_deps:` | `false` | drop deprecation warnings raised inside dependencies |
72
+ | `silence_deprecations:` | `[]` | deprecation ids (Strings or Symbols) whose warnings are dropped |
60
73
  | `on_warn:` | `nil` | a callable receiving each diagnostic; replaces the stderr printing |
61
74
 
62
75
  ### Source maps
@@ -75,8 +88,7 @@ r.source_map["sources"] # => ["application.scss"]
75
88
  ### Diagnostics
76
89
 
77
90
  `@warn`, `@debug` and deprecation warnings print to `$stderr` by default, the
78
- same dart-style block the `sasso` CLI and dart-sass print. Two ways to change
79
- that:
91
+ same dart-style block the `sasso` CLI and dart-sass print. To change that:
80
92
 
81
93
  ```ruby
82
94
  # Silence them entirely:
@@ -86,10 +98,12 @@ Sasso.compile_string(scss, quiet: true)
86
98
  # resolved through a load path. The entry stylesheet's own still print.
87
99
  Sasso.compile_string(scss, load_paths: ["vendor/stylesheets"], quiet_deps: true)
88
100
 
101
+ # Silence particular deprecations by id (dart-sass `silenceDeprecations`),
102
+ # wherever they are raised. Every other diagnostic still prints.
103
+ Sasso.compile_string(scss, silence_deprecations: [:import, "color-functions"])
104
+
89
105
  # Or take delivery yourself, which suppresses the printing:
90
106
  Sasso.compile_string(scss, url: "in.scss", on_warn: ->(d) {
91
- next if d[:deprecation_id] == "color-functions"
92
-
93
107
  Rails.logger.warn(d[:formatted]) # the block the compiler would have printed
94
108
  })
95
109
  ```
Binary file
Binary file
Binary file
Binary file
data/lib/sasso/version.rb CHANGED
@@ -6,5 +6,5 @@ module Sasso
6
6
  # (ext/sasso/Cargo.toml). A gem-only fix takes the next patch, so the gem may
7
7
  # sit ahead of the crate within a minor — `Sasso::CORE_VERSION` reads the
8
8
  # version out of the linked binary and is the authority on what is loaded.
9
- VERSION = "0.14.0"
9
+ VERSION = "0.21.0"
10
10
  end
data/lib/sasso.rb CHANGED
@@ -59,6 +59,8 @@ module Sasso
59
59
  # charset: false => omit the @charset/BOM prefix on non-ASCII output
60
60
  # quiet: true => print no @warn/@debug/deprecation diagnostics at all
61
61
  # quiet_deps: true => drop deprecation warnings raised inside dependencies
62
+ # silence_deprecations: deprecation ids (Strings or Symbols) whose warnings
63
+ # are dropped, e.g. [:import, "global-builtin"]
62
64
  # on_warn: a callable receiving each diagnostic as a Hash (see WARNING_KEYS);
63
65
  # taking delivery this way replaces the default stderr printing
64
66
  #
@@ -67,7 +69,8 @@ module Sasso
67
69
  def compile_string(source, style: :expanded, syntax: :scss, indented: false,
68
70
  load_paths: [], url: nil, alert_ascii: false,
69
71
  source_map: false, source_map_include_sources: false,
70
- charset: true, quiet: false, quiet_deps: false, on_warn: nil)
72
+ charset: true, quiet: false, quiet_deps: false,
73
+ silence_deprecations: [], on_warn: nil)
71
74
  syntax = :sass if indented
72
75
  validate!(style, STYLES, :style)
73
76
  validate!(syntax, SYNTAXES, :syntax)
@@ -83,6 +86,7 @@ module Sasso
83
86
  source_map_include_sources: source_map_include_sources,
84
87
  charset: charset,
85
88
  quiet_deps: quiet_deps,
89
+ silence_deprecations: Array(silence_deprecations).map(&:to_s),
86
90
  warnings: warnings_mode(quiet, on_warn),
87
91
  })
88
92
  # Deliver first, raise second: a compile can warn and then fail, and those
data/sig/sasso.rbs CHANGED
@@ -37,6 +37,7 @@ module Sasso
37
37
  ?url: String?, ?alert_ascii: bool,
38
38
  ?source_map: bool, ?source_map_include_sources: bool,
39
39
  ?charset: bool, ?quiet: bool, ?quiet_deps: bool,
40
+ ?silence_deprecations: Array[String | Symbol],
40
41
  ?on_warn: (^(warning) -> void)?) -> (String | CompileResult)
41
42
  def self.compile: (untyped path, **untyped opts) -> (String | CompileResult)
42
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sasso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.21.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - momiji-rs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-17 00:00:00.000000000 Z
11
+ date: 2026-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,7 @@ files:
66
66
  - lib/sasso/3.2/sasso.so
67
67
  - lib/sasso/3.3/sasso.so
68
68
  - lib/sasso/3.4/sasso.so
69
+ - lib/sasso/4.0/sasso.so
69
70
  - lib/sasso/version.rb
70
71
  - sig/sasso.rbs
71
72
  homepage: https://github.com/momiji-rs/sasso-ruby
@@ -87,7 +88,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
87
88
  version: '3.2'
88
89
  - - "<"
89
90
  - !ruby/object:Gem::Version
90
- version: 3.5.dev
91
+ version: 4.1.dev
91
92
  required_rubygems_version: !ruby/object:Gem::Requirement
92
93
  requirements:
93
94
  - - ">="