Skip to content

Releases: kaj/rsass

Release 0.28.0

22 Jul 13:02
@kaj kaj
Compare
Choose a tag to compare

Released 2023-07-09.
See also https://rasmus.krats.se/2023/rsass028.en
Progress: 4697 of 7032 tests passed.

  • @media rules are now handled specifically as @media rules, rather than as unknown @-rules (PR #172).
  • @extend is now explicitly unsupported (gives an error message, rather than behaving as an unknown @ rule) (PR #173).
  • Improved handling of @keyframes and @font-face.
  • Changed output format of non-finite numbers to match sass spec. They are now wrapped in calc, like calc(infinite) or calc(NaN * 1deg).
  • Fixed some difference between module and builtin color functions grayscale and invert.
  • The deg unit is no longer spelled out in hsl / hsla colors.
  • Improved handling of custom properties in raw css input.
  • MSRV of rsass (the lib crate) is now 1.60.0 (required by trancient dev dependency log).
  • Improved parsing of quoted strings (some syntax errors was accepted).
  • Removed the Error::error(_) shortcut for creating text-only errors (some text only errors remains, created directly as the Error::S(String) variant, that should probably be removed too in the future).
  • Fixed a typo in help text, thanks @greyhillman (PR #170).
  • Added an input check in selectors.append function.
  • Changed Number internals to make values smaller in memory.
  • Minor internal cleanup.
  • Updated syn in rsass-macros to 2.0.2.
  • Updated sass-spec test suite to 2023-06-30.

Release 0.27.0

17 Jan 21:18
@kaj kaj
Compare
Choose a tag to compare

Released 2023-01-17.
See also https://rasmus.krats.se/2023/rsass027.en
Progress: 4604 of 6925 tests passed.

  • Changed repo structure to a monorepo (PR #164).
    • The commandline interface now lives in the separate crate rsass-cli.
    • The test updater also have a separate crate, but not intended for
      publication.
    • Tests are restructured to fail faster for simple things, while
      macos and windows testing is added to the github action (appveyor
      is removed).
  • Added macros (PR #163, #165).
    • The workspace now includes a rsass-macros crate that can be used to
      compile sass to css strings at compile time in rust crates.
  • Changed numeric handing (mainly conversions to/from f64) to match
    improvements in how dart-sass handles numerics. This is mainly done by
    removing some special cases as dart-sass and rust now agrees on more of
    those.
  • Added new variables $epsilon, $max-safe-integer, $min-safe-integer,
    $max-number, and $min-number in sass:math, matching recent dart-sass
    additions.
  • Added new split() function in sass:string module.
  • Changed the span type used in parsing to a local type that borrows a
    SourceFile instead of nom_locate dependency (PR #158).
  • Changed the type SourceFile to be reference counted, so cloned
    SourceFile objects share the same actual data (PR #158).
  • Moved the SourcePos type into the input module and converted it from
    keeping a copy of the relevant line to keeping a range with a (reference
    counted) SourceFile (PR #158).
  • Changed css creation from just writing to a text buffer to building
    a tree representation of the css (and serialize it to text as a
    final step) (PR #159).
  • Changed BinOp value in both sass and css from a tuple variant with
    boxed values to a single boxed struct variant.
  • Improved value checking; Report an error if trying to output invalid
    css values in some cases. Also, arithmetic involving colors that
    used to be calculated is now correctly invalid (PR #161).
  • Changed css::Item::AtRule to wrap the new type css::AtRule.
  • More varaints of Invalid, slightly fewer stringy errors.
  • Changed handling of hue arguments to color functions, to allow
    different angle units, matching updates in sass-spec.
  • Minor correctness improvent in the calc function handling.
  • Clippy now takes MSRV from Cargo.toml. Slightly more recent lints allowed.
  • Updated clap to 4.0 for the command-line interface.
  • Updated sass-spec test suite to 2023-01-06.

Thanks to @Wicpar for the initial macros implementation.

Release 0.26.0

18 Sep 19:44
@kaj kaj
Compare
Choose a tag to compare

Released 2022-09-18.
Progress: 4500 of 6843 tests passed (or 4673 if ignoring some deprecation messages).

Breaking changes

  • A BuiltinFn now takes a &ResolvedArgs rather than a &ScopeRef as argument (PR #157).
  • @extend is still unsupported, but now some uses of it (e.g. in control structures) will result in an error instead of wrong output.
  • Some sass::Item alternatives now contain a Callable, combining FormalArgs with a body (a Vec<Item>). And sass::Item::Content now has a CallArgs. Also, MixinDeclImpl is replaced with sass::Closure. (PR #146).
  • sass::CallArgs::new() has an additional trailing_comma boolean argument (PR #147).
  • Remove deprecated methods css::Value::integer_value() and Number::is_integer().
  • Changed the error type of Scope::get_function().
  • Setting a variable, Scope::define now takes the Value by value rather than by reference. Also, Scope::define_multi is no longer exposed in the api.
  • Renamed one variant of ScopeError and added two others.
  • The sass Value::Variable and Item::VariableDeclaration variants now holds a Name rather than just a String for the variable name. Also, both now holds a SourcePos.
  • Changes in Error representation. Many errors are now constructed like Invalid::SomeVariant.at(pos) (PR #145).
  • Error::error now takes an Into<String> argument (PR #151).
  • The module input contains types types with Context<L>, Loader, FsLoader, and FsContext, replacing the old FileContext and FsFileContext. Also, the types SourceKind, SourceName and Parsed are moved from top-level into the input module (PR #150).
  • The parse_scss_data function is removed. Please create a SourceFile and use the parse method on that instead (PR #150).
  • The Format::write_root method are removed, Context::transform should be used instad (PR #152).

Improvements

  • input::Context is the new main interface to rsass. Create a context suitable for how files should be loaded, configure it with an output format and optionally extend the global scope before calling Context::transform with an input file (PR #151, PR #152).
  • Also provide CargoContext / CargoLoader for convenient use in build scripts (PR #154).
  • The way to get argument values from the implementation of a builtin function is refactored to handle both any type that implements TryFrom<Value> and explicit validation/conversion methods nicer, and is now availiable for implementing builtin functions (extensions) outside of rsass itself (PR #157).
  • The @content can have arguments when declaring and calling a mixin (PR #146).
  • Variable declartions can be scoped (like module.$var: value). Some
    error reporting improvements (PR #148).
  • Allow interpolation in css min and max function arguments.
  • The url for @use and @forward must be quoted.
  • Improve detection of import loops (PR #150).
  • When loading files, Don't apply suffix / index-adding rules if the file name already has a suffix (PR #150).
  • Some @ rules are now forbidden in some places as they should (PR #145).
  • The css var(...) function is now parsed as a proper function, and not as a special string (PR #147).
  • The null value can be quoted as an empty string (PR #147).
  • Make Debug formatting of rsass::Error look like the Display output, but without the "Error: " prefix. This makes the error display correctly if returned from a main function. This also removed the "Error: " prefix from a lot of message strings (PR #151).
  • In error message, don't show ellipses for consecutive lines (PR #147).
  • Somtimes a trailing comma in argument lists is preserved (PR #147).
  • Simplified main of the command-line by returning a Result (PR #151).
  • Update sass-spec test suite to 2022-09-15.
  • Handle tests referencing input.scss in spectest (include it among the mock files, if mentioned in itself or any existing mock file) (PR #150).
  • Use lazy-regex in spectest (PR #150).
  • Rsass now uses rust edition 2021, so MSRV is 1.56.0 (PR #153).
  • Some cleanups.
  • The main branch is now named main rather than master.

Thanks to @fasterthanlime (again) for reporting the problem with interpolation in min and max.

Release 0.25.2

27 May 21:48
@kaj kaj
Compare
Choose a tag to compare

Released 2022-05-27. Progress: 4350 of 6552 tests passed in dart-sass compatibility mode.

  • Use platform-dependent path.join for putting the local part after a base path, seems to make slash-separated strings ok as the joined part. (PR #144, issue #133)
  • Update sass-spec test suite to 2022-05-20.

Thanks to @fasterthanlime for reporting and testing.

Release 0.25.0

17 May 21:29
@kaj kaj
Compare
Choose a tag to compare

Released 2022-05-17 (On the Norwegian Constitution day 🇳🇴).
Progress: 4331 of 6523 tests passed in dart-sass compatibility mode.

Breaking changes

  • Update minimum supported rust version to 1.49.0 (from 1.45.2).
  • SourceFile.parse() now returns a Result<Parsed> rahter than a Result<Vec<sass::Item>>, and Format::write_root now takes a Parsed (PR #140).
  • FsFileContext::file is replaced by FsFileContext::for_path, which initializes a file context and loads a file from it (PR 137).

Improvements

  • Hopefully improved relative file finding on windows (PR #137).
  • Plain css @import rules is only allowed on a few condtions, in other cases an error is reported (Issue #139, PR #137).
  • Rsass can now parse (some) plain css as well as scss. Css files can be referenced in @use and @import directives, as well as in the meta.load-css mixin (PR #140).
  • Make the calc(...) function signal an error when args are known to be invalid css (PR #138).
  • Change map.deep-merge to match recent change in dart sass.
  • Minor fix in whitespace around at-rules.
  • Instrumented attempted file loading with tracing (PR #137).
  • Fix a typo in LICENSE (Issue #136).
  • Update sass-spec test suite to 2022-05-10.
  • Make rust version of sass-spec more directory-aware (which fixes one of 5825 tests).
  • Use a crates badge that actually works.

Thanks to @jonassmedegaard for #136, and to @fasterthanlime for reporting the problem that #137 attempts to fix.

Release 0.24.0

23 Mar 22:16
@kaj kaj
Compare
Choose a tag to compare

Released 2022-03-23.
Progress: 4013 of 6478 tests passed in dart-sass compatibility mode.

Breaking changes

  • The functions parse_scss_file and parse_scss_path is removed. Use SourceFile (maybe from a FileContext) instead (PR #132).
  • Some API changes (mayinly using SourceFile as return type) in FileContext and FsF ileContext (PR #132).
  • Scope::get now takes an &Name rather than an &str for the variable name.
  • sass::Value::Variable now has a source position.
  • sass::Item and css::BodyItem got new alternatives for custom properties (PR #134).
  • Some changes in the Error type to facilitate positions.

Improvements

  • Basic support for meta.load-css mixin (PR #131).
  • Improved calc and clamp handling (PR #133).
  • Support custom properties (PR #134).
  • Refactor source file handling. Instead of creating new FileContexts wrapping the original for each file for searching for local paths in that file, use the SourceName of the containing file to find local paths (PR #132).
  • Detect @import loops.
  • Report undefined variable / module errors better.
  • Update color formatting. Sass-spec changed how it decides what format to show a color in (PR #135).
  • Enable clippy in CI and fix some things it complained about (PR #128).
  • Update sass-spec test suite to 2022-03-17.

Release 0.23.4

06 Feb 23:04
@kaj kaj
Compare
Choose a tag to compare

Released 2022-02-06. Progress: 3872 of 6477 tests passed in dart-sass compatibility mode.

  • Different kinds of length units are now considered compatible for the max and min css unctions.

Release 0.23.2

04 Feb 17:24
@kaj kaj
Compare
Choose a tag to compare

Released 2022-02-04. Progress: 3872 of 6477 tests passed in dart-sass compatibility mode.

  • Fix remaining cases of "special arguments" handling in rgb function.
  • The commandline now uses clap 3.0 rather than structopt.
  • Update update-tests dependency hrx-get to 0.2.0.
  • Update sass-spec test suite to 2022-02-01.

Release 0.23.0

10 Dec 19:17
@kaj kaj
Compare
Choose a tag to compare

Released 2021-12-10.
Progress: 3849 of 6444 tests passed in dart-sass compatibility mode (this may seem like a regression, but that is caused by changed in the test suite).

Breaking changes

  • Error has a new alternative, AtError.
  • In sass::Item, the Error, MixinCall and MixinDeclaration variants is changed to include a SourcePos. Also, a sass::Mixin contains a SourcePos for where it is declared.
  • The fields of SourcePos is now private.
  • The name of a sass::Item::AtRule is now a SassString.
  • A css::Value::Literal now contains a CssString rather than a String and a Quotes. Evaluating a SassString also returns a CssString (PR #118).
  • The selector types are split from one selector module to the css and sass modules. Anything that used selector types should now use either css or sass types (PR #123).

Improvements

  • A css call is just a special kind of string.
  • Include position of directive or function call when reporting @error errors.
  • Improve error reporting from inside mixins and functions.
  • Support interpolation in @-rule names.
  • Fixed #116: The sass:map.merge function was buggy.
  • Fixed #119: saturate(200%) is allowed (the argument is not limited to 0..100%).
  • sass:selector functions append, nest, and parse are closer to correct (PR #123).
  • sass:meta functions calc-args and calc-name implemented (PR #126).
  • Css strings and selectors can now be parsed directly (PR #123).
  • Fixed reformatting of to-much-indented comments.
  • Fixed panics in some color arithmetic (Issue #120, #121, #122, PR #125).
  • Replace rand with fastrand, hopefully compile faster (PR #105).
  • Unicode Private-use characters are escaped when printed.
  • Updated nom to 7.0 and nom-locate to 4.0.
  • Update sass-spec test suite to 2021-11-30.

Thanks to @paolobarbolini, @connorskees and @charlesxsh for reporting issues.

Release 0.22.2

03 Jul 19:56
@kaj kaj
Compare
Choose a tag to compare

Released 2021-07-03. Progress: 4002 of 6180 tests passed in dart-sass compatibility mode.

  • Changed the red(..), green(..), and blue(..) functions to always return integers. Issue #114, thanks @Keats.
  • Changed the blackness(..) and whiteness(..) functions to return blackness/whiteness of the integer rgb approximations of the color rather than the exact color.