Run snapshots in Dart 1 mode

Until dart-lang/sdk#33257 is fixed, this ensures that users get as
much performance as possible.
This commit is contained in:
Natalie Weizenbaum 2018-06-25 13:51:21 -07:00
parent f9f0d0e5da
commit c462b82102
7 changed files with 11 additions and 7 deletions

View File

@ -11,4 +11,4 @@ echo "WARNING: The dart-sass executable is deprecated, use sass instead."
set SCRIPTPATH=%~dp0
set arguments=%*
"%SCRIPTPATH%\src\dart.exe" "-Dversion=SASS_VERSION" "%SCRIPTPATH%\src\sass.dart.snapshot" %arguments%
"%SCRIPTPATH%\src\dart.exe" --no-preview-dart-2 "-Dversion=SASS_VERSION" "%SCRIPTPATH%\src\sass.dart.snapshot" %arguments%

View File

@ -22,4 +22,4 @@ fi
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
path=`dirname "$(follow_links "$BASH_SOURCE")"`
exec "$path/src/dart" "-Dversion=SASS_VERSION" "$path/src/sass.dart.snapshot" "$@"
exec "$path/src/dart" --no-preview-dart-2 "-Dversion=SASS_VERSION" "$path/src/sass.dart.snapshot" "$@"

View File

@ -9,4 +9,4 @@ REM grinder package`.
set SCRIPTPATH=%~dp0
set arguments=%*
"%SCRIPTPATH%\src\dart.exe" "-Dversion=SASS_VERSION" "%SCRIPTPATH%\src\sass.dart.snapshot" %arguments%
"%SCRIPTPATH%\src\dart.exe" --no-preview-dart-2 "-Dversion=SASS_VERSION" "%SCRIPTPATH%\src\sass.dart.snapshot" %arguments%

View File

@ -18,4 +18,4 @@ follow_links() {
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
path=`dirname "$(follow_links "$0")"`
exec "$path/src/dart" "-Dversion=SASS_VERSION" "$path/src/sass.dart.snapshot" "$@"
exec "$path/src/dart" --no-preview-dart-2 "-Dversion=SASS_VERSION" "$path/src/sass.dart.snapshot" "$@"

View File

@ -8,7 +8,7 @@ executables:
dart-sass: sass
environment:
sdk: '>=1.25.0-dev.63.0 <2.0.0'
sdk: '>=1.25.0-dev.64.0 <2.0.0'
dependencies:
args: ">=1.4.0 <2.0.0"

View File

@ -50,7 +50,7 @@ Future<TestProcess> runSass(Iterable<String> arguments) {
(path) => new File(path).existsSync(),
orElse: () => p.absolute("bin/sass.dart"));
var args = ["--checked"];
var args = ["--no-preview-dart-2", "--checked"];
// Work around dart-lang/sdk#33622.
if (Platform.isWindows) args.add("--packages=${p.absolute('.packages')}");

View File

@ -19,7 +19,8 @@ bool get _is64Bit => Platform.version.contains("x64");
@Task('Build Dart script snapshot.')
snapshot() {
ensureBuild();
Dart.run('bin/sass.dart', vmArgs: ['--snapshot=build/sass.dart.snapshot']);
Dart.run('bin/sass.dart',
vmArgs: ['--no-preview-dart-2', '--snapshot=build/sass.dart.snapshot']);
}
@Task('Build a dev-mode Dart application snapshot.')
@ -34,6 +35,9 @@ releaseAppSnapshot() => _appSnapshot(release: true);
/// compiles in unchecked mode.
void _appSnapshot({@required bool release}) {
var args = [
// Don't build in Dart 2 runtime mode for now because it's substantially
// slower than Dart 1 mode. See dart-lang/sdk#33257.
'--no-preview-dart-2',
'--snapshot=build/sass.dart.app.snapshot',
'--snapshot-kind=app-jit'
];