Commit Graph

5787 Commits

Author SHA1 Message Date
Donny/강동윤
07634a05ba
fix(es/codegen): Do not produce octal literals (#8565) 2024-01-28 12:34:03 +00:00
SWC Bot
160043a2d3 chore: Bump crates 2024-01-27 04:57:56 +00:00
xiao xin
d6a4615898
fix(es/loader): Make tsc resolver work for bare specifier (#8550)
**Description:**

From the typescript
[baseUrl](https://www.typescriptlang.org/docs/handbook/modules/reference.html#baseurl)
doc: When using bare specifiers (module specifiers that don’t begin with
./, ../, or /), baseUrl has a higher precedence than node_modules
package lookups.

In the current tsc resolver implementation, when resolving bare module
specifiers, baseUrl was not used except for `paths`, this cause the
belowing resolution failed, but it worked when used in typescript
project.

`tsconfig.json` / `.swcrc`:
```json
{
    baseUrl: "."
    paths: {
        "@common/*": ["src/common/*"]
    }
}
```

File structure:
- ./src/common/helper.ts
- ./src/index.ts


./src/index.ts content:
```ts
 // tsc can resolve this, but tsc resolver cannot
import sth from "src/common/helper"
```
2024-01-27 04:56:11 +00:00
강동윤 (Donny)
039c1685c6 chore: Publish crates 2024-01-25 21:36:33 +09:00
magic-akari
f416aff7d7
fix(es/decorator): Preserve state while traversing the module_items scope (#8556)
**Related issue:**

 - Closes #8551
2024-01-25 08:44:02 +00:00
SWC Bot
5f9b7b4c8b chore: Bump crates 2024-01-25 07:20:48 +00:00
magic-akari
6a8dd8cbb3
fix(es/decorator): Skip TypeScript class method/prop declarations (#8555)
**Related issue:**

- Closes #8552
2024-01-25 07:19:20 +00:00
강동윤 (Donny)
1890e66023 chore: Publish crates 2024-01-25 14:07:30 +09:00
SWC Bot
c5053d1574 chore: Bump crates 2024-01-24 12:01:48 +00:00
Donny/강동윤
fab27dabed
fix(es/loader): Don't use browser versions for jsc.paths (#8548)
**Related issue:**

 - https://github.com/vercel/next.js/issues/56144
2024-01-24 12:00:05 +00:00
SWC Bot
994d7adcd0 chore: Bump crates 2024-01-24 09:19:54 +00:00
Donny/강동윤
ae786692a0
fix(es/codegen): Set sourceRoot of sourcemaps (#6086)
**Related issue:**

 - Closes #2362
2024-01-24 09:18:09 +00:00
Donny/강동윤
00619b1708
feat(css/parser): Implement error reporting for @value of CSS Modules (#8547) 2024-01-24 05:06:20 +00:00
SWC Bot
c3fd9d081e chore: Bump crates 2024-01-24 02:04:25 +00:00
Donny/강동윤
043ee85d08
fix(common): Fix source map generation with inputSourceMap (#8546)
**Description:**

- This PR fixes the source map generation when `inputSourceMap` is specified.
- This PR fixes `minify()` not accepting parsed source map in the option.


**Related issue:**

 - Closes #8372.
2024-01-24 02:02:45 +00:00
Donny/강동윤
aa70131c55
fix(es/minifier): Fix a bug related to inliner and the variable scoping (#8542)
**Related issue:**

 - Closes #8246
2024-01-24 01:12:02 +00:00
SWC Bot
2d15177ca9 chore: Bump crates 2024-01-23 08:38:01 +00:00
Donny/강동윤
4630426d6a
chore(common): Update sourcemap (#8544)
**Related issue:**

 - Closes #7822
2024-01-23 08:36:04 +00:00
SWC Bot
12be23cfb5 chore: Bump crates 2024-01-23 04:25:38 +00:00
Donny/강동윤
fc929e962b
fix(es/compat): Support vars from reserved_word pass (#8543)
**Related issue:**

 - Closes #8539
2024-01-23 04:23:48 +00:00
SWC Bot
ecd9403c1d chore: Bump crates 2024-01-23 03:46:27 +00:00
SWC Bot
979061f6ba chore: Bump crates 2024-01-22 13:04:29 +00:00
Fy
71930ffb56
fix(es/quote): Add support for import phase to quote macro (#8536)
**Description:**

When using quote! to generate import decl, compile error: missing field `phase` in initializer of 'swc_core::ecma::ast::Import'
2024-01-22 22:02:49 +09:00
SWC Bot
ae75dcb710 chore: Bump crates 2024-01-22 08:53:49 +00:00
Donny/강동윤
793f2651a8
feat(swc_core): Expose preset_env_base (#8537) 2024-01-22 17:51:26 +09:00
SWC Bot
990f291d43 chore: Bump crates 2024-01-21 15:30:11 +00:00
Donny/강동윤
2d8bd9ed89
fix(es/module): Fix handling of * in jsc.paths (#8535)
**Related issue:**

 - Closes #8375
2024-01-21 15:28:38 +00:00
SWC Bot
9c23f1cf38 chore: Bump crates 2024-01-21 12:37:38 +00:00
Donny/강동윤
71fb5c12a7
fix(es/module): Fix resolving of dependencies (#8533)
**Description:**

I changed the signature of `Resolve` because there was a need to pass the `value` part from `jsc.paths` to the caller.


**Related issue:**

 - Closes #8184
2024-01-21 21:35:57 +09:00
SWC Bot
6210bf19de chore: Bump crates 2024-01-21 03:08:11 +00:00
magic-akari
72048ae1ce feat(es/ast): Support import phase (#8279)
**Description:**

- https://github.com/tc39/proposal-source-phase-imports
2024-01-21 12:05:46 +09:00
Donny/강동윤
bc38ac906c fix(es/ast): Fix definition of SetterProp (#8314)
**Related issue:**

 - Closes #8157
 - Closes #8377
2024-01-21 12:05:46 +09:00
David Sherret
572bcaefc1 fix(es/ast): Add definite and is_override to AutoAccessor (#8436)
**Description:**

Adds a `definite` and `is_override` property to `AutoAccessor` as they were missing.
It also fixes codegen for `AutoAccessor` when emitting TypeScript (which is the main reason I need this PR).

**BREAKING CHANGE:**

Adds a `definite` and `is_override` property.

**Related issue:**

 - Closes #8344
2024-01-21 12:05:46 +09:00
SWC Bot
1ca0d65c29 chore: Bump crates 2024-01-21 02:34:11 +00:00
Donny/강동윤
014a6cda82
fix(common): Remove < and > from Display impl of FileName::Custom (#8530)
**Description:**

It caused a problem for next.js
2024-01-21 02:32:35 +00:00
SWC Bot
6d9939d18e chore: Bump crates 2024-01-19 15:19:51 +00:00
Donny/강동윤
5e40dc7d8c
chore(preset-env): Update browserslist-rs (#8524) 2024-01-19 15:18:08 +00:00
Donny/강동윤
974c6a0036
test(es/codegen): Add a JS test for ascii-only mode (#8519)
**Description:**

The issue was fixed by #8493, but it was not included in the latest release because of the wrong bump comment.

**Related issue:**

 - Closes #8491
2024-01-19 04:14:11 +00:00
Donny/강동윤
4b4a0a244d
test(es/module): Add a test for a fixed issue (#8521)
**Related issue:**

 - Closes #8375
2024-01-19 03:39:42 +00:00
Donny/강동윤
8fac2bb03c
test(es/minifier): Add a test for a fixed issue (#8520)
**Related issue:**

 - Closes #8407
2024-01-19 03:12:28 +00:00
Donny/강동윤
1c4eb1f54f
test(es/codegen): Add tests for @ctrl/tinycolor (#8518)
**Related issue:**

 - Closes #8475
 - #8496 (Fixed by #8510)
2024-01-19 02:46:05 +00:00
SWC Bot
e63a5c7e95 chore: Bump crates 2024-01-19 02:14:55 +00:00
Donny/강동윤
9f1ce3acd6
fix(es/codegen): Fix codegen of \\0 (#8433)
**Related issue:**

 - Closes #8431
2024-01-19 02:11:05 +00:00
SWC Bot
fefe9636f0 chore: Publish crates 2024-01-19 01:27:20 +00:00
melbourne2991
f40f59bd70
fix(es/typescript): Fix panic on invalid jsx pragma (#8513)
**Description:**

Currently a jsx pragma with an invalid js identifier (eg, with dashes: `@jsx bad-pragma` causes a panic.

This PR prevents a panic and will ignore an invalid pragma in a comment.

(There may be an argument for showing an error or warning instead, but
given a jsx pragma is still valid ES I'm not sure whether that makes
sense?)

[Original (Deno) issue
here](https://github.com/denoland/deno/issues/21927)
2024-01-19 01:25:46 +00:00
SWC Bot
3c00098dbe chore: Publish crates 2024-01-19 00:45:54 +00:00
Donny/강동윤
4946a11137
fix(es/minifier): Fix a bug in tpl string <-> string logic (#8510)
**Related issue:**

 - Closes #8496
2024-01-19 00:44:19 +00:00
SWC Bot
4520eca97a chore: Publish crates 2024-01-18 14:05:51 +00:00
Donny/강동윤
3741448b1b
chore: Update dependencies (#8514) 2024-01-18 14:04:09 +00:00
강동윤 (Donny)
585c24fc72 chore: Publish crates 2024-01-17 19:36:33 +09:00