Skip to content

Commit

Permalink
Merge branch 'main' into dev-001
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcanaltin authored Aug 21, 2024
2 parents 7bae583 + b0b5e36 commit 7419bed
Show file tree
Hide file tree
Showing 106 changed files with 10,290 additions and 533 deletions.
7 changes: 7 additions & 0 deletions .changeset/clean-jobs-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
swc_core: patch
swc_common: patch
swc_plugin_runner: patch
---

refactor(common): Simplify `SyntaxContext` and `Mark`
6 changes: 6 additions & 0 deletions .changeset/many-lobsters-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
swc_ecma_minifier: patch
swc_core: patch
---

fix(es/minifier): Force rename synthesized identifiers
9 changes: 9 additions & 0 deletions .changeset/shaggy-cats-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
swc_css_visit: patch
swc_html_visit: patch
swc_xml_visit: patch
swc_ecma_visit: patch
swc_core: patch
---

feat(visit): Add experimental traverse APIs
6 changes: 6 additions & 0 deletions .changeset/shiny-guests-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
swc_ecma_usage_analyzer: patch
swc_core: patch
---

fix(es/minifier): Mark LHS of for-in/of as update
44 changes: 44 additions & 0 deletions .github/actions/tag-git-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "Git tag release"
description: "Tags a release"
inputs:
version:
description: "The version"
required: true
ssh-private-key:
description: "The SSH private key"
required: true

runs:
using: "composite"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "main"

- uses: ./.github/actions/setup-node

- name: Install git-cliff
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: Install cargo-edit
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: "Setup jq"
uses: dcarbone/install-jq-action@v2
with:
version: "1.7"
force: true

- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ inputs.ssh-private-key }}

- name: Create git tag commit
shell: bash
run: |
./scripts/publish.sh ${{ inputs.version }}
203 changes: 100 additions & 103 deletions .github/workflows/publish-npm-package.yml

Large diffs are not rendered by default.

68 changes: 59 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,33 @@ jobs:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
if: github.event_name == 'workflow_dispatch'
with:
profile: minimal

- name: Install cargo-edit
if: github.event_name == 'workflow_dispatch'
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: Install cargo-edit
- name: Install cargo-mono
if: github.event_name == 'workflow_dispatch'
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- run: cargo bump
if: github.event_name == 'workflow_dispatch'
continue-on-error: true

- uses: webfactory/[email protected]
if: github.event_name == 'workflow_dispatch'
with:
ssh-private-key: ${{ secrets.SWC_BOT_SSH }}

- name: Push bump commit
if: github.event_name == 'workflow_dispatch'
run: |
git push [email protected]:swc-project/swc.git --no-verify
Expand All @@ -80,26 +86,30 @@ jobs:
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-node
if: github.event_name == 'workflow_dispatch'

- uses: actions-rs/toolchain@v1
if: github.event_name == 'workflow_dispatch'
with:
profile: minimal

- name: Install cargo-edit
if: github.event_name == 'workflow_dispatch'
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: Install cargo-edit
if: github.event_name == 'workflow_dispatch'
uses: taiki-e/install-action@v2
with:
tool: [email protected]

- name: Update constant of swc_core
if: github.event_name == 'workflow_dispatch'
run: npx ts-node .github/bot/src/cargo/update-constants.ts

- name: Publish crates
# Skip on pull requests
if: github.event_name == 'workflow_dispatch'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand All @@ -120,22 +130,43 @@ jobs:
run: |
npx ts-node .github/bot/src/nightly-version.ts ${{ github.event.inputs.version }} >> $GITHUB_OUTPUT
git-tag-nightly:
name: "Git tag nightly"
runs-on: ubuntu-latest
needs:
- publish-cargo
- determine-nightly-version
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/tag-git-release
with:
version: ${{ needs.determine-nightly-version.outputs.version }}
ssh-private-key: ${{ secrets.SWC_BOT_SSH }}

publish-npm-nightly:
name: "Publish ${{ needs.determine-nightly-version.outputs.version }}"
name: "Publish ${{ matrix.package }}@${{ needs.determine-nightly-version.outputs.version }}"
strategy:
fail-fast: false
matrix:
package:
- core
- html
needs:
- git-tag-nightly
- publish-cargo
- determine-nightly-version
uses: ./.github/workflows/publish-npm-package.yml
secrets: inherit
with:
package: "core"
package: ${{ matrix.package }}
version: ${{ needs.determine-nightly-version.outputs.version }}
buildCli: true
skipBuild: ${{ inputs.skipBuild || false }}
skipPublishing: false
skipPublishing: ${{ github.event_name == 'pull_request' }}

run-ecosystem-ci-with-nightly:
name: "Test nightly using ecosystem CI"

needs:
- determine-nightly-version
- publish-npm-nightly
Expand All @@ -146,18 +177,37 @@ jobs:
suites: '["_"]'
allowBreakingWasm: ${{ inputs.allowBreakingWasm || false }}

