Commit Graph

1242 Commits

Author SHA1 Message Date
Christophe Coevoet
3e231f784b
Improve the deprecation message for /-as-division (#1561)
This also changes the string representation of ParenthesizedExpression
to fix the recommendations involving them (otherwise the calc
recommendation would be an invalid one).

Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-11-30 01:43:08 +00:00
Natalie Weizenbaum
97c51d6285
Add support for the JS API value types (#1552) 2021-11-30 00:10:47 +00:00
Paul Golmann
926781b782
Add support for css empty namespace attribute selector (#1554)
Closes sass/sass#3199
2021-11-24 23:20:33 +00:00
Christophe Coevoet
681bbb2a0d
Fix equality checks for CalculationOperation (#1556) 2021-11-16 13:05:29 -08:00
Natalie Weizenbaum
55cb4fd509
Track stack traces through rethrows (#1545)
This requires a lot of manual machinery when displaying stack traces
to the user, but it should make debugging errors (especially in JS)
much easier.

Works around dart-lang/sdk#10297 using expandos.
2021-11-05 06:05:50 +00:00
Natalie Weizenbaum
756fcd3911
Fix the logger option for render() (#1538)
Closes #1533
2021-10-26 21:06:40 +00:00
Natalie Weizenbaum
435e1b2f71
Merge pull request #1535 from sass/perf
Improve performance
2021-10-20 17:21:28 -07:00
Natalie Weizenbaum
2430ac6d20 Avoid creating zone variables inside _EvaluateVisitor
Instead, we create a single zone-scoped object that's visible for the
entire lifespan of the visitor, and which exposes evaluation internals
which can be updated as direct field modifications.
2021-10-20 16:36:52 -07:00
Natalie Weizenbaum
d13a38ed19 Cache relative import results as well as absolute ones
This dramatically improves the performance of a sample app using the
Carbon design system, and should generally improve apps that have a
lot of repeated @imports of library files. It's possible we can back
this out if it's not pulling its weight once we no longer support
@import.
2021-10-20 16:36:52 -07:00
Natalie Weizenbaum
6069708a83 Cache hash codes for Sass strings and numbers
These values are often stored in maps, so caching their hash codes
seems to be net valuable.
2021-10-20 16:36:52 -07:00
Natalie Weizenbaum
0ce65fc796 Replace Susy with Carbon as a benchmark target
Neither of these support Node v16 yet, but Susy is unmaintained and
will never support it while Carbon will likely add support in the near
future.
2021-10-20 16:36:29 -07:00
Christophe Coevoet
6253da740b
Fix the parsing of scientific notation in keyframe selectors (#1510) 2021-10-20 13:15:10 -07:00
Natalie Weizenbaum
3916ff6a0c
Add support for the alertAscii flag (#1524)
See sass/sass#3056
2021-10-14 22:45:35 +00:00
Natalie Weizenbaum
1fbda21d98 Merge remote-tracking branch 'origin/main' into cli-pkg 2021-10-13 13:05:30 -07:00
Natalie Weizenbaum
aa81b12612
Automatically handle absolute URLs for FileImporters (#1527)
See sass/sass#3181
2021-10-13 02:39:39 +00:00
Natalie Weizenbaum
1e70242959 More gracefully handle unexpected errors in JS interop 2021-10-12 17:15:30 -07:00
Natalie Weizenbaum
2d56fe02df Allow PRs to be linked to sass/sass PRs 2021-10-06 16:37:56 -07:00
Natalie Weizenbaum
4379462b42 Replace FileImporterResult with a plain URL 2021-10-06 12:13:21 -07:00
Christophe Coevoet
d667843a4d
Fix the parsing of supports function in static imports (#1514) 2021-10-06 10:18:55 -07:00
Christophe Coevoet
6641459fa2
Improve the error message for invalid default namespaces (#1513) 2021-10-06 10:16:35 -07:00
Jennifer Thakar
4f67c4dd30
Fix RecursiveAstVisitor (#1525)
`visitCalculationExpression` is now properly implemented.

This also adds concrete test classes that extend `RecursiveAstVisitor`
and `RecursiveStatementVisitor` to ensure similar issues are avoided in
the future whenever new AST nodes are added.
2021-10-05 18:36:45 -07:00
Natalie Weizenbaum
c9e2f96f88
Add support for the new importer API (#1522) 2021-10-05 23:53:57 +00:00
Natalie Weizenbaum
4b0f008760
Add support for the new JS logger API (#1515)
See sass/sass#2979
2021-10-05 20:57:44 +00:00
Natalie Weizenbaum
fb180ff9f5 Update to the latest linter package and fix lints 2021-10-05 13:21:19 -07:00
Christophe Coevoet
8bade1d071
Fix typos in doc (#1480) 2021-10-04 11:16:19 -07:00
Natalie Weizenbaum
31689a3637
Add basic compile functions for the new JS API (#1503) 2021-10-02 00:35:10 +00:00
Natalie Weizenbaum
ba38c09c68
Cordon the Node Sass API off into a legacy directory (#1501) 2021-09-23 01:48:06 +00:00
Natalie Weizenbaum
8d5d586e7c
Fix interpolation lookahead for calculations (#1500)
Closes #1499
2021-09-22 07:12:16 +00:00
Natalie Weizenbaum
825fa5c7df
Add back support for min/max calculations (#1485)
See sass/sass#3142
See sass/sass#3150
2021-09-20 23:58:47 +00:00
Natalie Weizenbaum
52ef3c6ef1
Preserve parentheses around var() functions in calculations (#1489)
See sass/sass#3153
See sass/sass#3154
2021-09-16 21:58:19 +00:00
Natalie Weizenbaum
30cc9dcbfb
Allow extra whitespace in min, max, and calculations (#1483)
Closes sass/dart-sass#1444
2021-09-14 23:03:06 +00:00
Natalie Weizenbaum
7de7ab405d
Fix a parenthesizing bug in calculations (#1482)
See sass/sass#3147
See sass/sass#3148
2021-09-14 22:42:28 +00:00
Natalie Weizenbaum
5e4bc45574
Allow the + operator for calculations and strings (#1481)
See sass/sass#3142
See sass/sass#3146
2021-09-14 22:25:08 +00:00
Natalie Weizenbaum
fe46cbba1e
Improve unification of :host and :host-context (#1471)
See sass/sass#3134
2021-09-14 21:53:01 +00:00
Natalie Weizenbaum
cbdcd58676
Emergency fix: Temporarily drop support for min/max calculations (#1477)
See sass/sass#3142
See sass/sass-spec#1702
2021-09-14 08:45:05 +00:00
Natalie Weizenbaum
bb0867270c
Add support for first-class calc() (#1452)
See sass/sass#818
2021-09-13 23:16:40 +00:00
Natalie Weizenbaum
33dab9ff7e
Fix the leftover-configuration check for @forward ... with (#1472)
This check was previously checking whether *any* variables were left
in this configuration, which could include variables that were adopted
from outer configurations. This threw invalid errors when that outer
configuration would have been satisfied by another variable (or
forward) later in the file.

Closes sass/sass#1460
2021-09-09 23:51:26 +00:00
Jennifer Thakar
1672178f64
Fix @at-root bug for common case of built-in use (#1469)
`@at-root` should now work properly in a nested import as long as the
only `@use` or `@forward` rules present are for built-in modules.

This is a partial but not complete fix for #1347. It's a bit hacky to
special case built-in modules here, but since they represent the only
real legitimate case for using this combination of features, it lets us
fix the bug for this case and avoid the bordering-on-infeasible work of
fixing this for user-defined modules.
2021-09-09 16:00:05 -07:00
Jennifer Thakar
f06937e2df
Fix analysis errors (#1470) 2021-09-09 22:35:12 +00:00
Konstantin Scheglov
3112f80d49
Ignore HintCode.UNNECESSARY_TYPE_CHECK_TRUE (#1457) 2021-09-07 12:21:01 -07:00
Adam Hooper
ad886d97d6
Expose charset option in Node API [closes #567] (#1446)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
2021-09-02 00:48:11 +00:00
Natalie Weizenbaum
1615bb17d0
Add SassApiColor to the "Value" dartdoc category (#1455) 2021-08-31 00:14:14 +00:00
Natalie Weizenbaum
57ea9f1a90
Expose getters indicating which color fields a color has calculated (#1453)
These getters are only available through the sass_api package. This
will allow the Sass embedded compiler to more explicitly send the
color information it has on hand.
2021-08-28 07:37:39 +00:00
Jennifer Thakar
d419df7d9c
Add shared interfaces for various AST nodes (#1445)
Fixes #1401 and #1414.

Adds `Dependency`, `SassDeclaration`, and `SassReference` interfaces,
which expose some getters that multiple AST nodes have in common with a
single type.

These also add getters for common subspans (URL, name, and namespace) to
the interfaces.
2021-08-23 16:33:36 -07:00
Natalie Weizenbaum
67db39c352
Add a SassArgumentList.keywordsWithoutMarking getter (#1427)
This is necessary to properly forward argument list keywords to the
embedded compiler.

See sass/embedded-protocol#27
2021-08-16 23:59:03 +00:00
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
000173c132 Reformat 2021-08-11 16:14:17 -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