Commit Graph

699 Commits

Author SHA1 Message Date
Natalie Weizenbaum
390deed540
Merge pull request #1438 from sass/extend-bugs
Fix a couple bugs with @extend
2021-08-16 22:01:32 +00:00
Natalie Weizenbaum
2a03907e95
Emit escape sequences for private-use characters in expanded mode (#1430) 2021-08-16 21:52:35 +00:00
Natalie Weizenbaum
707db69de8 Fix a couple bugs with @extend
We weren't properly merging multiple @extend rules that were added to
an upstream module at the same time, so some of them weren't being
marked as satisfied.

Closes #1393
2021-08-11 18:41:50 -07:00
Natalie Weizenbaum
e0e132e0fe
Allow numbers with leading . in plain-CSS min/max (#1432)
Closes #1394
2021-08-11 22:27:58 +00:00
Natalie Weizenbaum
d29acb0974
Don't try to force custom URL schemes to file paths in the Node API (#1434)
When an error occurred in a stylesheet loaded by a custom importer
with a custom URL scheme, the Node error wrapper tried to convert that
URL into a path and ended up crashing.

Closes #1138
2021-08-11 21:03:14 +00:00
Natalie Weizenbaum
3eca26584d
Fix a single-backslash attribute selector (#1428)
Closes #1423
2021-08-11 01:52:17 +00:00
Natalie Weizenbaum
5f4994e487
Fix backslash-escapes in url()s (#1429)
Closes #1399
2021-08-11 00:02:23 +00:00
Natalie Weizenbaum
54d16c0ac4
Allow if to be used as an unquoted string (#1431)
Closes #1405
2021-08-10 23:34:36 +00:00
Natalie Weizenbaum
2beec3696c
Strip CRLFs from error comments (#1433)
Closes #1392
2021-08-10 22:59:35 +00:00
Natalie Weizenbaum
682cbbf6c0 Add a header to changelog 2021-08-09 17:04:53 -07:00
Natalie Weizenbaum
4fd0472f2e Fix a crash in the Node importer
When a path was returned at the same time as a file's contents, it was
interpreted as a URL without first being translated to one. This
crashed for absolute Windows paths.

Closes #1410
2021-08-09 16:47:45 -07:00
Natalie Weizenbaum
c07f46175b
Add a tag to the correct repo with the correct authentication (#1420) 2021-08-04 01:26:34 +00:00
Natalie Weizenbaum
1157d3c327
Manually resolve symlinks before deploying sub-packages (#1419) 2021-08-03 23:26:27 +00:00
Natalie Weizenbaum
667e9f40e6
Fix an unmodifiable map modification in the sass_api deploy (#1418) 2021-08-03 20:33:54 +00:00
Natalie Weizenbaum
2a0b6d05ef
Fix publishing errors for sass_api (#1417)
This needs a LICENSE of its own and it can't have dependency_overrides
when publishing.
2021-08-02 23:58:34 +00:00
Natalie Weizenbaum
3af6562497
Try cutting a release of sass_api (#1416) 2021-08-02 21:45:46 +00:00
Natalie Weizenbaum
9f3133a179 Fix dartdoc errors
Also fix a couple places where our external API wasn't quite right.
2021-07-30 15:14:17 -07:00
Natalie Weizenbaum
a28c656049 Add dartdoc categories to Sass APIs 2021-07-30 14:29:51 -07:00
Natalie Weizenbaum
c80320f777
Set CompileSuccess.loaded_urls (#50) 2021-07-23 21:41:39 +00:00
Natalie Weizenbaum
5d65c11403 Code review changes 2021-07-23 13:37:49 -07:00
Natalie Weizenbaum
43b69e60a0 Change CompileResult.includedFiles to CompileResult.includedUrls
Rather than constructing this explicitly to match Node Sass's API, we
construct it with canonical URLs and convert it into the format
expected by the Node Sass API (a mix of paths and URLs) in the
compatibility layer.
2021-07-13 18:08:18 -07:00
Natalie Weizenbaum
a10d7c677d
Use @internal to cordon off internal-only Value APIs (#1379)
Lays the groundwork for #236

Note that we need to add a bunch of explicit @nodoc annotations to
work around dart-lang/dartdoc#2418 and dart-lang/dartdoc#2419.
2021-06-24 17:32:57 -07:00
Natalie Weizenbaum
655fcfc950
Properly support selector lists for selector.extend() (#1378)
Closes #1301
2021-06-24 14:50:16 -07:00
Natalie Weizenbaum
83343d7046
Fix a race condition in meta.load-css() (#1376)
We weren't properly awaiting a call to CssStylesheet.accept(), which
meant that it could try to continue doing work asynchronously in the
wrong context.

Closes #1318
2021-06-23 17:12:18 -07:00
Natalie Weizenbaum
713b7cc31e
Properly register pseudos' child selectors in ExtensionStore (#1374)
Closes #1297
2021-06-23 16:43:08 -07:00
Natalie Weizenbaum
19bd45e738
Error for Unicode ranges that have too many ?s after digits (#1373)
Closes #1280
2021-06-22 17:24:22 -07:00
Natalie Weizenbaum
629881212c
Fix root-relative @import URLs as passed to importers (#1371)
Closes #1137
2021-06-22 17:22:29 -07:00
Natalie Weizenbaum
5a9dd9161b
Fix a variable-assignment bug (#1372)
Closes #1250
2021-06-22 15:10:32 -07:00
Natalie Weizenbaum
c919db73aa
Support CompileRequest.quiet_deps and .verbose (#48)
Closes #44
2021-06-16 13:36:56 -07:00
Natalie Weizenbaum
0f68d7a511
Fix quiet deps when loaded through an @import of a file without @use (#1362)
Closes #1360
2021-06-15 13:37:48 -07:00
Natalie Weizenbaum
7e371666f4
Add quietDeps and verbose to the JS API (#1353)
To support this, we now run Node-Sass-style relative loads outside of
the Node importer. This allows the evaluator to check whether a
relative load succeeded and use that to determine whether the
stylesheet counts as a dependency.

See sass/sass#3065
2021-06-14 17:41:56 -07:00
Jennifer Thakar
a077094f24
Fix toString for namespaced variable (#1358) 2021-06-14 14:19:53 -07:00
Natalie Weizenbaum
1c773f1cb1
Support VersionRequest and VersionResponse (#46)
Closes #33
2021-06-14 12:51:01 -07:00
Jennifer Thakar
f1d36a1860
Another implicit dependency fix (#1352) 2021-06-11 16:54:41 -07:00
Jennifer Thakar
754501145c
Fix a bug with implicit dependencies (#1348)
Encountered this while migrating internal code to math.div
2021-06-08 13:06:34 -07:00
Jennifer Thakar
af816d0941
Fix bug in --update with built-in modules (#1338)
Fixes #1335.
2021-06-02 14:52:17 -07:00
Christophe Coevoet
0db34159e5
Fix the allowed children for the for at-rule in declarations (#1340) 2021-06-02 14:22:34 -07:00
Natalie Weizenbaum
fd1bfd293b
Fix the URL for the @-moz-document deprecation message (#1339)
Closes #1336
2021-06-01 18:07:46 -07:00
Natalie Weizenbaum
66ab368582
Support fuzzy range errors (#45)
Closes #32
2021-05-26 13:10:56 -07:00
Natalie Weizenbaum
12c468004c
Implement CanonicalizeRequest.from_import (#41)
See sass/sass#3055
See webpack-contrib/sass-loader#905
See sass/embedded-protocol#61
2021-05-25 17:59:17 -07:00
Natalie Weizenbaum
16f181660c Only omit 5 deprecation warnings per feature by default (#1327)
Closes #1323
2021-05-21 22:45:58 -07:00
Natalie Weizenbaum
d660bf12ef Add an option to the CLI and Dart Sass to silence warnings from deps
Closes #672
2021-05-21 22:45:58 -07:00
Natalie Weizenbaum
7f982a1b3a
Only emit each warning once per source location (#1322) 2021-05-21 16:23:53 -07:00
Jennifer Thakar
efe680e74b
Make :is() behave like :matches() (#1315) 2021-05-20 14:13:10 -07:00
Natalie Weizenbaum
f33b934fe4
Fix some edge cases when serializing edge-case numbers (#1312)
Also pin static analysis to Dart 2.12 to work around dart-lang/sdk#45488.
2021-05-19 17:29:16 -07:00
Natalie Weizenbaum
93bc86f97a
Support non-nullability (#40) 2021-05-17 20:57:37 -07:00
Natalie Weizenbaum
47920ad032
Merge branch 'master' into slash-separator 2021-05-17 14:13:03 -07:00
Natalie Weizenbaum
136bd285b3 Add AsyncImporter.fromImport for Dart importers 2021-05-13 18:06:43 -07:00
Natalie Weizenbaum
8a344e343f Add this.fromImport for JS importers
See sass/sass#3055
See webpack-contrib/sass-loader#905
2021-05-13 17:40:31 -07:00
Natalie Weizenbaum
114b460d7c Merge remote-tracking branch 'origin/master' into slash-separator 2021-05-13 16:43:52 -07:00
Natalie Weizenbaum
68c4d6556e Make number arguments to built-in functions slash-free
See sass/sass#3050
2021-05-12 13:21:31 -07:00
Natalie Weizenbaum
be1a414f07 Deprecate /-as-division and add replacements
Partially addresses #663
2021-05-12 13:21:28 -07:00
Jennifer Thakar
5d4950db36
Fix bug with null values in configuration (#1305)
Fixes #1281.
2021-05-12 09:09:35 -07:00
Christophe Coevoet
be2d3e848a
Fix argument names in str-slice errors (#1303) 2021-05-05 17:02:14 -07:00
Awjin Ahn
30ede40732
Fix extending selectors across multiple modules. (#1298)
* Fix extending selectors across multiple modules.

Allows more than one module to extend the same upstream selector that,
in turn, extends a selector from its upstream module.

Properly skips creating an extra extension that was being counted as
unresolved when evaluating @extends.

See https://github.com/sass/sass-spec/pull/1635
Fixes https://github.com/sass/dart-sass/issues/1295
2021-04-28 14:19:12 -07:00
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
Jennifer Thakar
3c64addbf3 Revert "Add built-in variables e and pi. (#907)"
This reverts commit 2cb69e70ab.
2020-01-02 13:45:49 -08:00
Awjin Ahn
2cb69e70ab
Add built-in variables e and pi. (#907) 2019-12-26 16:31:33 -08:00
Awjin Ahn
24f84e2c88
Adds built-in clamp() and hypot() (#906) 2019-12-26 12:40:08 -08:00
Natalie Weizenbaum
de3f3208e9 Support @forward ... with
See sass/sass#2744
Closes #846
2019-11-27 16:03:43 -08:00
Jennifer Thakar
8270dc1664
Support configuring modules through imports (#885)
Fixes #882

See sass/sass-spec#1497
2019-11-26 09:46:51 -08:00
Natalie Weizenbaum
15be59be31
Make SassFormatException implement SourceSpanFormatException (#891) 2019-11-25 18:54:45 -08:00
Natalie Weizenbaum
731bd441ca Don't produce name conflict errors due to imports
Closes #888
2019-11-20 16:25:48 -08:00
Natalie Weizenbaum
aa76c8ab3b Always create scopes for nested imports 2019-11-20 16:21:03 -08:00
Natalie Weizenbaum
aac599947d
Run the GitHub Windows release on the latest Dart version (#886) 2019-11-18 17:33:56 -08:00
Natalie Weizenbaum
e1e96338d8 Bump the version 2019-11-15 16:40:47 -08:00
Natalie Weizenbaum
0d782fbccf
Fix inline comments in the indented syntax (#881)
Closes #880
2019-11-15 15:45:11 -08:00
Awjin Ahn
07b5c84b7d
Fix arity in overloaded function argument error (#883)
When overloaded functions receive an incorrect number of positional
arguments, determine which overload has the most similar number of
arguments, and then correctly display that number in the error.

Closes #520
sass/sass-spec#1496
2019-11-15 14:26:11 -08:00
Awjin Ahn
3d1dab3563 Print call-site for @errors in mixins and functions (#878)
For any @errors encountered in mixins or functions, use the call-site
(instead of the @error rule) as the span printed in the error message.

Closes #474
See sass/sass-spec#1494
2019-11-13 17:56:35 -08:00
Natalie Weizenbaum
44059573bb
Watch files through @forward rules (#871)
Closes #870
2019-11-04 13:32:27 -08:00
Natalie Weizenbaum
be4ca60045 Propagate selector source specificity between modules
Closes #866
2019-10-30 15:11:25 -07:00
Natalie Weizenbaum
3392db0074
Don't compile .css files in directories to themselves (#862)
This also adds support for compiling .css files in directories *at
all*, which had previously only worked in --watch mode.

Closes #853
2019-10-29 23:48:21 +00:00
Natalie Weizenbaum
1b17ab76cf
Reset the forwarded config to empty for @use and meta.load-module() (#855)
In #827 I made configuration never be null, but this turns out to be
overkill: we still need a way for _loadModule() and _execute() to
distinguish between "use the existing configuration" (for @forward)
and "use no configuration" (for an unconfigured @use or
meta.load-module()). We now use null as a sentinel value there, while
still ensuring that _configuration is non-nullable.

Closes #854
2019-10-22 01:35:11 +01:00
Natalie Weizenbaum
73de08b817
Only generate and update selectors, not rules, in Extender (#856)
We switched to *updating* selectors a while ago so that cloned rules
would continue to see updates in their selectors, but we were still
generating and tracking rules in the Extender. This caused skew
between what rules the extender knew about and what rules actually
existed in situations where rules were copied (such as when resolving
nested media queries).

There's no principled reason the extender needs to know about style
rules at all, so now it just tracks modifiable wrappers of selectors.
These are re-used even when style rules are cloned, so they're safe
from the skew problem.

Closes #843
2019-10-21 21:07:51 +01:00
Natalie Weizenbaum
6b8c168779
Improve error messages for color functions that aren't in sass:color (#844) 2019-10-14 17:56:13 -07:00
Natalie Weizenbaum
e68592f8f3
Allow saturate() in plain CSS files (#845)
Closes #840
2019-10-14 11:47:16 -07:00
Jennifer Thakar
664260159e Update changelog and bump pubspec version 2019-10-10 15:42:39 -07:00
Natalie Weizenbaum
87c9223b66
Fix broken CHANGELOG links (#836) 2019-10-02 11:19:51 -07:00
Natalie Weizenbaum
5052350150 Bump the pubspec and add a changelog entry for @use 2019-10-01 14:54:54 -07:00
Natalie Weizenbaum
d901bcb00c
Properly handle some CSS identifier edge cases (#816)
See sass/sass#2738
Closes #815
2019-09-06 16:54:54 -07:00
Natalie Weizenbaum
aea990d4fc
Properly watch .css files for changes (#814)
Closes #806
2019-09-03 16:42:21 -07:00
Natalie Weizenbaum
4ccddf8b13
Dash-normalize user-defined functions (#813)
Closes #811
2019-09-03 16:00:07 -07:00
Natalie Weizenbaum
35880d171f
Check fs.existsSync() before running fs.statSync() (#812)
This produces non-negligible speed improvements for Node users with
lots of imports.
2019-09-03 13:26:57 -07:00
Natalie Weizenbaum
a89c67b563
Fix unquoted plain-CSS imports (#800)
Closes #799
2019-08-28 14:09:35 -07:00
Natalie Weizenbaum
fc8c987fc1
Fix a few @extend edge cases (#797) 2019-08-16 14:00:14 -07:00
Natalie Weizenbaum
0e5ed4a37d
Fix dash-insensitivity in get-function() (#795)
Closes #792
2019-08-14 12:20:47 -07:00
Natalie Weizenbaum
c8ac543d1e
Re-add support for Node Carbon (#785)
Apparently npm and Yarn won't avoid installing a package version that
declares incompatibility with them, so dropping compatibility for an
old version is actually a breaking change 😭.
2019-07-29 22:32:53 +01:00
Natalie Weizenbaum
d840b84b59 Clarify the error for the wrong number of positional arguments
Closes #776
2019-07-25 08:37:01 +01:00
Natalie Weizenbaum
382af499e0 Avoid double "Error:" headers when reporting selector parse errors
Closes #774
2019-07-25 08:37:01 +01:00
Natalie Weizenbaum
44b542fcef Include argument names when reporting selector parse errors 2019-07-25 08:37:01 +01:00
Natalie Weizenbaum
8d5e3d9a67 Include argument names when reporting range errors
Closes #771
2019-07-25 08:37:00 +01:00
Natalie Weizenbaum
d0f471ca9d Drop support for Node 8.x
url.pathToFileURL, which wasn't supported until Node 10.x, is now used
in node_preamble.
2019-07-22 16:51:15 -07:00
Natalie Weizenbaum
b1707f61cd Release 1.22.8
This doesn't contain any code changes relative to 1.22.7, but the JS
release will pick up mbullington/node_preamble.dart#16.
2019-07-22 14:47:38 -07:00
Natalie Weizenbaum
ea4436b87d
Limit the Dart SDK constraint to ^2.4.0 (#769)
2.3.2 and earlier releases suffered from dart-lang/sdk#37027, which
causes them to fail to parse Dart Sass.

Closes #768
2019-07-18 21:49:36 +01:00
Natalie Weizenbaum
c794abd858 Eagerly dash-normalize Sass identifiers
This avoids using maps and sets with custom equality, which are
moderately inefficient relative to built-in maps and sets on both Node
and the Dart VM. In order to make error messages continue to use the
original identifiers where possible, this updates some of them to rely
more heavily on their associated source spans for context.
2019-07-16 19:42:38 -07:00
Natalie Weizenbaum
535030bb0f Release 1.22.5 2019-07-15 21:59:54 +01:00
Natalie Weizenbaum
0e47e03305
Fix at-rules in nested imports (#758)
Closes #755
2019-07-12 01:55:30 +01:00
Natalie Weizenbaum
d3e288ccf2 Support map-remove() with a named $key argument
Closes #742
2019-07-03 15:31:56 -07:00
Natalie Weizenbaum
eff8c37457 Fix a deadlock in zip()
Closes #739
2019-07-03 15:31:56 -07:00
Natalie Weizenbaum
5ff434da6a Fix join() and append() $separator error messages
Closes #738
2019-07-03 15:31:56 -07:00
Natalie Weizenbaum
47e0cfc8c8 Empty maps have undecided separators
Closes #737
2019-07-03 15:31:56 -07:00
Natalie Weizenbaum
821b5e2521 Fix str-insert() with $index: -1
Closes #733
2019-07-02 17:25:46 -07:00
Natalie Weizenbaum
40df8e3bc1 Fix str-slice() with astral plane characters
Closes #732
2019-07-02 17:25:46 -07:00
Natalie Weizenbaum
2105a138c0 Clamp $alpha in adjust-color() with HSL args
Closes #708
2019-07-02 17:25:45 -07:00
Natalie Weizenbaum
7bfba04b79 Throw an error for plain-CSS invert() with $weight
Closes #705
2019-07-02 17:25:36 -07:00
Natalie Weizenbaum
d5adb4621e Fix invert() with $weight: 50%
Closes #704
2019-07-02 17:25:25 -07:00
Natalie Weizenbaum
9838caff6f Improve errors for alpha() with the wrong number of arguments
Closes #700
2019-07-02 17:25:14 -07:00
Natalie Weizenbaum
ed06a41afc Fix the argument name for a single-argument saturate() function
Closes #699
2019-07-02 16:10:28 -07:00
Natalie Weizenbaum
60af5f6c25
Release 1.22.2 (#745)
The CHANGELOG entry from #727 got misplaced; that code hasn't been
released yet.
2019-07-01 13:31:13 -07:00
Natalie Weizenbaum
532358d7fa
Merge pull request #727 from sass/static-require
Require dependencies in the preamble rather than through JS-interop
2019-06-28 14:32:18 -07:00
Natalie Weizenbaum
2cdbbebcaf
Declare support for Chokidar 3.0.0 (#731)
Closes #730
2019-06-26 16:06:22 -07:00
Natalie Weizenbaum
174ef128a2 Merge remote-tracking branch 'origin/feature.use' into merge-use 2019-06-24 14:12:05 -07:00
Natalie Weizenbaum
494e208067 Require dependencies in the preamble rather than through JS-interop
Closes #726
2019-06-19 19:41:16 +01:00
Natalie Weizenbaum
a46e779675 Clarify !global deprecation warnings
Closes #723
2019-06-18 17:39:29 -07:00
Natalie Weizenbaum
e4b18b5231
Produce better stack traces for syntax errors loaded via import/use (#722)
We now wrap _withStackFrame() around wider sections of code, including
_loadStylesheet() which handles parse errors, so that the @use/@import
stack frames are available.
2019-06-18 17:26:46 -07:00
Natalie Weizenbaum
4716349a0e
Add new module-system features for existing functions (#720) 2019-06-18 12:03:12 -07:00
Natalie Weizenbaum
a87631777b
Declare a "sass" executable in the pubspec (#712) 2019-06-06 21:19:09 +01:00
Natalie Weizenbaum
bea609d74b
Add a top-level warn() function for functions and importers (#711)
In addition to being useful for users of Sass, this will make it
possible for core Sass functions to produce warnings without needing
an explicit reference to the evaluator.
2019-06-06 19:42:44 +01:00
Natalie Weizenbaum
48c284b4ef
Properly mark secure variables so they're decrypted by Travis (#697) 2019-05-31 17:01:33 +01:00
Natalie Weizenbaum
2836780339
Merge pull request #689 from sass/exponent
Fix some number serialization bugs
2019-05-24 15:09:37 -07:00
Natalie Weizenbaum
0fe0208f6e Remove exponent notation for integers on Node.js
Closes #688
2019-05-21 13:36:36 -07:00
Natalie Weizenbaum
fb383de20e Fix a bug in SerializeVisitor._writeDecimal
This function didn't expect a number ending in ".0", because they're
normally filtered out by fuzzyAsInt(). However, they can make it
through for very large doubles.
2019-05-20 15:50:45 -07:00
Natalie Weizenbaum
768da7088c
Resolve imports using custom imports before load paths (#687)
Closes #681
2019-05-20 15:34:57 -07:00
Natalie Weizenbaum
4b7699291c
Compile release executables in native mode (#679) 2019-05-15 16:02:02 -07:00
Natalie Weizenbaum
60fc306ab4 Release 1.20.1
This doesn't have any code changes, but I want to verify that the new
deployment infrastructure works and the only way to do that is to
actually deploy.
2019-05-03 13:13:20 -07:00
Natalie Weizenbaum
34c068a189
Generate a CSS file describing an error when one occurs (#659)
Closes #657
2019-05-02 18:14:25 -07:00
Natalie Weizenbaum
407eefded1
Add support for attribute selector modifiers (#658)
Closes #656
2019-04-30 11:31:18 -07:00
Natalie Weizenbaum
37f0740307
Allow ! in url()s (#650)
Closes #646
2019-04-18 17:37:20 -07:00
Natalie Weizenbaum
413c949446
Make FilesystemImport._loadPath absolute (#651)
This avoids having the effective load path change when the process's
working directory changes.
2019-04-18 16:34:48 -07:00
Natalie Weizenbaum
3b3a43a8f9
Add a --charset flag and API option (#644)
The automatic @charset adding is useful in general, but there are
consistently cases where it trips up naïve downstream tools. This
option makes it easier for users to control when it occurs.
2019-04-08 14:49:08 -07:00
Natalie Weizenbaum
59800ad1f9
Don't recursively list directories in realCasePath() (#641)
We only need to list the path's immediate parent directory in order to
find its real case.

Closes #636
2019-04-04 12:18:02 -07:00
Natalie Weizenbaum
495c6f3163
Only claim "package:" URLs are unsupported on Node (#637)
Closes #630
2019-04-04 12:17:36 -07:00
Natalie Weizenbaum
8c9412b520
Fix importing files relative to "package:" imports (#638)
The PackageImporter wasn't accepting paths relative to its
canonicalized outputs as inputs.

Closes #631
2019-04-03 13:57:52 -07:00
Natalie Weizenbaum
9999835df0
Add a sass.types.Error constructor to the JS API (#627)
Closes #590
2019-04-03 01:07:12 -07:00
Natalie Weizenbaum
bc5e3c4f8f
Properly parse CR, CR LF, and FF as newlines everywhere (#626)
Closes #623
2019-03-18 16:50:23 -07:00
Natalie Weizenbaum
62bce0c5b9
Properly stringify slash-separated numbers in operations (#612)
Closes #607
2019-03-07 18:14:12 -08:00
Natalie Weizenbaum
e84c8b1995
Don't put style rules inside empty @keyframes rules (#613)
Closes #611
2019-03-07 17:04:30 -08:00
Natalie Weizenbaum
8ab9ce1141
Deprecate assignment to non-existent global variables (#601)
See #600
See sass/sass#2606
2019-02-21 15:16:52 -08:00
Natalie Weizenbaum
149bf85b4d
Explicitly mark classes as sealed (#602) 2019-02-20 16:39:46 -08:00
Natalie Weizenbaum
26401fb135
Fix an attribute selector quoting bug (#599)
Closes #598
2019-02-20 13:38:21 -08:00
Natalie Weizenbaum
7ca989a4f7
Produce a better error for invalid function contents (#587)
Closes #584
2019-02-04 13:14:25 -08:00
Natalie Weizenbaum
a81017275a
Produce a better error message for unclosed style rules (#586)
Closes #577
2019-02-01 17:21:15 -08:00
Natalie Weizenbaum
b102dc496a
Allow individual directories to be passed on the command-line (#581)
Closes #543
2019-02-01 14:59:58 -08:00
Natalie Weizenbaum
cd3b82e2be
Fix a check for adjusting parse errors (#582) 2019-02-01 14:55:34 -08:00
Natalie Weizenbaum
e8ac314f56
Support dart-lang/source_span#25 (#566)
This adds a --no-unicode option to disable Unicode span rendering,
decouples repl highlighting from SourceSpan.highlight, and updates
tests to work with the new error highlighting.

It also tightly scopes source spans for statements with children.
Previously, source spans for these nodes extended all the way through
any whitespace that followed the node. This led to messy-looking
multiline span highlights with dart-lang/source_span#25.

Now, StylesheetParser.children doesn't consume trailing whitespace.
Instead, we add a helper method StylesheetParser._withChildren that
parses children, creates the appropriate span, and then consumes the
trailing whitespace.
2019-01-28 20:42:32 -05:00
Natalie Weizenbaum
9fdf5612ea
Fix a performance bug in BinaryOperatorExpression.span (#569)
Previously, evaluator called BinaryOperationExpression.span for each
binary operation it evaluated, which in turn called spanForList() to
create a span covering both child expressions. spanForList() then
called .span for both the left and right child operations *twice*,
leading to exponential behavior.

This is now avoided in three complementary ways:

1. The evaluator avoids eagerly calling AstNode.span, instead keeping
   the original AstNode until the span itself needs to be accessed.
   This means that a span will only be accessed when an error actually
   occurs, and then only one operation's span will be accessed.

2. BinaryOperationExpression.span now iterates through any child
   operations before calling their .span methods, so it only performs
   O(1) allocations.

3. spanForList() now only calls each AstNode.span once.
2019-01-17 18:04:14 -05:00
Natalie Weizenbaum
55ebe56d3c
Add support for new special number strings (#556)
See sass/sass#2584
2019-01-09 15:50:04 -05:00
Natalie Weizenbaum
32be730b6e
Emit tab characters as \9 (#553)
Closes #552
2019-01-04 14:20:28 -05:00
Natalie Weizenbaum
18c0cbdaea
Match Node Sass's this.includePaths behavior for importers (#551)
On Windows, paths are separated with a semicolon rather than a colon.

Closes #549
2019-01-03 10:48:20 -08:00
Natalie Weizenbaum
759b587364
Don't omit units in numbers in compressed mode (#545)
See https://github.com/sass/sass/issues/649#issuecomment-447033060
2019-01-03 10:47:54 -08:00
Natalie Weizenbaum
06b9fbd812
Merge branch 'master' into windows-path-separator 2018-12-26 14:17:45 -08:00