git-tag-stable:
name: "Git tag stable"
runs-on: ubuntu-latest
needs:
- publish-cargo
- run-ecosystem-ci-with-nightly
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/tag-git-release
with:
version: ${{ inputs.version }}
ssh-private-key: ${{ secrets.SWC_BOT_SSH }}

publish-npm-stable:
name: "Publish ${{ inputs.version || 'stable' }} to npm"
name: "Publish ${{ matrix.package }}}}@${{ inputs.version || 'stable' }} to npm"
strategy:
fail-fast: false
matrix:
package:
- core
- html
needs:
- publish-cargo
- run-ecosystem-ci-with-nightly
- git-tag-stable

uses: ./.github/workflows/publish-npm-package.yml
secrets: inherit
with:
package: "core"
package: ${{ matrix.package }}
version: ${{ inputs.version }}
buildCli: true
skipBuild: ${{ inputs.skipBuild || inputs.onlyNightly || false }}
# Skip on pull requests
skipPublishing: ${{ inputs.onlyNightly }}
skipPublishing: ${{ github.event_name == 'pull_request' }}
137 changes: 55 additions & 82 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,59 @@
# Changelog
## [unreleased]

### Bug Fixes



- **(ci)** FIx pattern for `actions/download-artifact` ([ac7bd31](https://github.com/swc-project/swc/commit/ac7bd31e8cd79f9df7f3bf6ac05e84b67b0f4546))


- **(html)** Fix html binding ([eefae1c](https://github.com/swc-project/swc/commit/eefae1cde794b28b68e5c0af2d2f13a5053b7a49))

### Features



- **(bindings/html)** Allow using `lightningcss` as minfiier ([#9462](https://github.com/swc-project/swc/issues/9462)) ([74d6478](https://github.com/swc-project/swc/commit/74d6478be1eb8cdf1df096c360c159db64b64d8a))

### Miscellaneous Tasks



- **(html)** Use `binding_html_node` instead of `html_node` ([bdea5cb](https://github.com/swc-project/swc/commit/bdea5cb94cf7cc9d02274f32e104b55f977e625d))


- **(html)** Fix publish action ([f30fd4f](https://github.com/swc-project/swc/commit/f30fd4fe42764ee29031ce4c0c038c1c95235482))

### Performance



- **(visit)** Add linear AST traversal ([#9452](https://github.com/swc-project/swc/issues/9452)) ([911d4ea](https://github.com/swc-project/swc/commit/911d4eaa146ff493636308a3cebd8b21d941bfde))

## [1.7.14] - 2024-08-19

### Bug Fixes



- **(common)** Use `SourceMap::adjust_mappings` in correct order ([#9447](https://github.com/swc-project/swc/issues/9447)) ([05961eb](https://github.com/swc-project/swc/commit/05961eb018e2e76ed5ef95de9bad923b2fe1df88))


- **(es)** Preserve more comments ([#9449](https://github.com/swc-project/swc/issues/9449)) ([673655c](https://github.com/swc-project/swc/commit/673655c1697ff1d507f7acbfa937cbf1f58eb1d9))

### Features



- **(es/decorators)** Groundwork for stage 3 decorator ([#9450](https://github.com/swc-project/swc/issues/9450)) ([238ba8b](https://github.com/swc-project/swc/commit/238ba8b1d2220202129595185bd4411b9415cc99))

### Refactor



- **(visit)** Remove `VisitAll` ([#9448](https://github.com/swc-project/swc/issues/9448)) ([8845b76](https://github.com/swc-project/swc/commit/8845b76ac40b36791c79618c5ee89f05d2d08c96))

## [1.7.12] - 2024-08-19

### Bug Fixes
Expand Down Expand Up @@ -1225,97 +1280,15 @@
- **(es/decorators)** Fix capacity overflow with decorators ([#8818](https://github.com/swc-project/swc/issues/8818)) ([9ed93c1](https://github.com/swc-project/swc/commit/9ed93c17cdb645274392ebdb9ad87f8fbeeed971))


- **(es/minifier)** Respect `top_retain` for top-level functions ([#8814](https://github.com/swc-project/swc/issues/8814)) ([811308c](https://github.com/swc-project/swc/commit/811308c3526003608e61c559f43408f6065ff9ee))


- **(es/minifier)** Abort IIFE invoker in function parameters ([#8828](https://github.com/swc-project/swc/issues/8828)) ([ebb68db](https://github.com/swc-project/swc/commit/ebb68db24d7287ca12d85a68a34aabfa660eeae0))


- **(es/module)** Respect `module.resolveFully` in more cases ([#8820](https://github.com/swc-project/swc/issues/8820)) ([e1f7704](https://github.com/swc-project/swc/commit/e1f770463d1f0402468e07fca9c637e3823bb2d1))


- **(es/transforms)** Fix capacity overflow with decorators ([#8815](https://github.com/swc-project/swc/issues/8815)) ([974f5c7](https://github.com/swc-project/swc/commit/974f5c759c7736ab521d18c8e7bd88210691a2ab))


- **(plugin/runner)** Pin version of `virtual-fs` ([#8827](https://github.com/swc-project/swc/issues/8827)) ([089f61b](https://github.com/swc-project/swc/commit/089f61bc37bb9c09dc94a24a5518840883827f57))


- **(visit)** Improve `Map` implementation for `Box` ([#8819](https://github.com/swc-project/swc/issues/8819)) ([dc04657](https://github.com/swc-project/swc/commit/dc046572def13a3eb625520c5a8bfd651b86f3a3))

## [1.4.12] - 2024-04-04

### Bug Fixes



- **(common)** Fix source index for `inputSourceMap` ([#8800](https://github.com/swc-project/swc/issues/8800)) ([4f9ab81](https://github.com/swc-project/swc/commit/4f9ab8151dad9984c81c72eb10c2afe5313a7591))


- **(es)** Change default value of `inputSourceMap` to `true` ([#8801](https://github.com/swc-project/swc/issues/8801)) ([9ffcd18](https://github.com/swc-project/swc/commit/9ffcd1823c0abdc741f654b8e1e330cdc06769a1))


- **(es/bugfixes)** Fix fn transform in nameless fns ([#8796](https://github.com/swc-project/swc/issues/8796)) ([7ad004e](https://github.com/swc-project/swc/commit/7ad004e1899d98ee8da49909163455b3b622686d))


- **(es/helpers)** Fix metadata of decorators being `undefined` ([#8768](https://github.com/swc-project/swc/issues/8768)) ([263ce6e](https://github.com/swc-project/swc/commit/263ce6e22bd4dbba0323099f256fb062b8e644a2))


- **(es/minifier)** Abort fn inliner if there's a spread arg ([#8809](https://github.com/swc-project/swc/issues/8809)) ([730ded2](https://github.com/swc-project/swc/commit/730ded2a26f63f0069dea0d3bc207bb31f344444))


- **(es/module)** Fix `jsc.paths` with `resolveFully` ([#8784](https://github.com/swc-project/swc/issues/8784)) ([4961bb0](https://github.com/swc-project/swc/commit/4961bb055df9925da97279819d2fdf740b4b3d92))


- **(es/parser)** Tweak msg of `SyntaxError::UsingDeclNotEnabled` ([#8791](https://github.com/swc-project/swc/issues/8791)) ([95c822e](https://github.com/swc-project/swc/commit/95c822e7c43470e4c972bef00d97e7e0de02e0b0))

### Features



- **(es/minifier)** Evaluate spread of arrays ([#8811](https://github.com/swc-project/swc/issues/8811)) ([47714c5](https://github.com/swc-project/swc/commit/47714c52ce08b0e94617d17c11c8e8994c62dbaa))


- **(plugin/runner)** Improve error message for Wasm plugin crashes ([#8794](https://github.com/swc-project/swc/issues/8794)) ([571d297](https://github.com/swc-project/swc/commit/571d29781a90f4def4811ae46fa4a5f966e461e6))

### Miscellaneous Tasks



- **(deps)** Update dependencies ([#8810](https://github.com/swc-project/swc/issues/8810)) ([207582f](https://github.com/swc-project/swc/commit/207582ff254a66a9dd4613de6d3cb43c19957b68))


- **(es/transforms)** Add `repository` field to `swc_ecma_ext_transforms` ([#8793](https://github.com/swc-project/swc/issues/8793)) ([37f0a79](https://github.com/swc-project/swc/commit/37f0a7994bdf7d90c30a00f70c6dde97b4d89c8f))

### Performance



- **(atoms)** Update `hstr` ([#8799](https://github.com/swc-project/swc/issues/8799)) ([0745624](https://github.com/swc-project/swc/commit/0745624cb71e12b18b06d9ee106066d8b585c4c6))


- **(es/parser)** Use faster unicode crate ([#8785](https://github.com/swc-project/swc/issues/8785)) ([6f780ca](https://github.com/swc-project/swc/commit/6f780ca749a611f54aa4deb628e532fd0a12228f))

## [1.4.9] - 2024-03-26

### Bug Fixes



- **(es/minifier)** Fix tpl-to-string conversion ([#8778](https://github.com/swc-project/swc/issues/8778)) ([e7bca10](https://github.com/swc-project/swc/commit/e7bca101424ed3a3195ca6f45fd4993318cf105d))


- **(es/parser)** Parse `await using` in for head ([#8775](https://github.com/swc-project/swc/issues/8775)) ([53fd09c](https://github.com/swc-project/swc/commit/53fd09cbd7f559ea65dbcbf8c77eea1fcf67b691))

### Miscellaneous Tasks



- **(deps)** Update `sourcemap` to `v8.0.0` ([#8771](https://github.com/swc-project/swc/issues/8771)) ([f8681c9](https://github.com/swc-project/swc/commit/f8681c9299813580849dc39240d29441b6038192))

### Build



- **(bindings/node)** Update `sourcemap` ([#8777](https://github.com/swc-project/swc/issues/8777)) ([2920a88](https://github.com/swc-project/swc/commit/2920a88cf772092b63a16d2913704e4e5ebed754))

<!-- generated by git-cliff -->
Loading

0 comments on commit 7419bed

Please sign in to comment.