Commit Graph

494 Commits

Author SHA1 Message Date
Natalie Weizenbaum
295a116962
Fix inverted changelog lines (#1289) 2021-04-19 14:54:41 -07:00
Natalie Weizenbaum
45c1333276
Properly reset variables in the loop in _peekIndentation() (#1288)
Closes #1287
2021-04-19 12:41:57 -07:00
Jennifer Thakar
1e14b3ec65
Add missing package_config dep (#1286) 2021-04-16 16:38:45 -07:00
Natalie Weizenbaum
16d6711eb1
Limit Chokidar's lower bound to 3.0.0 (#1279)
There's no reason we *should* have to do this, since we do declare
support for Chokidar 3.0.0 and npm *should* just install the latest
available version that matches the constraint. But in practice it
doesn't for some reason, so I guess we'll narrow the constraint to
work around that.

See #863
2021-04-15 15:49:49 -07:00
Henry Catalini Smith
11d09cffd7
Add -w shorthand for --watch CLI flag (#1276)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:23:05 -07:00
Awjin Ahn
2ab4f8061c
Fix deprecation warning typo. (#1247)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:22:02 -07:00
Christophe Coevoet
fbd9cfd8a2
Fix a bunch of typos in comments (#1257)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-04-15 14:01:07 -07:00
Lukasz Kolodziejczyk
84cae191bd
Allow the null safety release of args and watcher (#1238) 2021-02-25 13:45:14 -08:00
Awjin Ahn
ad4a1692a8
Adds RenderOptions to the context of custom functions. (#1236) 2021-02-18 13:48:47 -08:00
Awjin Ahn
94d1fc407b
Update chokidar. (#1235) 2021-02-18 13:15:11 -08:00
lukaszkolodziejczyk
1df37b1ee9
Allow the null safety release of stream_transform (#1223) 2021-02-09 16:43:55 -08:00
Awjin Ahn
4ea9fff2bb
Let last !default value of @forward...with be commaless. (#1226)
This advances the scanner to the next line even if the !default
identifier is not followed by a comma.
2021-02-04 14:18:19 -08:00
Natalie Weizenbaum
2682992bd4
Split SassNumber into separate subclasses based on units (#1221)
This allows us to use more efficient implementations in the common
case where numbers don't have complex units.

See #113
2021-02-02 17:37:56 -08:00
Mary
196992eba3
Merge branch 'master' into patch-5 2021-01-28 09:39:45 -05:00
Natalie Weizenbaum
934bdd556a
Set RangeError.start and .end for color range checks (#1215)
This is useful for sass/dart-sass-embedded#32 because it makes the
range checks easier to deconstruct and reconstruct into useful
embedded error messages.
2021-01-27 15:50:02 -08:00
Mary
5e4756a480
Add 1.32.6 to changelog 2021-01-25 13:34:53 -05:00
Natalie Weizenbaum
474956d9a8
Merge branch 'master' into node-api-bugs 2021-01-19 18:38:41 -08:00
Christophe Coevoet
f0720f204d
Implement proper handling of units in for loops (#1200)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-01-19 18:37:41 -08:00
Mary
9262326e76
Update node_preamble.dart (#1207)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-01-19 18:19:32 -08:00
Natalie Weizenbaum
072c5252ca Wrap fiber.yield() calls in runZoned()
This resets the current zone after the fiber returns, where otherwise
it could end up set to a different zone entirely, since Dart's Zone
API is unaware of fibers.

Closes #1204
2021-01-15 16:14:35 -08:00
Natalie Weizenbaum
f93feaf592 Don't try to cast an error to JsError
Dart's runtime understanding of what a "JsError" is isn't sufficient
to make sense of everything that might be thrown by, for example, a
custom function with an error.
2021-01-15 16:14:20 -08:00
Natalie Weizenbaum
19555e9a7a Release 1.32.4 2021-01-11 17:04:09 -08:00
Natalie Weizenbaum
66cb55c76f
Avoid throw/catch in Number.== (#1188)
Throwing and catching exceptions is expensive. Testing this on one
user's number-heavy codebase resulted in a 2x speed improvement.
2021-01-11 13:41:37 -08:00
Natalie Weizenbaum
01231e2f4c
Print the values of deprecated numbers passed to color functions (#1184)
See #1174
2021-01-06 15:17:53 -08:00
Natalie Weizenbaum
f24a2b9ca4
Avoid permissions errors in _realCasePath. (#1181)
This catches permissions errors and treats them as indicating that the
path component we have so far is canonical. This also improves the
efficiency of case matching by caching results for higher directories.
2021-01-06 12:49:45 -08:00
Natalie Weizenbaum
bae2968757 Deprecate incorrect HSL units
Partially addresses #1174
2020-12-29 13:26:54 -08:00
Natalie Weizenbaum
d532f015f6 Improve error reporting for incompatible units
The new messages more consistently include argument names and actual
values. Errors about mixed unitless and unitful numbers are now more
consistent.
2020-12-28 17:58:55 -08:00
Natalie Weizenbaum
7ba7351148 Mark deprecation warnings as such 2020-12-28 14:44:00 -08:00
Natalie Weizenbaum
02c92aa7cd
Add support for clamp() as a special math function (#1168)
Closes #1146
See sass/sass#2860
2020-12-28 13:42:04 -08:00
Natalie Weizenbaum
bf623752fb
Avoid always downcasing file paths on Windows (#1172)
Closes #1169
2020-12-23 18:07:20 -08:00
Kevin Choi
43f4607c78
Update cli_pkg (#1153)
This makes the main function (cli_pkg_main_0) return a Promise instead of void.

Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2020-11-23 13:11:37 -08:00
Jennifer Thakar
4f1f5c9de8
Fix for importers that return null in load (#1139) 2020-11-10 09:44:37 -08:00
Natalie Weizenbaum
c0e6ba1b07
Fix a buggy interaction between @at-root and @keyframes (#1135) 2020-11-05 12:55:11 -08:00
Natalie Weizenbaum
939dca8e38
Support generalized @supports conditions (#1134)
Closes #894
See sass/sass#2780
2020-11-04 16:10:37 -08:00
Natalie Weizenbaum
908515065f
Merge branch 'master' into feature.hwb 2020-10-29 14:49:58 -07:00
Natalie Weizenbaum
4a0da21ed3
Fix a stack overflow when setting pkg.githubReleaseNotes (#1130) 2020-10-29 13:43:27 -07:00
Natalie Weizenbaum
093ff58673 Merge branch 'master' into feature.hwb 2020-10-28 16:22:18 -07:00
Natalie Weizenbaum
290e55c2f1
Trim extends at the compound selector level (#1124)
This reverts a portion of #460 (15202c4). It turns out that trimming
compound selector extends allows us to avoid exponential behavior in
certain recursive @extend cases.

See sass/dart-sass#1109
2020-10-28 15:11:22 -07:00
Natalie Weizenbaum
300197caf9
Don't crash when using Infinity or NaN as a key in a map (#1073)
Closes #3126
2020-10-27 16:38:47 -07:00
Natalie Weizenbaum
c4f95d4310
Fix the argument name for meta.load-css() (#1072)
Closes #1054
2020-10-27 15:54:14 -07:00
Natalie Weizenbaum
197c6dbbde
Emit a proper parse error for = with no RHS in a function (#1071)
Closes #1050
2020-10-27 15:47:48 -07:00
Jennifer Thakar
6c679e13d4
Support HWB in adjust, change, and scale (#1111)
This adds `$whiteness` and `$blackness` parameters to the `adjust`,
`change`, and `scale` functions in the color module.

In doing so, I generalized the logic for all three functions into a
single `_updateComponents` helper since they all shared a lot of similar
logic for validating their parameters.
2020-10-14 19:45:35 -07:00
Natalie Weizenbaum
7ba5128423
Add color.whiteness() and color.blackness() functions (#1110)
See sass/sass#2834
See #1089
2020-10-14 16:15:46 -07:00
Natalie Weizenbaum
b0f213c22f Merge remote-tracking branch 'origin/master' into feature.hwb 2020-10-09 17:29:47 -07:00
Natalie Weizenbaum
f981227cc0
Merge branch 'master' into fix-type-check 2020-10-07 15:07:12 -07:00
Natalie Weizenbaum
1ceaec71ff Fix custom property parsing in plain CSS
Closes #1104
2020-10-07 14:49:16 -07:00
Natalie Weizenbaum
c14cb73b08
Merge branch 'master' into feature.nested-maps 2020-10-05 17:59:59 -07:00
Natalie Weizenbaum
ec0bab5538
Fix a bug with nested properties beneath Sass-syntax custom props (#1096)
Closes #1095
2020-10-05 17:58:53 -07:00
Natalie Weizenbaum
2198aa7dab
Merge branch 'master' into feature.nested-maps 2020-10-05 17:31:41 -07:00
Jennifer Thakar
56d979d04d
Add a map.deep-remove() function (#1091) 2020-09-22 16:11:48 -07:00
Awjin Ahn
45703ab597
Adds nested map support to map-merge. (#1083) 2020-09-18 12:18:27 -07:00
Natalie Weizenbaum
f843f96bc2
Produce a better error for positional arguments after named (#1087)
Closes #1086
2020-09-17 17:50:19 -07:00
Natalie Weizenbaum
1918674295
Support HWB colors in SassColor (#1085)
See sass/sass#2835
2020-09-17 16:18:12 -07:00
Awjin Ahn
5b7471664d
Add a map.set() function (#1078) 2020-09-16 15:47:35 -07:00
Jennifer Thakar
f5e3a5a669
Add support for nested maps to has-key (#1075) 2020-09-16 14:41:23 -07:00
Jennifer Thakar
6b66241e95
Add support for nested maps to map-get (#1076) 2020-09-16 13:23:52 -07:00
Natalie Weizenbaum
028b2f6a01 Add a map.deep-merge() function (#1077) (#1080)
This also adds a Value.tryMap() function, which was useful for
implementing this and may be more generally useful to users as well.

See sass/sass#2836
See sass/sass-spec#1560
2020-09-15 16:25:49 -07:00
Natalie Weizenbaum
015a76cf0b Revert "Add a map.deep-merge() function (#1077) (#1080)"
This reverts commit 315e86b442.

Once again, this was supposed to go on feature.nested-maps.
2020-09-15 16:24:53 -07:00
Natalie Weizenbaum
315e86b442
Add a map.deep-merge() function (#1077) (#1080)
This also adds a Value.tryMap() function, which was useful for
implementing this and may be more generally useful to users as well.

See sass/sass#2836
See sass/sass-spec#1560
2020-09-15 16:23:01 -07:00
Natalie Weizenbaum
9503b57ac5 Revert "Add a map.deep-merge() function (#1077)"
This reverts commit bc7216a441.

This was intended to land on a feature branch, not on master.
2020-09-15 15:17:55 -07:00
Natalie Weizenbaum
bc7216a441
Add a map.deep-merge() function (#1077)
This also adds a Value.tryMap() function, which was useful for
implementing this and may be more generally useful to users as well.

See sass/sass#2836
See sass/sass-spec#1560
2020-09-15 13:03:38 -07:00
Natalie Weizenbaum
a06295426d
Throw a proper error when the same built-in module is @used twice (#1070)
Closes #1047
2020-09-04 12:26:29 -07:00
Natalie Weizenbaum
1dff9a7ce4
Don't crash when writing Infinity in JS mode (#1069)
Closes #1031
2020-09-04 12:25:42 -07:00
Natalie Weizenbaum
4c0bc7f4f5
Throw an error if the first error to selector.nest() contains & (#1068)
Closes #966
2020-09-03 16:00:14 -07:00
Christophe Coevoet
fca32e8deb
Use HTTPS links in the changelog (#1061)
This also update the URL to the canonical one rather than relying on the redirection.
2020-08-24 09:29:21 -07:00
Natalie Weizenbaum
9f640625e9
Improve the error messages for syntax errors (#1055)
* Produce a useful error for "@else i<EOF>"

* Produce a useful error for out-of-range hex escapes

Closes #1029, #1049, #1030
2020-08-10 13:55:13 -07:00
Jennifer Thakar
9375ada8e6
Fix a selector parsing bug in indented syntax (#1005)
Fixes #1002.

In the indented syntax, a selector list may continue onto another line
if the previous line ends with a comma. Previously, if there was a
comment after the comma, it wouldn't be recognized and the selector
would be broken in two (with the first selector having no properties).

This fixes the parser to ignore comments when looking for the comma at
the end of a line.

Also disables the formatting check to work around dart-lang/dart_style#940.
2020-08-06 15:43:16 -07:00
Jennifer Thakar
6565b45a6c
Fix a null pointer bug (#1041)
Fixes #1038.
2020-07-06 15:35:09 -07:00
Mary
9a89df2b64
Release 1.26.9 (#1028)
Co-authored-by: Jennifer Thakar <jathak@google.com>
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2020-06-22 14:32:00 -07:00
Jennifer Thakar
7d6dae02a4
Always use absolute URLs in stdout source maps (#1021)
Fixes #1020.
2020-06-04 17:03:06 -07:00
Jennifer Thakar
cf3ac21752
Fix pubspec and release 1.26.7 (#1016)
Pub was failing due to the `js` dependency being declared as a dev
dependency but being referenced in `lib`.
2020-05-28 16:46:28 -07:00
Jennifer Thakar
fba0ea37a1
Properly handle escaped @else (#1014)
Fixes #1011.

This also fixes a bug where `@else` was parsed case-insensitively
(unlike all other Sass at-rules, which must be lowercase).
2020-05-28 11:48:24 -07:00
awjin
21a1c58b20 Don't read file if Node importer returns file and contents.
Instead, use `contents` with `file` as the canonical url.

Closes https://github.com/sass/dart-sass/issues/975.
2020-04-24 17:38:30 -07:00
Jennifer Thakar
7160b6426d
Add missing constants to JS API (#990)
Fixes #977.
2020-04-24 16:11:46 -07:00
Natalie Weizenbaum
a7b0ad8e64
Release 1.26.5 (#987)
This needs a release because the release process for 1.26.4 was broken
by dart-lang/sdk#41259.
2020-04-23 18:39:10 -07:00
Natalie Weizenbaum
bf35513a4c
Avoid adding duplicate modules when importing forwarded stylesheets (#973)
Avoid adding duplicate modules when importing forwarded stylesheets

In Google stylesheets that imported import-only stylesheets with many
forwards many of times, we were seeing Environment._globalModules grow
large enough that variable accesses were a problem. This addresses
that in several ways:

* Forwarded modules are now ignored if the module is already being
  forwarded.

* Module equality is more intelligent, so that shadowed and forwarded
  modules can be effectively de-duplicated.

* If a module would be fully shadowed by a later import *and* that
  module has no CSS, we no longer add an empty ShadowedModule to the
  module list.
2020-03-24 15:31:06 -07:00
georgpukk
4d78316cb7
Fix a check that prevents compiling .css files to themselves (#968)
Co-Authored-By: Natalie Weizenbaum <nweiz@google.com>
2020-03-11 14:48:00 -07:00
Natalie Weizenbaum
cb8a048e58
Refactor Extender._extendOrReplace() (#965)
This combines all targets into a single extender invocation, which is
more efficient and allows it to more aggressively do redundant
selector elimination.
2020-02-28 15:48:36 -08:00
Natalie Weizenbaum
a333059e71 Keep recompiling downstream dependencies after an error in --watch
Prior to this, the watcher handled all the logic around recompiling
stylesheets if an upstream file was deleted or added in a way that
could affect their import resolution. This left a gap where the
stylesheet graph wouldn't be aware that a newly-added file had become
upstream dependency of an existing downstream file, leading to
recompilation failures.

This commit fixes that by moving all that logic into the stylesheet
graph. The graph now has full and sole responsibility for providing a
consistent view of which stylesheets depend on one another even as the
shape of the graph changes, and the watcher is just a client of that
logic.

Closes #550
2020-02-24 20:18:03 -08:00
Natalie Weizenbaum
01ed720e9c
Temporarily disable deploying to Chocolatey (#960)
The cli_pkg Chocolatey deployment is still failing for unknown
reasons, and until I have time to debug it I want to get a full
release out.
2020-02-24 11:38:42 -08:00
Natalie Weizenbaum
4f8f509584
Cut a release (#958)
* Use cli_pkg's updated Chocolatey support
* Stop running Node tests on the Dart dev channel for now

See dart-lang/test#1184
2020-02-19 13:42:56 -08:00
Natalie Weizenbaum
0d0270cb12
Cut a release (#957) 2020-02-13 16:05:04 -08:00
Natalie Weizenbaum
6d388248b6
Eagerly initialize Environment._globalModules (#952)
We had been lazily initializing this to be more efficient when no
global modules were used, but this meant that the object wasn't shared
with closures created for mixins and functions that were created when
it was still `null`, so later imported forwards weren't visible to
those members.
2020-02-13 15:23:53 -08:00
Natalie Weizenbaum
0a2142dc86
Don't include leading underscores in implicit namespaces (#955)
Closes #934
See sass/sass#2800
2020-02-12 12:52:53 -08:00
Natalie Weizenbaum
7d8002ec9b Cut a release 2020-02-07 17:04:13 -08:00
Natalie Weizenbaum
67c4e1bdea
Don't throw conflict errors for identical members (#947)
See sass/sass#2820
Closes #946
2020-02-07 15:17:05 -08:00
Natalie Weizenbaum
73ddae9c34 Bump the pubspec and add a CHANGELOG entry
Normally I'd just release this, but releasing is currently on hold
until a few cli_pkg bugs are fixed.
2020-02-07 01:00:41 -08:00
Natalie Weizenbaum
7457d2e9e7
Create a release to test cli_pkg infrastructure (#940) 2020-01-24 16:49:59 -08:00
Natalie Weizenbaum
eeeac1d689
Give JavaScript value objects useful constructor.name values (#936)
Closes #810
2020-01-17 14:46:10 -08:00
awjin
4c0c6b48e4 Merge branch 'master' into math-functions 2020-01-16 14:55:40 -08:00
Awjin Ahn
75cab86448 Add trigonometric math functions. (#921)
See https://github.com/sass/sass-spec/pull/1504
2020-01-15 14:44:13 -08:00
Awjin Ahn
3cbaec11b2 Add exponential math functions. (#909) 2020-01-15 14:44:13 -08:00
awjin
d487d761bd Revert "Revert "Add built-in variables e and pi. (#907)""
This reverts commit 3c64addbf3.
2020-01-15 14:44:13 -08:00
awjin
5f72acb14d Revert "Revert "Adds built-in clamp() and hypot() (#906)""
This reverts commit 76280409bd.
2020-01-15 14:44:13 -08:00
Natalie Weizenbaum
0c1370ce25 Allow errors to refer to multiple source spans at once
This makes error messages for issues like configuring a module after
it's loaded much clearer.
2020-01-10 22:31:48 -08:00
Natalie Weizenbaum
ca63b1ba7d
Don't try to resolve relative Node importer URLs for source maps (#923)
* Don't try to resolve relative Node importer URLs for source maps

Closes #922

* Reformat
2020-01-09 13:14:44 -08:00
Natalie Weizenbaum
e110961120
Pass the version variable to script snapshots at build time (#920)
Closes #914
See https://github.com/dart-lang/sdk/issues/36579#issuecomment-571386118
2020-01-07 13:53:30 -08:00
Jennifer Thakar
bfdf4b35a4
Fix import-only files for Node importers (#919) 2020-01-03 15:41:12 -08:00
Jennifer Thakar
79d9a73474
Cache separate canonical URLs for @use and @import (#908)
Fixes #899.

The cache for canonical URLs is now keyed on *both* the rule URL and
whether that URL was canonicalized for an `@import` rule.
2020-01-02 15:25:02 -08:00
Jennifer Thakar
76280409bd Revert "Adds built-in clamp() and hypot() (#906)"
This reverts commit 24f84e2c88.
2020-01-02 13:45:51 -08:00