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 export * warning for client pages #3795

Merged
merged 4 commits into from
Feb 14, 2023
Merged

Conversation

sokra
Copy link
Member

@sokra sokra commented Feb 14, 2023

This gets rid of this warning when using a client component as page:

warning - [analyze] [project-with-next]/src/app/client/page.jsx  unexpected export *
  export * used with module [project-with-next]/src/app/client/page.jsx which has no exports
  Typescript only: Did you want to export only types with `export type { ... } from "..."`?
  • fix export * warning for client pages
  • Detect __turbopack_export_value__ as CJS style exports
  • fix __turbopack_cjs__ name
  • flag turbopackHelper in client proxy

@sokra sokra requested a review from a team as a code owner February 14, 2023 10:13
@sokra sokra added the pr: automerge Kodiak will merge these automatically after checks pass label Feb 14, 2023
@vercel
Copy link

vercel bot commented Feb 14, 2023

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

Name Status Preview Comments Updated
examples-basic-web 🔄 Building (Inspect) Feb 14, 2023 at 2:21PM (UTC)
examples-designsystem-docs 🔄 Building (Inspect) Feb 14, 2023 at 2:21PM (UTC)
8 Ignored Deployments
Name Status Preview Comments Updated
examples-cra-web ⬜️ Ignored (Inspect) Feb 14, 2023 at 2:21PM (UTC)
examples-kitchensink-blog ⬜️ Ignored (Inspect) Feb 14, 2023 at 2:21PM (UTC)
examples-native-web ⬜️ Ignored (Inspect) Feb 14, 2023 at 2:21PM (UTC)
examples-nonmonorepo ⬜️ Ignored (Inspect) Feb 14, 2023 at 2:21PM (UTC)
examples-svelte-web ⬜️ Ignored (Inspect) Feb 14, 2023 at 2:21PM (UTC)
examples-tailwind-web ⬜️ Ignored (Inspect) Feb 14, 2023 at 2:21PM (UTC)
examples-vite-web ⬜️ Ignored (Inspect) Feb 14, 2023 at 2:21PM (UTC)
turbo-site ⬜️ Ignored (Inspect) Visit Preview Feb 14, 2023 at 2:21PM (UTC)

@sokra sokra marked this pull request as draft February 14, 2023 10:15
@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2023

⚠️ CI failed ⚠️

The following steps have failed in CI:

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

See workflow summary for details

@github-actions
Copy link
Contributor

Benchmark for d9fd67f

Test Base PR % Significant %
bench_startup/Turbopack RSC/1000 modules 2422.28ms ± 8.94ms 2455.84ms ± 7.67ms +1.39% +0.01%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9425.29µs ± 73.92µs 9438.93µs ± 59.56µs +0.14%
bench_hmr_to_commit/Turbopack RCC/1000 modules 11.14ms ± 0.13ms 11.35ms ± 0.14ms +1.81%
bench_hmr_to_commit/Turbopack RSC/1000 modules 522.48ms ± 2.93ms 521.15ms ± 1.84ms -0.26%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9557.98µs ± 66.98µs 9454.66µs ± 73.22µs -1.08%
bench_hmr_to_eval/Turbopack CSR/1000 modules 8292.62µs ± 86.92µs 8249.27µs ± 62.26µs -0.52%
bench_hmr_to_eval/Turbopack RCC/1000 modules 11.06ms ± 0.39ms 10.43ms ± 0.18ms -5.77%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8356.98µs ± 77.07µs 8468.01µs ± 81.76µs +1.33%
bench_hydration/Turbopack RCC/1000 modules 4210.35ms ± 11.19ms 4212.09ms ± 11.51ms +0.04%
bench_hydration/Turbopack RSC/1000 modules 3792.21ms ± 18.59ms 3776.82ms ± 18.60ms -0.41%
bench_hydration/Turbopack SSR/1000 modules 3701.74ms ± 18.69ms 3679.55ms ± 18.39ms -0.60%
bench_startup/Turbopack CSR/1000 modules 2800.31ms ± 6.39ms 2774.47ms ± 9.48ms -0.92%
bench_startup/Turbopack RCC/1000 modules 2551.97ms ± 5.70ms 2548.46ms ± 6.14ms -0.14%
bench_startup/Turbopack RSC/1000 modules 2422.28ms ± 8.94ms 2455.84ms ± 7.67ms +1.39% +0.01%
bench_startup/Turbopack SSR/1000 modules 2107.06ms ± 2.33ms 2106.80ms ± 1.66ms -0.01%

