Commit Graph

319 Commits

Author SHA1 Message Date
SWC Bot
67b0a7f258 chore: Publish crates 2023-10-25 23:01:44 +00:00
Donny/강동윤
7530e9051d
perf(es/minifier): Add has_flag to Comments (#8182) 2023-10-25 22:59:03 +00:00
Donny/강동윤
5ca3b63582
build(deps): Update ahash (#8174) 2023-10-24 00:01:58 +00:00
SWC Bot
5450f5808a chore: Publish crates 2023-10-23 22:03:16 +00:00
Donny/강동윤
9ceb57b4c7
fix(es/compat): Don't add pure annotations to dummy spans (#8172)
**Related issue:**

 - Closes #8155.
 - Closes #8173.
2023-10-23 15:00:35 -07:00
Donny/강동윤
d1097ccb59
feat(css/parser): Store lexed comments (#8091)
**Description:**

For now, we leave every comment as a leading comment. As logic for determining leading vs trailing is quite complex, I'll do it with another PR.
2023-10-10 11:42:20 +00:00
SWC Bot
34e03c4661 chore: Publish crates 2023-10-08 00:41:50 +00:00
SWC Bot
a6527bf9ab chore: Publish crates 2023-10-06 00:12:18 +00:00
Donny/강동윤
9b9bc51c28
refactor(es/parser): Introduce TokenKind along with Token (#8071)
**Description:**

This is extracted from https://github.com/swc-project/swc/pull/7790 because this PR is extremely large PR. I'll switch to `TokenKind` gradually.
2023-10-06 00:09:48 +00:00
SWC Bot
d1ec49e3e5 chore: Publish crates 2023-08-31 13:25:10 +00:00
Donny/강동윤
aa6495519b
fix(common): Fix logic for excluding FileName from source maps (#7900)
**Description:**

This PR also modifies React transform to use `FileName::Internal` and makes `SourceMapGenConfig` skips `FileName::Internal`.

**Related issue:**

 - Closes #5272
2023-08-31 13:23:11 +00:00
SWC Bot
7b5cb902a5 chore: Publish crates 2023-08-24 12:58:41 +00:00
Donny/강동윤
c65732496e
refactor(common): Mark some methods of Input unsafe (#7848)
**Related issue:**

 - Closes #7709
2023-08-24 12:56:38 +00:00
SWC Bot
a9a6928a4e chore: Publish crates 2023-08-24 08:20:56 +00:00
SWC Bot
e9dfe879d9 chore: Publish crates 2023-08-16 18:04:14 +00:00
David Sherret
981d7b152b
refactor(common): Make ahash optional (#7816)
**Description:**

This adds the ability to not include `ahash` with swc_common, which
caused some issues for me compiling dprint-plugin-typescript to Wasm
because of:

```
   Compiling ahash v0.8.3
   Compiling getrandom v0.2.10
error: the wasm*-unknown-unknown targets are not supported by default, you may need to enable the "js" feature. For more information see: https://docs.rs/getrandom/#webassembly-support
   --> C:\Users\david\.cargo\registry\src\index.crates.io-6f17d22bba15001f\getrandom-0.2.10\src\lib.rs:285:9
    |
285 | /         compile_error!("the wasm*-unknown-unknown targets are not supported by \
286 | |                         default, you may need to enable the \"js\" feature. \
287 | |                         For more information see: \
288 | |                         https://docs.rs/getrandom/#webassembly-support");
    | |________________________________________________________________________^
``` 

(I can't enable the JS feature because it's running the wasm file in
Wasmer and also I don't support Wasi in dprint plugins)

**BREAKING CHANGE:**

This removes swc_common's "perf" feature and makes it the default, then
adds an `ahash` feature instead. An alternative would be to make the
`ahash` dep optional and part of the default features, then do
`default-features = false` in the downstream crates (I think, but I'm
not sure), but I figure most people will be using the perf default
anyway? I'm not sure what's preferable.

**Related issue:**

 - Closes #7729.
2023-08-16 18:02:05 +00:00
SWC Bot
d5495eeb9a chore: Publish crates 2023-08-16 14:18:56 +00:00
David Sherret
b43e38d3f9
refactor: Use ahash from swc_common in more places (#7815)
**Description:**

Uses ahash from swc_common in more places. This allows for more easily
swapping out ahash with rustc_hash.
2023-08-16 23:16:52 +09:00
SWC Bot
a671afa0aa chore: Publish crates 2023-08-16 02:12:39 +00:00
Johnil Quezada
478fa4736f
feat(es/ast): Expose Archived types (#7811)
**Description:**

For crates using both `rkyv` and `swc`, where ast nodes from
`swc_ecma_ast` are included in data that's serialized with `rkyv`, it's
difficult to access the archived data from the archived ast nodes since
the types are private.

More context in the issue.

**Related issue:**

 - Closes #7810.
2023-08-16 02:10:51 +00:00
SWC Bot
026101b71e chore: Publish crates 2023-07-20 05:57:51 +00:00
SWC Bot
735a82d6a4 chore: Publish crates 2023-07-05 03:52:51 +00:00
Donny/강동윤
b34f1adbcc
build(cargo): Update rustc to 2023-07-03 (#7623) 2023-07-05 03:50:43 +00:00
SWC Bot
4efefb0f4e chore: Publish crates 2023-06-23 02:28:10 +00:00
Kieran Siek
95ac74e6e4
refactor(common): Remove add_bitflags and update bitflags (#7571) 2023-06-23 11:26:22 +09:00
SWC Bot
8c1436aaf5 chore: Publish crates 2023-06-22 13:40:52 +00:00
Donny/강동윤
d57d0d3ad3
build(cargo): Update deps (#7566) 2023-06-22 13:37:35 +00:00
SWC Bot
33355cf707 chore: Publish crates 2023-06-22 07:43:38 +00:00
Donny/강동윤
d12dc70c91
build(cargo): Update deps (#7564) 2023-06-22 07:40:41 +00:00
SWC Bot
f9c5265bde chore: Publish crates 2023-06-21 15:44:11 +00:00
Donny/강동윤
65ce5d1081
perf(es/minifier): Make minifier not overly generic (#7483)
**Description:**

Generics cause binary bloat.

**Related issue:**

 - https://github.com/vercel/next.js/pull/50365
2023-06-03 00:22:30 +09:00
SWC Bot
a63905aa2c chore: Publish crates 2023-05-30 05:18:06 +00:00
OJ Kwon
56ac9eb6b3
feat(common): Enable bytecheck for missing structs (#7465) 2023-05-30 05:15:46 +00:00
SWC Bot
6c3ff01a53 chore: Publish crates 2023-05-24 07:48:00 +00:00
SWC Bot
da0c612d85 chore: Publish crates 2023-05-16 05:18:57 +00:00
Donny/강동윤
3a0565f377
chore(plugin): Update rkyv to v0.7.42 (#7397) 2023-05-16 14:17:12 +09:00
SWC Bot
5e3d156aca chore: Publish crates 2023-05-15 03:20:03 +00:00
OJ Kwon
bba1fad35c
feat(plugin): Add versioned wrapper struct (#7382) 2023-05-15 03:17:31 +00:00
SWC Bot
e88ae37a0c chore: Publish crates 2023-05-12 00:47:49 +00:00
OJ Kwon
9b3a41c57d
refactor(common): Derive ByteCheck for ArcString (#7380) 2023-05-12 09:45:59 +09:00
SWC Bot
65785bdf21 chore: Publish crates 2023-05-10 04:19:21 +00:00
SWC Bot
aef5ac4812 chore: Publish crates 2023-05-06 03:56:38 +00:00
OJ Kwon
d2c1f45f5a
feat(plugin): Enable bytecheck (#7280)
**Description:**

Second attempt to enable bytecheck. This PR does not have versioned struct yet, just enabling bytecheck wherever possible. Also, it is for the ast only yet, so transform metadata and others might need this later.

PR seems to be passing all the ci, but as we've experienced before, there might be some unexpected outcomes with the release. Maybe better to hold this until clear https://github.com/swc-project/swc/issues/7238, then land as a separate release.
2023-05-06 03:54:25 +00:00
OJ Kwon
4e278befcf
build(cargo): Update wasmer to v3.3 (#7352) 2023-05-05 07:26:38 +00:00
SWC Bot
923ed13b6a chore: Publish crates 2023-04-24 09:25:42 +00:00
OJ Kwon
577f81ec40
fix(common): Workaround the Arc and rkyv issue (#7321)
**Description:**

Attempt to workaround #7238.

Originally I thought this is related with oom or memory layout, then realized actual deserialization error occurs in weird position - it tries to deserialize BytePos (which is obvious type) and it fails. It made me think maybe a property next to the struct layout have some unexpected behavior, notably Arc<String>.

PR applies same workaround as Atom does, and it seems to at least pass swc-coverage-instrument's usecases. May need bit more verification with other plugins to see if we can call this out as reliable workaround.
2023-04-24 09:23:31 +00:00
SWC Bot
42c4b07f34 chore: Publish crates 2023-04-15 03:29:04 +00:00
IWANABETHATGUY
c4cce12758
build(cargo): Update bitflags to v2 (#7270) 2023-04-15 03:26:56 +00:00
SWC Bot
e6cffb7581 chore: Publish crates 2023-04-13 08:41:47 +00:00
OJ Kwon
ff3decc7db
build(plugin): Update rkyv (#7257) 2023-04-13 08:39:23 +00:00