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

feat: support interop for namespace importing cjs function exports #7914

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

ForsakenHarmony
Copy link
Contributor

@ForsakenHarmony ForsakenHarmony commented Apr 8, 2024

Description

Some libraries unfortunately use the "deprecated" babel way to import cjs dependencies.

a.js

module.exports = () => {};

b.js

import * as ns from "./a.cjs";

ns();

Copy link

vercel bot commented Apr 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-gatsby-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 2:40pm
examples-kitchensink-blog 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 2:40pm
examples-native-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 2:40pm
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 2:40pm
examples-svelte-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 2:40pm
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 2:40pm
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 2:40pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 2:40pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 2:40pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Apr 9, 2024 2:40pm

Copy link
Contributor

github-actions bot commented Apr 8, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented Apr 8, 2024

⚠️ This change may fail to build next-swc.

Logs

packages/next-swc/crates/next-core/src/next_font/google/mod.rs:159:13: �[38;5;9merror[E0027]: pattern does not mention field `fragment`
packages/next-swc/crates/next-core/src/next_font/google/mod.rs:290:13: �[38;5;9merror[E0027]: pattern does not mention field `fragment`
packages/next-swc/crates/next-core/src/next_font/google/mod.rs:340:13: �[38;5;9merror[E0027]: pattern does not mention field `fragment`
packages/next-swc/crates/next-core/src/next_font/local/mod.rs:131:13: �[38;5;9merror[E0027]: pattern does not mention field `fragment`
packages/next-swc/crates/next-core/src/next_font/local/mod.rs:209:13: �[38;5;9merror[E0027]: pattern does not mention field `fragment`
packages/next-swc/crates/next-core/src/next_font/local/mod.rs:262:13: �[38;5;9merror[E0027]: pattern does not mention field `fragment`
packages/next-swc/crates/next-core/src/next_shared/resolve.rs:77:16: �[38;5;9merror[E0027]: pattern does not mention field `fragment`
packages/next-swc/crates/next-core/src/next_shared/resolve.rs:418:16: �[38;5;9merror[E0027]: pattern does not mention field `fragment`
error: could not compile `next-core` (lib) due to 8 previous errors

See job summary for details

Copy link
Contributor

github-actions bot commented Apr 8, 2024

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests (mac/win, non-blocking)
  • Turbopack Rust benchmark tests (mac/win, non-blocking)

See workflow summary for details

@ForsakenHarmony ForsakenHarmony merged commit 5c7d38f into main Apr 9, 2024
44 of 47 checks passed
@ForsakenHarmony ForsakenHarmony deleted the hrmny/pack-2916-interop-function-exports branch April 9, 2024 15:02
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Apr 9, 2024
* vercel/turborepo#7912 <!-- Tobias Koppers - fix
edge condition in environment -->
* vercel/turborepo#7914 <!-- hrmny - feat: support
interop for namespace importing cjs function exports -->
ForsakenHarmony added a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…ercel/turborepo#7914)

### Description

Some libraries unfortunately use the "deprecated" babel way to import
cjs dependencies.

`a.js`
```js
module.exports = () => {};
```

`b.js`
```js
import * as ns from "./a.cjs";

ns();
```
ForsakenHarmony added a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…ercel/turborepo#7914)

### Description

Some libraries unfortunately use the "deprecated" babel way to import
cjs dependencies.

`a.js`
```js
module.exports = () => {};
```

`b.js`
```js
import * as ns from "./a.cjs";

ns();
```
ForsakenHarmony added a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…ercel/turborepo#7914)

### Description

Some libraries unfortunately use the "deprecated" babel way to import
cjs dependencies.

`a.js`
```js
module.exports = () => {};
```

`b.js`
```js
import * as ns from "./a.cjs";

ns();
```
ForsakenHarmony added a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…ercel/turborepo#7914)

### Description

Some libraries unfortunately use the "deprecated" babel way to import
cjs dependencies.

`a.js`
```js
module.exports = () => {};
```

`b.js`
```js
import * as ns from "./a.cjs";

ns();
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants