Commit Graph

1413 Commits

Author SHA1 Message Date
Matt Felten
923615a7f8 Fix "compound selectors may *no* longer be extended" error message (#576) 2019-01-25 20:52:05 -05:00
Natalie Weizenbaum
d1fcdbec75
Merge pull request #578 from sass/css-refactor
Split the CSS AST into mutable and immutable variants
2019-01-25 17:24:49 -05:00
Natalie Weizenbaum
d3c3a3d515 Delete ModifiableCssNode.modifyChildren
Instead of doing this, we now construct a new (unmodifiable)
CssStylesheet if additional imports need to be added.
2019-01-24 16:25:37 -08:00
Natalie Weizenbaum
93f4876b28 Split the CSS AST into mutable and immutable variants
This codifies in types the constraint that only the evaluator should
modify CSS nodes. It also makes it possible to create non-mutable
classes that don't need to care about stuff like tracking parent nodes.
2019-01-24 15:59:39 -08: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
b0242767ee
Temporarily limit source_span to 1.4.x (#570)
Getting all the tests update and the output looking nice is proving
more difficult than expected, and I want to unblock other pull
requests for Dart Sass in the meantime.
2019-01-15 03:02:06 -05:00
Natalie Weizenbaum
3368e890cd
Add a grind script to sanity-check a release (#563)
Add a grind script to sanity-check a release

This will help avoid accidentally releasing dev versions 😖.
2019-01-09 19:45:27 -05:00
Natalie Weizenbaum
e3ae4705f1
Release 1.16.0 (#562) 2019-01-09 19:18:45 -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
12f53f5e1c
Release 1.15.3 (#561) 2019-01-04 15:32:45 -05:00
Natalie Weizenbaum
32be730b6e
Emit tab characters as \9 (#553)
Closes #552
2019-01-04 14:20:28 -05:00
Natalie Weizenbaum
7a75b7b786
Don't canonicalize file case in source maps (#541)
Closes #540
2019-01-04 14:17:18 -05:00
Nicholas Shahan
948fe17a53
Remove unused import (#559)
Originally added in #548 but after changes during review it is no longer needed.
2019-01-03 15:36:05 -08: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
dbda396401
Compile to JS with -O4 (#555)
Closes #526
2019-01-03 10:47:12 -08:00
Natalie Weizenbaum
06b9fbd812
Merge branch 'master' into windows-path-separator 2018-12-26 14:17:45 -08:00
Natalie Weizenbaum
9f2f11682e
Merge pull request #546 from sass/source-map-urls
Properly use ImportResult.sourceMapUrl for source map URLs
2018-12-20 17:39:28 -08:00
Natalie Weizenbaum
7ae11f1c0e Make synchronize_test draw from the canonical list of synced files 2018-12-20 16:22:43 -08:00
Natalie Weizenbaum
23968148d0 Properly use ImportResult.sourceMapUrl for source map URLs
This also uses data: URLs to refer to stylesheets from stdin in source
maps.
2018-12-20 16:22:43 -08:00
Nicholas Shahan
3a493f23ab
Add documentation comment collection to AST (#548)
- Documentation comments are simply identified by starting with a triple-slash "///". 
- Adjacent comments in indented syntax are now coalesced into a single comment.
2018-12-20 16:08:26 -08:00
Natalie Weizenbaum
9d6de5af23 Add a missing import 2018-12-17 15:52:49 -08:00
Natalie Weizenbaum
519bfa3d6b Match Node Sass's this.includePaths behavior for importers
On Windows, paths are separated with a semicolon rather than a colon.

Closes #549
2018-12-17 15:30:17 -08:00
Natalie Weizenbaum
94fd7e6e50
Match Ruby Sass's number behavior (#544)
This introduces two changes:

1. It changes the epsilon within which two numbers are considered
   equal to be an order of magnitude smaller than the numeric
   precision. Ruby Sass has always done this, and Dart Sass should
   have but did not until now.

2. It parses the component of a number after the decimal point using
   double.parse() to avoid accumulating floating point errors.
2018-12-13 15:27:08 -08:00
Natalie Weizenbaum
fa29e80d29
Merge pull request #542 from sass/compile-refactor
Move some compilation logic from the executable to compile.dart
2018-12-13 11:58:46 -08:00
Natalie Weizenbaum
a09a62538e Remove extra importer parameters from internal compile functions
These can be passed as an ImportCache now, so they make the API more
confusing for relatively little benefit.

This also changes the const AsyncImportCache.none field to a non-const
AsyncImportCache.none() constructor. The const field didn't make sense
for a couple reasons: first, it wouldn't use a user's custom logger;
and second, it couldn't cache any relative imports, which were still
possible when the initial file was loaded from disk.
2018-12-12 15:54:32 -08:00
Natalie Weizenbaum
4c2d3af3b0 Move some compilation logic from the executable to compile.dart 2018-12-11 00:12:27 -08:00
Natalie Weizenbaum
56247975ed Automatically synchronize lib/src/compile.dart 2018-12-10 17:39:21 -08:00
Natalie Weizenbaum
f3db1d6a66
Properly merge "all and" media queries (#539)
Closes #537
2018-12-10 13:13:19 -08:00
Natalie Weizenbaum
cc009fb235
Update the Chocolatey push URL (#538) 2018-12-06 17:08:59 -08:00
Natalie Weizenbaum
dad8491035
Make types.String.prototype.setValue() de-quote a string (#535)
Closes #513
2018-12-06 15:06:32 -08:00
Natalie Weizenbaum
f914c39067
Fix pushing to Bazel again (#531)
With #506, we're pushing the master branch to the Bazel repo. But
we're actually committing to a detached HEAD, rather than the master
branch. This pushes the current HEAD instead.

Closes bazelbuild/rules_sass#61
2018-11-19 16:38:15 -08:00
Natalie Weizenbaum
aa52cf1474
Always add quotes to attribute selector values that begin with -- (#529)
Closes #527
2018-11-16 13:51:36 -08:00
Natalie Weizenbaum
d4adea7569
Merge pull request #528 from sass/dart-2-everywhere
Enable support for Dart 2.1
2018-11-16 13:07:35 -08:00
Natalie Weizenbaum
487e5025ff Reformat with Dart-2-only features 2018-11-15 15:16:24 -08:00
Natalie Weizenbaum
5d885e6905 Enforce non-whitespace formatting rules 2018-11-14 13:53:55 -08:00
Natalie Weizenbaum
80afdd88f8 Run in Dart 2 runtime mode everywhere 2018-11-14 13:53:53 -08:00
Natalie Weizenbaum
0aca829515
Merge pull request #525 from sass/color-4-rgb-hsl
Add support for CSS Color Level 4 rgb() and hsl() syntax
2018-11-14 13:37:13 -08:00
Natalie Weizenbaum
50efdabcce Add support for CSS Color Level 4 rgb() and hsl() syntax
Closes #497
2018-11-12 16:33:54 -08:00
Natalie Weizenbaum
e0c328576b Track slash-separated numbers as numbers rather than strings
This will allow us to refer to them as numbers in functions that use
the slash as an argument separator.
2018-11-12 14:49:24 -08:00
Natalie Weizenbaum
13006e9902
Clamp saturation and lightness rather than throwing errors (#521)
This matches Ruby Sass's behavior.
2018-11-12 14:25:40 -08:00
Natalie Weizenbaum
4520b8b53b
Don't trim escaped whitespace (#523)
Related to sass/ruby-sass#96
2018-11-08 11:54:59 -08:00
Natalie Weizenbaum
1206761da4
Add support for passing arguments to @content blocks (#518)
Closes #498
2018-11-05 16:53:43 -08:00
Natalie Weizenbaum
8f86d6d157
Remove the ignoreCase flag from scanIdentifier and expectIdentifier (#517)
This flag wasn't being respected, so all of these identifiers were de
facto case-insensitive. Changing that now would be breaking, and it's
probably better to make them case-insensitive anyway since CSS
identifiers are.
2018-11-05 16:28:10 -08:00
Natalie Weizenbaum
77563be056
Add support for SASS_PATH (#514)
Closes #512
2018-11-05 15:24:14 -08:00
Natalie Weizenbaum
e0c1895712
Make sure RecursiveStatementVisitor visits AtRule.name (#516)
I missed this as part of #509. It doesn't actually cause any problems,
because we don't use the expression-visiting functionality, but it
could cause issues for the linter.
2018-11-05 15:23:58 -08:00
Natalie Weizenbaum
1a100c4864
Push both tags AND branches to the Bazel repo (#506) 2018-11-01 14:32:01 -07:00
Natalie Weizenbaum
bf71ca359d
Add support for interpolation in at-rule names (#509)
Closes #496
2018-11-01 14:31:46 -07:00
Natalie Weizenbaum
9e18b7e95b
Always include the error location in JS error messages (#511)
Always include the error location in JS error messages

I was trying to match Node Sass's behavior by having Error.formatted
property have more detail than Error.message, but our errors rely on
source snippets for context so this just ended up making them
confusing.
2018-10-31 18:13:04 -07:00
Natalie Weizenbaum
de1fcfbbe3
Fix a minor style guide violation (#508) 2018-10-31 18:12:49 -07:00