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

(RFC) (Rust) package version management policy #5149

Closed
kwonoj opened this issue Jul 8, 2022 · 2 comments
Closed

(RFC) (Rust) package version management policy #5149

kwonoj opened this issue Jul 8, 2022 · 2 comments
Assignees
Milestone

Comments

@kwonoj
Copy link
Member

kwonoj commented Jul 8, 2022

Describe the feature

This might need RFC in the future, for now trying to describe the issue for the record.

Currently, SWC's rust packages (which are published in crates.io) do not follow semver. Instead, use the latest versions to ensure build passed. There were some rough edges but it worked mostly.

With plugins, this becomes more challenging. There are various cases the recommendation cannot be followed,

  • inter-pkg version conflict when reference / import swc_plugin and other packages in the plugin code itself
    i.e swc_plugin's transitive swc_common does not match to the direct dep's swc_common version. User have to look into swc_plugin's version tree, then match it with its direct import.

  • Host - plugin version differences
    Cases like Cannot use SWC plugins in Webpack loader plugins#48, where host have latest pkg with breaking changes to the version being used in plugins.

This gets more complex if we want to ensure compatibility across different host runtimes, for example next-swc does not use latest swc always, which can result like vercel/next.js#38428 . Currently there's no way to make plugin to be compatible between @swc/core and next-swc if those 2 hosts are diverged.

In the end, we may need to introduce some sort of semver compliant to prevent these. It needs some thought around how. Probably we'll need to create single SDK-like entrypoint pkg which includes all of the transitive deps, can be feature-flag controlled in compile time and those pkg ensures semver - all of rust binary should import those package only, any direct import to trasnsitive dep won't gaurantee semver in that case.

Babel plugin or link to the feature description

No response

Additional context

No response

@kwonoj kwonoj changed the title (Rust) package version management (Rust) package version management policy Jul 8, 2022
@kdy1 kdy1 added this to the Planned milestone Jul 8, 2022
@kwonoj kwonoj self-assigned this Jul 21, 2022
@kwonoj kwonoj changed the title (Rust) package version management policy (RFC) (Rust) package version management policy Jul 21, 2022
@kwonoj
Copy link
Member Author

kwonoj commented Jul 21, 2022

This should be tracked via #5244 now.

@kwonoj kwonoj closed this as completed Jul 21, 2022
@kdy1 kdy1 modified the milestones: Planned, v1.2.219 Jul 27, 2022
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 16, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants