Commit Graph

131 Commits

Author SHA1 Message Date
Natalie Weizenbaum
80afdd88f8 Run in Dart 2 runtime mode everywhere 2018-11-14 13:53:53 -08:00
Natalie Weizenbaum
77563be056
Add support for SASS_PATH (#514)
Closes #512
2018-11-05 15:24:14 -08: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
a25bbb3fc7
Add a ParenthesizedExpression class (#503)
This allows us to accurately track the source spans for parenthesized
expressions, which in turn allows us to print accurate error
indications.

Adding a new class for this more accurately represents the structure
of the expression, but it also involves an extra allocation during
parsing and an extra level of nesting during evaluation which could
have a small but real performance impact.

We could alternatively add a package-internal setter for
Expression.span, and update the source span for parenthesized
expressions after they're initially parsed. However, this has its own
downsides: it adds complexity and mutability to the object model; and
many expression classes currently use lazily-generated spans, so
making them settable would require adding extra slots on those
classes.

I decided to go with the extra class because it only adds overhead
when parentheses are actually used in practice, as opposed to adding
overhead to every list/color/etc. The runtime overhead is also likely
to be mitigated if at any point we add a constant-folding step.
2018-10-17 16:52:32 -07:00
Jen Thakar
9a1f322d7f Remove space around combinators in compressed mode (#494)
Complex selectors like "a > b" will now be output as "a>b" in
compressed mode.
2018-10-11 18:03:09 -07:00
Natalie Weizenbaum
0595ac3e71
Fix an import-resolution bug (#488)
When a stylesheet is imported, the parsed stylesheet object is cached
based on its canonical URL. However, the stylesheet.span.sourceUrl was
based on the text of the import that was used to load that stylesheet.
The idea was to make the source URL in stack traces look nicer, but it
meant that relative URLs could be resolved based on the old importer's
URL before being sent to the new importer, which caused bugs.

Now stylesheet.span.sourceUrl is always the canonical URL of the
stylesheet, and thus safe to cache. We then use the import cache to
convert the canonical URL to a human-friendly URL at the point at
which we generate stack traces.

This also deprecates support for relative canonical URLs. The
semantics of these URLs were always unclear, and with the new change
in import internals the old behavior doesn't make much sense. It's
preserved for backwards-compatibility, but deprecated.
2018-10-11 15:06:26 -07:00
Natalie Weizenbaum
0620ccc19a
Fix @debug on stdin (#493) 2018-10-10 15:05:23 -07:00
Natalie Weizenbaum
04ada09a82
Get rid of the dart2 test tag (#477)
We're only ever running tests under Dart 2 now, so it's irrelevant
whether they're Dart 2-only.
2018-09-19 15:28:47 -04:00
Natalie Weizenbaum
1a5eb2a2e3
Fix embedding source maps with non-ASCII characters (#471)
Closes #457
2018-09-11 12:13:43 -07:00
Natalie Weizenbaum
ede9c81e0b
Properly adjust source maps when prepending encoding information (#470)
Closes #469
2018-09-10 15:38:30 -07:00
Natalie Weizenbaum
3346c7974a
Fix analysis hints (#450) 2018-08-15 12:43:55 -07:00
Natalie Weizenbaum
d1bb4a0d6d
Allow a BOM at the beginning of a document (#441)
This was only breaking in JS because apparently dart:io automatically
filters out BOMs.

Closes #437
2018-08-10 16:31:15 -07:00
Natalie Weizenbaum
0f7f9e69a7
Add support for plain CSS imports (#436)
Closes #424
2018-08-10 15:58:15 -07:00
Natalie Weizenbaum
8bffd52729
Don't hang after a syntax error in --watch (#435)
Closes #401
2018-08-03 15:38:16 -07:00
Natalie Weizenbaum
13b8ad6d4d Format 2018-07-23 16:57:21 -07:00
Natalie Weizenbaum
e1750216ee Don't crash when passing includePaths with importer
Closes #412
2018-07-23 16:20:06 -07:00
Natalie Weizenbaum
9bb272dcff
Support Node Sass's sass.types.Color(argb) constructor (#398)
Closes #397
2018-07-03 17:09:54 -07:00
Natalie Weizenbaum
96c46a242e
Add a --stop-on-error flag (#391)
Closes #264
2018-06-29 18:12:36 -07:00
Michael R Fairhurst
cd275705cd Fix places awaiting void, for dart 2 (#393) 2018-06-29 13:20:26 -07:00
Natalie Weizenbaum
425305725b
Add a --poll option (#390)
Partially addresses #264.
2018-06-28 18:20:28 -07:00
Natalie Weizenbaum
c462b82102 Run snapshots in Dart 1 mode
Until dart-lang/sdk#33257 is fixed, this ensures that users get as
much performance as possible.
2018-06-27 15:51:16 -07:00
Natalie Weizenbaum
ecc04665cf
Fix a couple more Grinder invocations (#387) 2018-06-27 14:32:44 -07:00
Natalie Weizenbaum
7e6f03fc18
Run the Dart CLI tests from app snapshots on CI (#383)
This substantially speeds up the test time, and once we re-enable Dart
2 support is should work around dart-lang/sdk#33257.
2018-06-27 13:12:16 -07:00
Natalie Weizenbaum
39eeeb51ef
Add a missing _ignoreErrors() call in StylesheetGraph (#377)
We weren't ignoring errors when reloading a file, which meant that
syntax errors would get surfaced in the wrong place and cause a crash.

Closes #359
2018-06-26 20:10:46 -07:00
Natalie Weizenbaum
a87300a1e9 Use camel-case for grinder task names
This also causes Grinder to use hyphen-separated names for them on the
CLI, rather than underscore-separated.
2018-06-25 16:40:26 -07:00
Natalie Weizenbaum
87e568faa4
Fix a bug where we were setting the base URL of stylesheets wrong (#370)
Closes #369
2018-06-20 17:43:40 -07:00
Natalie Weizenbaum
6693a82f3b
Use the latest test_descriptor features to clean up tests (#366) 2018-06-19 17:50:49 -07:00
Natalie Weizenbaum
fdbccc8625
Ensure that source map comment URLs are relative to the CSS file (#365)
Closes #364
2018-06-19 17:50:37 -07:00
Natalie Weizenbaum
61eea4abd8
Format with the latest formatter version (#363) 2018-06-19 12:46:24 -07:00
Natalie Weizenbaum
c5071ef843 Stop using a deprecated API 2018-06-15 13:59:28 -07:00
Natalie Weizenbaum
c626bf5613 Remove casts that are now unnecessary 2018-06-15 13:59:28 -07:00
Natalie Weizenbaum
b949f9fe72 Use Dart 2 constants 2018-06-15 13:59:28 -07:00
Natalie Weizenbaum
7a2d724cc9 Use of() constructors instead of from() 2018-06-14 16:15:27 -07:00
Natalie Weizenbaum
6ad67a6f28 Remove the workaround for dart-lang/sdk#30098
This un-reverts pull request #320 from sass/remove-path-workaround,
which was reverted by commit 0fb5d25ee2.
2018-06-14 16:15:27 -07:00
Natalie Weizenbaum
f074152f61 Add a tick in a test that's failing on Windows 2018-06-13 16:42:10 -07:00
Natalie Weizenbaum
0519163ae3 Use the standard tick helper rather than a custom sleep 2018-06-13 16:41:29 -07:00
Natalie Weizenbaum
5efa7bf48a Normalize path separators in watch test expectations 2018-06-13 16:41:29 -07:00
Natalie Weizenbaum
6bbb961675 Add a --watch command
Partially addresses #264
2018-06-09 14:13:36 -04:00
Natalie Weizenbaum
3362273c29 Disallow --update and --watch with --interactive 2018-06-09 14:09:20 -04:00
Natalie Weizenbaum
594f936c54 Fix an edge-case bug
If a non-partial stylesheet is next to a partial with the same name,
canonicalizing the source URL would fail. We don't really need to
canonicalize that URL anyway, though, since it's only used for import
loops and such a loop will reload and rerun the entrypoint anyway.
2018-06-08 20:28:38 -04:00
Natalie Weizenbaum
0a21fb7063 Make sure --update surfaces failures properly 2018-06-08 20:28:38 -04:00
Natalie Weizenbaum
b9e1585cf6
Add a helper function for update tests (#348) 2018-06-07 09:54:18 -04:00
Natalie Weizenbaum
c26903e30e
Don't consider drive separators to be path-separating colons (#342)
Closes #340
2018-05-31 20:38:45 -04:00
Natalie Weizenbaum
0fb5d25ee2 Revert "Merge pull request #320 from sass/remove-path-workaround"
This reverts commit 08bfb46f16, reversing
changes made to ad73a91f84.
2018-05-31 14:37:21 -04:00
Natalie Weizenbaum
8435be5f4b Style tweaks 2018-05-30 18:59:49 -04:00
Natalie Weizenbaum
1d7b0aa5ad Merge branch 'master' into jathak-interactive 2018-05-30 18:41:15 -04:00
Natalie Weizenbaum
8e97e66426 Remove unused test/cli_shared.dart
[skip ci]
2018-05-30 18:37:55 -04:00
Natalie Weizenbaum
0c637b2e6a
Split CLI tests into multiple suites (#337) 2018-05-30 18:35:35 -04:00
Natalie Weizenbaum
d4655f22bd
Fix an Importer-calling bug (#338)
We were resolving URLs relative to the canonical URL rather than the
original URL, which broke importers for which those were different,
like the package importer.

Closes #334
2018-05-30 17:47:37 -04:00
Jen Thakar
930f361026 Merge branch 'master' of git://github.com/sass/dart-sass into interactive 2018-05-29 21:33:53 -07:00