Skip to content

feat(es/parser, es/transform): Implement ergonomic brand checking #2079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 105 commits into from
Sep 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
169ba57
Start
kdy1 Aug 14, 2021
c076cc7
Add a module
kdy1 Aug 14, 2021
d9b0ae9
Add fixtures
kdy1 Aug 14, 2021
e436762
Basic form
kdy1 Aug 14, 2021
c4c62a1
WIP: Options
kdy1 Aug 14, 2021
ce9bc5d
Dep
kdy1 Aug 14, 2021
69a5bac
Print option on parsing error
kdy1 Aug 14, 2021
3d0516e
Parse test options
kdy1 Aug 14, 2021
97008ff
Improve test system
kdy1 Aug 14, 2021
ceec55b
Add `EsConfig.private_in_object`
kdy1 Aug 18, 2021
ee0908e
Fix parser
kdy1 Aug 18, 2021
093ffe7
Enable parser feature
kdy1 Aug 18, 2021
6298ae5
Disable assumption tests
kdy1 Aug 24, 2021
59197f1
More pass
kdy1 Aug 24, 2021
0767a1f
WIP: Brand check form class properties pass
kdy1 Aug 24, 2021
b9a19ab
Pre-calc statics
kdy1 Aug 24, 2021
8d0bae5
Brand-check
kdy1 Aug 24, 2021
8ae0f6c
More work for privaet methods
kdy1 Aug 24, 2021
513f6af
Update test refs
kdy1 Aug 24, 2021
32e8bda
More check for private methods
kdy1 Aug 24, 2021
e3b632e
Update test refs
kdy1 Aug 24, 2021
8b32cb1
Handle class name
kdy1 Aug 24, 2021
9241c8a
Update test refs
kdy1 Aug 24, 2021
bdf9580
Update test refs
kdy1 Aug 24, 2021
0c7a7da
Update test refs
kdy1 Aug 24, 2021
0f568c0
Update test refs
kdy1 Aug 24, 2021
04bc68f
Handle static
kdy1 Aug 24, 2021
7e9ea32
Update test refs
kdy1 Aug 24, 2021
277ca88
Remove options.json
kdy1 Aug 24, 2021
83fc006
Optimize static methods
kdy1 Aug 24, 2021
b9ae2df
Move test definitions
kdy1 Aug 25, 2021
f1b4f72
WIP: private_in_object
kdy1 Aug 25, 2021
e0e7123
Use marker
kdy1 Aug 25, 2021
304b170
More field
kdy1 Aug 25, 2021
5ae7b93
Fill more info
kdy1 Aug 25, 2021
b892ced
inject vars
kdy1 Aug 25, 2021
aed16db
Fix tester
kdy1 Aug 25, 2021
b003ede
Fix var injection
kdy1 Aug 25, 2021
a59a136
More work for brand checking
kdy1 Aug 25, 2021
78f3ce8
`new WeakSet()`
kdy1 Aug 25, 2021
8ec9c37
Add a field for constructor injection
kdy1 Aug 25, 2021
7591cb0
Consturctor injection
kdy1 Aug 25, 2021
a0fe6f1
Inject expressions into consturctor
kdy1 Aug 25, 2021
4d1796b
Update test refs
kdy1 Aug 25, 2021
8280791
Handle statics
kdy1 Aug 25, 2021
f9c0843
More check
kdy1 Aug 25, 2021
0187963
Update test refs
kdy1 Aug 25, 2021
ffbb7ee
Update test refs
kdy1 Aug 25, 2021
2cc6383
Update test refs
kdy1 Aug 25, 2021
49305bc
Reduce clone
kdy1 Aug 25, 2021
70c4a86
Inject vars at correct level
kdy1 Aug 25, 2021
212860f
Collect names used for brand checking
kdy1 Aug 25, 2021
588e0ea
fixup
kdy1 Aug 25, 2021
a1eb164
Handle private properties without init
kdy1 Aug 25, 2021
6e38613
Skip expr injection for private properties
kdy1 Aug 25, 2021
19a12c1
Update test refs
kdy1 Aug 25, 2021
7309520
Handle private properties
kdy1 Aug 25, 2021
9a2126f
fixup
kdy1 Aug 25, 2021
c945bf0
Update test refs
kdy1 Aug 25, 2021
33cc568
Update test refs
kdy1 Aug 25, 2021
6b0879f
We need lifetime
kdy1 Aug 30, 2021
c470ce9
Revert "We need lifetime"
kdy1 Aug 30, 2021
146112d
WIP: Common interface
kdy1 Aug 30, 2021
fc7e4e0
Move some duplicates
kdy1 Aug 30, 2021
b06bb24
WIP: prepend_exprs
kdy1 Aug 30, 2021
4f7345c
Handle prepend_exprs
kdy1 Aug 30, 2021
e9ba223
Update test refs
kdy1 Aug 30, 2021
dfa1728
Update test refs
kdy1 Aug 30, 2021
cc3fa10
Deps
kdy1 Aug 30, 2021
3d8d4de
Handle arrow body
kdy1 Aug 30, 2021
2a09898
Revert wrong code
kdy1 Aug 30, 2021
088a94d
Fix fast path
kdy1 Aug 30, 2021
f9d9c1b
Update test refs
kdy1 Aug 30, 2021
562c420
codegen: Pat::Invalid
kdy1 Aug 30, 2021
fe7e963
Fix fixer
kdy1 Aug 30, 2021
d360d2b
Handle default pat
kdy1 Aug 30, 2021
3a8ab0b
Update test refs
kdy1 Aug 30, 2021
97665a8
Fix codegen
kdy1 Sep 9, 2021
8a91a15
fixup
kdy1 Sep 9, 2021
87d8ae7
Update test refs
kdy1 Sep 27, 2021
3655b36
static method
kdy1 Sep 27, 2021
7ee7046
Update test refs
kdy1 Sep 27, 2021
f192457
Class properties is done
kdy1 Sep 27, 2021
dc4727f
Update test refs
kdy1 Sep 27, 2021
36bf01d
Remove typescript_class_properties
kdy1 Sep 27, 2021
87bfbe7
preset-env
kdy1 Sep 27, 2021
74ecccc
tests
kdy1 Sep 27, 2021
6524af2
Tests
kdy1 Sep 27, 2021
1201aaa
fixup
kdy1 Sep 27, 2021
104745e
loose
kdy1 Sep 27, 2021
8819fa9
Ignore loose tests
kdy1 Sep 27, 2021
900a124
lint
kdy1 Sep 27, 2021
c1add5a
Add to swc
kdy1 Sep 27, 2021
b992626
nested
kdy1 Sep 27, 2021
09a56f5
Update test refs
kdy1 Sep 27, 2021
0edf54c
Update test refs
kdy1 Sep 27, 2021
118c39b
Update test refs
kdy1 Sep 27, 2021
5f46aa4
Update test refs
kdy1 Sep 27, 2021
affe9a1
methods
kdy1 Sep 27, 2021
b097f6f
Update test refs
kdy1 Sep 27, 2021
885f83e
Bump version
kdy1 Sep 27, 2021
04a5cab
Bump version
kdy1 Sep 27, 2021
1cdaac4
Fix parser
kdy1 Sep 27, 2021
40b9120
Update test refs
kdy1 Sep 27, 2021
03fb28f
Update test refs
kdy1 Sep 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 26 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc"
repository = "https://github.com/swc-project/swc.git"
version = "0.56.1"
version = "0.57.0"