@sokra sokra force-pushed the sokra/fix-client-warning branch from c66a4f4 to fa9ecab Compare February 14, 2023 12:24
@sokra sokra changed the title Detect __turbopack_export_value__ as CJS style exports fix export * warning for client pages Feb 14, 2023
@@ -167,7 +167,7 @@ impl CodeGenerateable for EsmExports {
let ident = ReferencedAsset::get_ident_from_placeable(asset).await?;

cjs_exports.push(quote_expr!(
"__turbopack__cjs__($arg)",
"__turbopack_cjs__($arg)",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kdy1 I really wonder why we didn't notice that earlier...

Copy link
Contributor

@alexkirsz alexkirsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 nits

@github-actions
Copy link
Contributor

Benchmark for 258454d

Test Base PR % Significant %
bench_startup/Turbopack RCC/1000 modules 2486.98ms ± 6.94ms 2525.64ms ± 7.29ms +1.55% +0.41%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8383.59µs ± 82.52µs 8422.52µs ± 81.32µs +0.46%
bench_hmr_to_commit/Turbopack RCC/1000 modules 13.16ms ± 0.23ms 12.51ms ± 0.19ms -4.93%
bench_hmr_to_commit/Turbopack RSC/1000 modules 493.59ms ± 2.22ms 487.69ms ± 1.33ms -1.20%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9172.20µs ± 130.83µs 9251.07µs ± 200.55µs +0.86%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7491.73µs ± 49.94µs 7507.75µs ± 73.77µs +0.21%
bench_hmr_to_eval/Turbopack RCC/1000 modules 11.55ms ± 0.18ms 11.56ms ± 0.20ms +0.02%
bench_hmr_to_eval/Turbopack SSR/1000 modules 7712.19µs ± 89.66µs 7764.82µs ± 57.61µs +0.68%
bench_hydration/Turbopack RCC/1000 modules 4126.28ms ± 17.85ms 4136.83ms ± 6.42ms +0.26%
bench_hydration/Turbopack RSC/1000 modules 3715.94ms ± 13.83ms 3708.23ms ± 18.72ms -0.21%
bench_hydration/Turbopack SSR/1000 modules 3620.06ms ± 16.02ms 3597.45ms ± 32.71ms -0.62%
bench_startup/Turbopack CSR/1000 modules 2773.32ms ± 11.41ms 2722.37ms ± 15.68ms -1.84%
bench_startup/Turbopack RCC/1000 modules 2486.98ms ± 6.94ms 2525.64ms ± 7.29ms +1.55% +0.41%
bench_startup/Turbopack RSC/1000 modules 2399.08ms ± 9.26ms 2393.11ms ± 7.49ms -0.25%
bench_startup/Turbopack SSR/1000 modules 2077.31ms ± 5.00ms 2088.12ms ± 3.55ms +0.52%

Detect `__turbopack_export_value__` as CJS style exports
fix `__turbopack_cjs__` name
flag turbopackHelper in client proxy
@sokra sokra force-pushed the sokra/fix-client-warning branch from 1f30335 to c8734bc Compare February 14, 2023 14:20
@sokra sokra marked this pull request as ready for review February 14, 2023 14:20
@kodiakhq kodiakhq bot merged commit 43b4b03 into main Feb 14, 2023
@kodiakhq kodiakhq bot deleted the sokra/fix-client-warning branch February 14, 2023 14:38
@github-actions
Copy link
Contributor

Benchmark for c9a43a8

Test Base PR % Significant %
bench_hydration/Turbopack RCC/1000 modules 4285.81ms ± 10.67ms 4192.08ms ± 15.13ms -2.19% -0.99%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9860.43µs ± 84.63µs 9830.04µs ± 88.65µs -0.31%
bench_hmr_to_commit/Turbopack RCC/1000 modules 12.15ms ± 0.23ms 12.01ms ± 0.27ms -1.18%
bench_hmr_to_commit/Turbopack RSC/1000 modules 517.34ms ± 2.62ms 514.26ms ± 2.73ms -0.60%
bench_hmr_to_commit/Turbopack SSR/1000 modules 9984.35µs ± 86.38µs 9997.21µs ± 131.09µs +0.13%
bench_hmr_to_eval/Turbopack CSR/1000 modules 9003.61µs ± 58.31µs 8789.15µs ± 61.73µs -2.38%
bench_hmr_to_eval/Turbopack RCC/1000 modules 10.82ms ± 0.16ms 11.07ms ± 0.22ms +2.32%
bench_hmr_to_eval/Turbopack SSR/1000 modules 8905.00µs ± 70.19µs 9065.18µs ± 64.38µs +1.80%
bench_hydration/Turbopack RCC/1000 modules 4285.81ms ± 10.67ms 4192.08ms ± 15.13ms -2.19% -0.99%
bench_hydration/Turbopack RSC/1000 modules 3845.30ms ± 10.81ms 3883.09ms ± 21.66ms +0.98%
bench_hydration/Turbopack SSR/1000 modules 3731.61ms ± 14.48ms 3737.72ms ± 20.13ms +0.16%
bench_startup/Turbopack CSR/1000 modules 2796.96ms ± 9.46ms 2822.78ms ± 8.54ms +0.92%
bench_startup/Turbopack RCC/1000 modules 2586.30ms ± 10.71ms 2580.20ms ± 10.11ms -0.24%
bench_startup/Turbopack RSC/1000 modules 2483.17ms ± 9.79ms 2479.70ms ± 7.42ms -0.14%
bench_startup/Turbopack SSR/1000 modules 2137.32ms ± 1.37ms 2140.65ms ± 1.91ms +0.16%

timneutkens pushed a commit to vercel/next.js that referenced this pull request Feb 21, 2023
…jjsweb.site> Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>

# New Features
- vercel/turborepo#3771
- vercel/turborepo#3690

# Performance
- vercel/turborepo#3768

# Fixes
- vercel/turborepo#3795
- vercel/turborepo#3746
- vercel/turborepo#3832
- vercel/turborepo#3827
- vercel/turborepo#3847

# Other
- vercel/turborepo#3803
- vercel/turborepo#3685
- vercel/turborepo#3848

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
jridgewell pushed a commit to vercel/next.js that referenced this pull request Mar 10, 2023
This gets rid of this warning when using a client component as page:

```
warning - [analyze] [project-with-next]/src/app/client/page.jsx  unexpected export *
  export * used with module [project-with-next]/src/app/client/page.jsx which has no exports
  Typescript only: Did you want to export only types with `export type { ... } from "..."`?
```

* fix export * warning for client pages
* Detect `__turbopack_export_value__` as CJS style exports
* fix `__turbopack_cjs__` name
* flag turbopackHelper in client proxy
sokra added a commit to vercel/next.js that referenced this pull request Mar 13, 2023
This gets rid of this warning when using a client component as page:

```
warning - [analyze] [project-with-next]/src/app/client/page.jsx  unexpected export *
  export * used with module [project-with-next]/src/app/client/page.jsx which has no exports
  Typescript only: Did you want to export only types with `export type { ... } from "..."`?
```

* fix export * warning for client pages
* Detect `__turbopack_export_value__` as CJS style exports
* fix `__turbopack_cjs__` name
* flag turbopackHelper in client proxy
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
This gets rid of this warning when using a client component as page:

```
warning - [analyze] [project-with-next]/src/app/client/page.jsx  unexpected export *
  export * used with module [project-with-next]/src/app/client/page.jsx which has no exports
  Typescript only: Did you want to export only types with `export type { ... } from "..."`?
```

* fix export * warning for client pages
* Detect `__turbopack_export_value__` as CJS style exports
* fix `__turbopack_cjs__` name
* flag turbopackHelper in client proxy
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
This gets rid of this warning when using a client component as page:

```
warning - [analyze] [project-with-next]/src/app/client/page.jsx  unexpected export *
  export * used with module [project-with-next]/src/app/client/page.jsx which has no exports
  Typescript only: Did you want to export only types with `export type { ... } from "..."`?
```

* fix export * warning for client pages
* Detect `__turbopack_export_value__` as CJS style exports
* fix `__turbopack_cjs__` name
* flag turbopackHelper in client proxy
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
This gets rid of this warning when using a client component as page:

```
warning - [analyze] [project-with-next]/src/app/client/page.jsx  unexpected export *
  export * used with module [project-with-next]/src/app/client/page.jsx which has no exports
  Typescript only: Did you want to export only types with `export type { ... } from "..."`?
```

* fix export * warning for client pages
* Detect `__turbopack_export_value__` as CJS style exports
* fix `__turbopack_cjs__` name
* flag turbopackHelper in client proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants