[turbopack] Create ServiceWorkerEntryModule and service_worker_chunk_filename#94921
Merged
Conversation
Contributor
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URLCommit: 412d654 |
Contributor
Tests PassedCommit: 412d654 |
1d0021c to
eb3735e
Compare
bb6471e to
0f165dd
Compare
eb3735e to
1f057f8
Compare
0f165dd to
ab2d218
Compare
1d0021c to
abedcbf
Compare
ab2d218 to
964e7e5
Compare
abedcbf to
c9df074
Compare
964e7e5 to
ab06baf
Compare
bgw
reviewed
Jun 24, 2026
Comment on lines
+25
to
+32
| let slug: String = trimmed | ||
| .chars() | ||
| .map(|c| match c { | ||
| 'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' => c, | ||
| _ => '-', | ||
| }) | ||
| .collect(); | ||
| format!("sw-{slug}.js").into() |
Member
There was a problem hiding this comment.
We need to do something to strongly guarantee this name is unique for the given scope. (e.g. I have two scopes: /foo/bar and /foo-bar)
I think that should be a hash at the end of the slug.
bgw
approved these changes
Jun 24, 2026
Comment on lines
+25
to
+32
| let slug: String = trimmed | ||
| .chars() | ||
| .map(|c| match c { | ||
| 'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' => c, | ||
| _ => '-', | ||
| }) | ||
| .collect(); | ||
| format!("sw-{slug}.js").into() |
Member
There was a problem hiding this comment.
Prefer the explicit thing
Suggested change
| let slug: String = trimmed | |
| .chars() | |
| .map(|c| match c { | |
| 'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' => c, | |
| _ => '-', | |
| }) | |
| .collect(); | |
| format!("sw-{slug}.js").into() | |
| let slug: String = trimmed | |
| .chars() | |
| .map(|c| match c { | |
| 'a'..='z' | 'A'..='Z' | '0'..='9' | '-' | '_' => c, | |
| _ => '-', | |
| }) | |
| .collect(); | |
| RcStr::from(format!("sw-{slug}.js")) |
ab06baf to
d040635
Compare
d040635 to
412d654
Compare
032855e
into
sp/turbopack/single-entry-chunks
224 of 226 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is what will be inserted by the analyzer into a page's module graph: #94923. This allows
next-apito discover these modules (see #94922) and compile them.