[lib]
name = "swc"
Expand Down Expand Up @@ -53,27 +53,27 @@ serde = {version = "1", features = ["derive"]}
serde_json = "1"
sourcemap = "6"
swc_atoms = {version = "0.2", path = "./atoms"}
swc_bundler = {version = "0.59.0", path = "./bundler"}
swc_bundler = {version = "0.60.0", path = "./bundler"}
swc_common = {version = "0.12.1", path = "./common", features = ["sourcemap", "concurrent"]}
swc_ecma_ast = {version = "0.52.0", path = "./ecmascript/ast"}
swc_ecma_codegen = {version = "0.70.2", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.28.1", path = "./ecmascript/ext-transforms"}
swc_ecma_codegen = {version = "0.71.0", path = "./ecmascript/codegen"}
swc_ecma_ext_transforms = {version = "0.29.0", path = "./ecmascript/ext-transforms"}
swc_ecma_loader = {version = "0.18.1", path = "./ecmascript/loader", features = ["lru", "node", "tsc"]}
swc_ecma_minifier = {version = "0.28.0", path = "./ecmascript/minifier"}
swc_ecma_parser = {version = "0.70.2", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.43.0", path = "./ecmascript/preset-env"}
swc_ecma_transforms = {version = "0.72.0", path = "./ecmascript/transforms", features = [
swc_ecma_minifier = {version = "0.29.0", path = "./ecmascript/minifier"}
swc_ecma_parser = {version = "0.71.0", path = "./ecmascript/parser"}
swc_ecma_preset_env = {version = "0.44.0", path = "./ecmascript/preset-env"}
swc_ecma_transforms = {version = "0.73.0", path = "./ecmascript/transforms", features = [
"compat",
"module",
"optimization",
"proposal",
"react",
"typescript",
]}
swc_ecma_transforms_base = {version = "0.31.1", path = "./ecmascript/transforms/base"}
swc_ecma_transforms_base = {version = "0.32.0", path = "./ecmascript/transforms/base"}
swc_ecma_utils = {version = "0.44.2", path = "./ecmascript/utils"}
swc_ecma_visit = {version = "0.38.1", path = "./ecmascript/visit"}
swc_ecmascript = {version = "0.64.0", path = "./ecmascript"}
swc_ecmascript = {version = "0.65.0", path = "./ecmascript"}
swc_visit = {version = "0.2.3", path = "./visit"}

[dev-dependencies]
Expand Down
10 changes: 5 additions & 5 deletions bundler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"]
license = "Apache-2.0/MIT"
name = "swc_bundler"
repository = "https://github.com/swc-project/swc.git"
version = "0.59.0"
version = "0.60.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
Expand All @@ -34,10 +34,10 @@ retain_mut = "0.1.2"
swc_atoms = {version = "0.2.4", path = "../atoms"}
swc_common = {version = "0.12.0", path = "../common"}
swc_ecma_ast = {version = "0.52.0", path = "../ecmascript/ast"}
swc_ecma_codegen = {version = "0.70.2", path = "../ecmascript/codegen"}
swc_ecma_codegen = {version = "0.71.0", path = "../ecmascript/codegen"}
swc_ecma_loader = {version = "0.18.1", path = "../ecmascript/loader"}
swc_ecma_parser = {version = "0.70.2", path = "../ecmascript/parser"}
swc_ecma_transforms = {version = "0.72.0", path = "../ecmascript/transforms", features = ["optimization"]}
swc_ecma_parser = {version = "0.71.0", path = "../ecmascript/parser"}
swc_ecma_transforms = {version = "0.73.0", path = "../ecmascript/transforms", features = ["optimization"]}
swc_ecma_utils = {version = "0.44.2", path = "../ecmascript/utils"}
swc_ecma_visit = {version = "0.38.1", path = "../ecmascript/visit"}

Expand All @@ -46,7 +46,7 @@ hex = "0.4"
ntest = "0.7.2"
reqwest = {version = "0.11.4", features = ["blocking"]}
sha-1 = "0.9"
swc_ecma_transforms = {version = "0.72.0", path = "../ecmascript/transforms", features = ["react", "typescript"]}
swc_ecma_transforms = {version = "0.73.0", path = "../ecmascript/transforms", features = ["react", "typescript"]}
tempfile = "3.1.0"
testing = {version = "0.13.0", path = "../testing"}
url = "2.1.1"
Expand Down
14 changes: 7 additions & 7 deletions ecmascript/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecmascript"
repository = "https://github.com/swc-project/swc.git"
version = "0.64.0"
version = "0.65.0"

[package.metadata.docs.rs]
all-features = true
Expand All @@ -33,12 +33,12 @@ typescript = ["typescript-parser", "swc_ecma_transforms/typescript"]

[dependencies]
swc_ecma_ast = {version = "0.52.0", path = "./ast"}
swc_ecma_codegen = {version = "0.70.2", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.39.1", path = "./dep-graph", optional = true}
swc_ecma_minifier = {version = "0.28.0", path = "./minifier", optional = true}
swc_ecma_parser = {version = "0.70.2", path = "./parser", optional = true, default-features = false}
swc_ecma_preset_env = {version = "0.43.0", path = "./preset-env", optional = true}
swc_ecma_transforms = {version = "0.72.0", path = "./transforms", optional = true}
swc_ecma_codegen = {version = "0.71.0", path = "./codegen", optional = true}
swc_ecma_dep_graph = {version = "0.40.0", path = "./dep-graph", optional = true}
swc_ecma_minifier = {version = "0.29.0", path = "./minifier", optional = true}
swc_ecma_parser = {version = "0.71.0", path = "./parser", optional = true, default-features = false}
swc_ecma_preset_env = {version = "0.44.0", path = "./preset-env", optional = true}
swc_ecma_transforms = {version = "0.73.0", path = "./transforms", optional = true}
swc_ecma_utils = {version = "0.44.2", path = "./utils", optional = true}
swc_ecma_visit = {version = "0.38.1", path = "./visit", optional = true}

Expand Down
2 changes: 1 addition & 1 deletion ecmascript/babel/compat/benches/babelify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn babelify_only(b: &mut Bencher) {
let module = c.run_transform(&handler, false, || {
module
.fold_with(&mut typescript::strip())
.fold_with(&mut es2020())
.fold_with(&mut es2020(Default::default()))
});

b.iter(|| {
Expand Down
4 changes: 2 additions & 2 deletions ecmascript/codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"]
license = "Apache-2.0/MIT"
name = "swc_ecma_codegen"
repository = "https://github.com/swc-project/swc.git"
version = "0.70.5"
version = "0.71.0"

[dependencies]
bitflags = "1"
Expand All @@ -17,7 +17,7 @@ swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.12.0", path = "../../common"}
swc_ecma_ast = {version = "0.52.0", path = "../ast"}
swc_ecma_codegen_macros = {version = "0.5.2", path = "./macros"}
swc_ecma_parser = {version = "0.70.2", path = "../parser"}
swc_ecma_parser = {version = "0.71.0", path = "../parser"}

[dev-dependencies]
swc_common = {version = "0.12.0", path = "../../common", features = ["sourcemap"]}
Expand Down
4 changes: 2 additions & 2 deletions ecmascript/dep-graph/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_dep_graph"
repository = "https://github.com/swc-project/swc.git"
version = "0.39.1"
version = "0.40.0"

[dependencies]
swc_atoms = {version = "0.2", path = "../../atoms"}
Expand All @@ -15,5 +15,5 @@ swc_ecma_ast = {version = "0.52.0", path = "../ast"}
swc_ecma_visit = {version = "0.38.1", path = "../visit"}

[dev-dependencies]
swc_ecma_parser = {version = "0.70.2", path = "../parser"}
swc_ecma_parser = {version = "0.71.0", path = "../parser"}
testing = {version = "0.13.0", path = "../../testing"}
4 changes: 2 additions & 2 deletions ecmascript/ext-transforms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/swc_ecma_ext_transforms/"
edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_ecma_ext_transforms"
version = "0.28.1"
version = "0.29.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -14,6 +14,6 @@ phf = {version = "0.8.0", features = ["macros"]}
swc_atoms = {version = "0.2", path = "../../atoms"}
swc_common = {version = "0.12.0", path = "../../common"}
swc_ecma_ast = {version = "0.52.0", path = "../ast"}
swc_ecma_parser = {version = "0.70.2", path = "../parser"}
swc_ecma_parser = {version = "0.71.0", path = "../parser"}
swc_ecma_utils = {version = "0.44.2", path = "../utils"}
swc_ecma_visit = {version = "0.38.1", path = "../visit"}
Loading