Skip to content

Commit

Permalink
Merge branch 'main' into parser-tpl-2
Browse files Browse the repository at this point in the history
  • Loading branch information
swc-bot authored Jun 12, 2024
2 parents 1d09fd7 + 9d2e1ce commit 50a3ecd
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 19 deletions.
18 changes: 9 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@
- **(es)** Make `output` field optional ([#9033](https://github.com/swc-project/swc/issues/9033)) ([39654bf](https://github.com/swc-project/swc/commit/39654bf1e7136077d2db2f85a93591708b4cfe8c))


- **(es/codegen)** Emit named type in mapped types ([#9038](https://github.com/swc-project/swc/issues/9038)) ([91e92ec](https://github.com/swc-project/swc/commit/91e92ececab33c2258eeb659803da9a549e7591a))


- **(es/minifier)** Visit RHS while hoisting properties ([#9032](https://github.com/swc-project/swc/issues/9032)) ([cb16994](https://github.com/swc-project/swc/commit/cb16994a8d7a203e923b52e444d265bad0fa9e6e))

### Performance



- **(es/parser)** Optimize lexing of template literals ([#9036](https://github.com/swc-project/swc/issues/9036)) ([6ab19a1](https://github.com/swc-project/swc/commit/6ab19a1b5f37e7f485f392ef3b63af024ae9e644))

## [1.5.28] - 2024-06-11

### Bug Fixes
Expand Down Expand Up @@ -1309,9 +1318,6 @@



- **(atoms)** Update `hstr` to make global APIs fast ([#8241](https://github.com/swc-project/swc/issues/8241)) ([c01454a](https://github.com/swc-project/swc/commit/c01454ad4165d5e6ba58dc2b3b72910bbbc3a518))


- **(atoms)** Introduce `AtomStoreCell` ([#8232](https://github.com/swc-project/swc/issues/8232)) ([a5a6eb5](https://github.com/swc-project/swc/commit/a5a6eb53a56faa8e224f59f5cd967e5075c12edd))


Expand All @@ -1323,10 +1329,4 @@

- **(atoms)** Improve APIs ([#8249](https://github.com/swc-project/swc/issues/8249)) ([9a4bad4](https://github.com/swc-project/swc/commit/9a4bad4e9ec67a09761398eae5e6bb37e6d0d94f))

### Build



- **(preset-env/base)** Upgrade `browserslist-rs` to `v0.13.0` ([#8229](https://github.com/swc-project/swc/issues/8229)) ([f9f305c](https://github.com/swc-project/swc/commit/f9f305cc5faa79dd13bfa5763c6250b23a2a91e3))

<!-- generated by git-cliff -->
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/swc_ecma_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"
name = "swc_ecma_codegen"
repository = "https://github.com/swc-project/swc.git"
version = "0.149.2"
version = "0.149.3"

[features]
# This does not enable serde for ast nodes.
Expand Down
20 changes: 15 additions & 5 deletions crates/swc_ecma_codegen/src/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,14 @@ where
}

punct!("[");

emit!(n.type_param.name);

if n.type_param.constraint.is_some() {
if let Some(constraints) = &n.type_param.constraint {
space!();
keyword!("in");
space!();
emit!(constraints);
}

if let Some(default) = &n.type_param.default {
Expand All @@ -497,7 +499,12 @@ where
emit!(default);
}

emit!(n.type_param.constraint);
if let Some(name_type) = &n.name_type {
space!();
keyword!("as");
space!();
emit!(name_type);
}

punct!("]");

Expand All @@ -518,9 +525,12 @@ where
},
}

punct!(":");
space!();
emit!(n.type_ann);
if let Some(type_ann) = &n.type_ann {
punct!(":");
space!();
emit!(type_ann);
}

formatting_semi!();

self.wr.write_line()?;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
type NoTypeAnn = {
[value: string];
};
type MappedTypeWithNamedType = {
[K in T as U]: undefined;
};
type Partial<T> = {
[P in keyof T]?: T[P];
};
type OptionalPlus<T> = {
[P in keyof T]+?: T[P];
};
type OptionalMinus<T> = {
[P in keyof T]-?: T[P];
};
type Flags<T> = {
[P in keyof T]: boolean;
};
type ReadOnly<T> = {
readonly [P in keyof T]: T[P];
};
type ReadOnlyPlus<T> = {
+readonly [P in keyof T]: T[P];
};
type ReadOnlyMinus<T> = {
-readonly [P in keyof T]: T[P];
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
type NoTypeAnn = {
[value: string];
};
type MappedTypeWithNamedType = {
[K in T as U]: undefined;
};
type Partial<T> = {
[P in keyof T]?: T[P];
};
type OptionalPlus<T> = {
[P in keyof T]+?: T[P];
};
type OptionalMinus<T> = {
[P in keyof T]-?: T[P];
};
type Flags<T> = {
[P in keyof T]: boolean;
};
type ReadOnly<T> = {
readonly [P in keyof T]: T[P];
};
type ReadOnlyPlus<T> = {
+readonly [P in keyof T]: T[P];
};
type ReadOnlyMinus<T> = {
-readonly [P in keyof T]: T[P];
};
2 changes: 1 addition & 1 deletion crates/swc_ecma_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"]
license = "Apache-2.0"
name = "swc_ecma_parser"
repository = "https://github.com/swc-project/swc.git"
version = "0.144.2"
version = "0.144.3"

[package.metadata.docs.rs]
all-features = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
type Lazyify__2<T__3> = {
[K__3 in keyof T__3]: () => T__3[K__3];
[K__3 in keyof T__3 as `get${Capitalize<K__3 & string>}`]: () => T__3[K__3];
};

0 comments on commit 50a3ecd

Please sign in to comment.