Skip to content

Commit

Permalink
refactor(next-swc): turbopack_ecmascript_plugins (#48671)
Browse files Browse the repository at this point in the history
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md



## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change


### Why?

### How?

Closes NEXT-
Fixes #

-->

### What?

This PR is necessary changes to apply
vercel/turbo#4662. Need turbopack bump to make
CI pass.

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
kwonoj and kodiakhq[bot] committed Apr 26, 2023
1 parent b21fd96 commit f3d5c2f
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 45 deletions.
80 changes: 48 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ swc_relay = { version = "0.2.5" }
testing = { version = "0.33.4" }

# Turbo crates
turbo-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230425.3" }
turbo-binding = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230425.4" }
# [TODO]: need to refactor embed_directory! macro usages, as well as resolving turbo_tasks::function, macros..
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230425.3" }
turbo-tasks = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230425.4" }
# [TODO]: need to refactor embed_directory! macro usage in next-core
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230425.3" }
turbo-tasks-fs = { git = "https://github.com/vercel/turbo.git", tag = "turbopack-230425.4" }

# General Deps

Expand Down
1 change: 1 addition & 0 deletions packages/next-swc/crates/next-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ turbo-binding = { workspace = true, features = [
"__turbopack_dev",
"__turbopack_dev_server",
"__turbopack_ecmascript",
"__turbopack_ecmascript_plugin",
"__turbopack_env",
"__turbopack_static",
"__turbopack_image",
Expand Down
2 changes: 2 additions & 0 deletions packages/next-swc/crates/next-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,7 @@ pub fn register() {
turbopack::node::register();
turbopack::turbopack::register();
turbopack::image::register();
turbopack::ecmascript::register();
turbopack::ecmascript_plugin::register();
include!(concat!(env!("OUT_DIR"), "/register.rs"));
}
3 changes: 2 additions & 1 deletion packages/next-swc/crates/next-core/src/next_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ use turbo_binding::{
ecmascript::{
EcmascriptInputTransformsVc, EcmascriptModuleAssetType, EcmascriptModuleAssetVc,
},
ecmascript_plugin::transform::emotion::EmotionTransformConfig,
node::{
evaluate::evaluate,
execution_context::{ExecutionContext, ExecutionContextVc},
transforms::webpack::{WebpackLoaderConfigItems, WebpackLoaderConfigItemsVc},
},
turbopack::{
evaluate_context::node_evaluate_asset_context,
module_options::{EmotionTransformConfig, StyledComponentsTransformConfig},
module_options::StyledComponentsTransformConfig,
},
},
};
Expand Down

0 comments on commit f3d5c2f

Please sign in to comment.