Skip to content
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

fix(plugin): Don't panic when ast byte not match #9562

Merged
merged 2 commits into from
Sep 19, 2024

Conversation

jerrykingxyz
Copy link
Contributor

Description:

  1. Disable rkyv strict feature, it is useless in swc.
  2. Archived_root will panic if the wasm plugin ast binary not match core ast, so use safe api to avoid panic when mismatch. Implementation reference: https://github.com/rkyv/rkyv/blob/v0.7.43/examples/json/src/main.rs#L57-L76

BREAKING CHANGE:

No

Related issue (if exists):

@jerrykingxyz jerrykingxyz requested review from a team as code owners September 18, 2024 07:16
Copy link

changeset-bot bot commented Sep 18, 2024

🦋 Changeset detected

Latest commit: f11391a

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Sep 18, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

codspeed-hq bot commented Sep 18, 2024

CodSpeed Performance Report

Merging #9562 will improve performances by 5.36%

Comparing jerrykingxyz:rkyv (f11391a) with main (c36871a)

Summary

⚡ 1 improvements
✅ 177 untouched benchmarks

Benchmarks breakdown

Benchmark main jerrykingxyz:rkyv Change
es/full/codegen/es2015 291.1 µs 276.3 µs +5.36%

@kdy1 kdy1 requested a review from kwonoj September 18, 2024 09:29
@kdy1 kdy1 self-assigned this Sep 18, 2024
@kdy1 kdy1 added this to the Planned milestone Sep 18, 2024
@kdy1 kdy1 changed the title fix(swc_common): don't panic when ast byte not match fix(plugin): don't panic when ast byte not match Sep 19, 2024
@kdy1 kdy1 changed the title fix(plugin): don't panic when ast byte not match fix(plugin): Don't panic when ast byte not match Sep 19, 2024
@kdy1 kdy1 merged commit c36871a into swc-project:main Sep 19, 2024
24 checks passed
@kdy1
Copy link
Member

kdy1 commented Sep 20, 2024

@jerrykingxyz This PR seems to cause some issues with swc_html. Can you take a look?

image

@jerrykingxyz
Copy link
Contributor Author

@kdy1 sure, i will create a new PR to fix it

kdy1 pushed a commit that referenced this pull request Sep 20, 2024
**Description:**

1. all struct that support rkyv add `archive(check_bytes)`
2. all recursive struct that support rkyv add check_bytes bound

this PR will fix the error reported in #9562
@kdy1 kdy1 modified the milestones: Planned, v1.7.28 Sep 24, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants