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
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
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
* Move Node tests on Windows to Travis
Appveyor is flaky and can't be restarted by all team members, so moving
everything to Travis is preferable if we can get it to work.
* Actually use latest stable Node
This should also workaround the issue with lts/* not working on
Windows.
* Use npm.cmd instead of raw npm on Windows
* Use p.prettyUri() for Node API tests
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
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.
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.
This combines all targets into a single extender invocation, which is
more efficient and allows it to more aggressively do redundant
selector elimination.
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
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.