-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[web] Move libraries to a shared location
These libraries will be shared between the dart2js and DDC runtimes. Also renames the `shared` directory to `synced` to avoid confusion. Synced directories are copied to be in sync with the compilers and runtimes. Change-Id: Ic36076938741d7102792f09413666de0033da3a4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238300 Reviewed-by: Mayank Patke <fishythefish@google.com> Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com> Reviewed-by: Stephen Adams <sra@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com> Reviewed-by: Nate Bosch <nbosch@google.com>
- Loading branch information
Showing
29 changed files
with
95 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
file:/tools/OWNERS_WEB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Package `js_shared`: | ||
|
||
This code is a compile time dependency of dart2js and DDC. It is imported as | ||
a `package:` import by both compilers. | ||
|
||
There is an exact copy in the SDK of the libraries in the | ||
`pkg/js_shared/lib/synced` sub-directory. | ||
Those libraries are imported as `dart:` imports by the dart2js and DDC runtime | ||
libraries. | ||
|
||
*Important*: all code under `pkg/js_shared/lib/synced` must be kept in sync with | ||
the runtime (in `sdk/lib/_internal/js_shared/lib/synced`) at all times. The | ||
`test/in_sync_test.dart` test verifies this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: js_shared | ||
# This package is not intended for consumption on pub.dev. DO NOT publish. | ||
publish_to: none | ||
|
||
environment: | ||
sdk: '>=2.12.0 <3.0.0' | ||
|
||
dev_dependencies: | ||
expect: any | ||
_fe_analyzer_shared: any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
/// Test to verify that this package is in-sync with shared runtime libraries. | ||
import 'dart:io'; | ||
|
||
import 'package:_fe_analyzer_shared/src/util/relativize.dart'; | ||
import 'package:expect/expect.dart'; | ||
|
||
void main(List<String> argv) { | ||
var packageDir = Platform.script.resolve('../lib/synced/'); | ||
var sdkDir = Platform.script | ||
.resolve('../../../sdk/lib/_internal/js_shared/lib/synced/'); | ||
var rPackageDir = | ||
relativizeUri(Directory.current.uri, packageDir, Platform.isWindows); | ||
var rSdkDir = | ||
relativizeUri(Directory.current.uri, sdkDir, Platform.isWindows); | ||
|
||
for (var file in Directory.fromUri(sdkDir).listSync()) { | ||
if (file is File) { | ||
var filename = file.uri.pathSegments.last; | ||
var packageFile = File.fromUri(packageDir.resolve(filename)); | ||
Expect.isTrue( | ||
packageFile.existsSync(), | ||
"$filename not in sync. Please update it by running:\n" | ||
" cp $rSdkDir$filename $rPackageDir$filename"); | ||
var original = file.readAsBytesSync(); | ||
var copy = packageFile.readAsBytesSync(); | ||
Expect.listEquals( | ||
original, | ||
copy, | ||
"$filename not in sync. Please update it by running:\n" | ||
" cp $rSdkDir$filename $rPackageDir$filename"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters