feat(treeshake): add treeshake server + frontend and optimize build/upload path#4372
feat(treeshake): add treeshake server + frontend and optimize build/upload path#4372ScriptedAlchemy merged 49 commits intomainfrom
Conversation
✅ Deploy Preview for module-federation-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
0a04b3e to
1d872cf
Compare
🦋 Changeset detectedLatest commit: b3e46b7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 43 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0a04b3ea6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| uploaded.push({ | ||
| name: s.name, | ||
| version: s.version, | ||
| globalName: s.globalName, | ||
| cdnUrl, |
There was a problem hiding this comment.
Preserve tree-shaking metadata in project publish responses
When uploadOptions is provided, the server uses uploadProject() and builds the response from sharedFilePaths. This push only copies name/version/globalName/cdnUrl, so modules and canTreeShaking are dropped even though they exist on SharedFilePath. The frontend expects canTreeShaking to be present (it treats missing as false) and uses modules for the export list; with uploadOptions enabled this causes /build/check-tree-shaking to incorrectly report “not tree-shakeable” and hides module data. Consider carrying these fields through (or hydrating from the JSON sidecar) when publishing.
Useful? React with 👍 / 👎.
This reverts commit bbd2028.
Bundle Size Report3 package(s) changed, 35 unchanged.
Total dist: 6.37 MB (+1.42 MB (+28.6%)) |
The isolate: false setting was causing global state pollution between tests. The original rstest worker exit issue is fixed by passing pruneIntervalMs: 0 to createApp in frontend.adapter.test.ts. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
# Conflicts: # pnpm-lock.yaml
# Conflicts: # pnpm-lock.yaml
# Conflicts: # pnpm-lock.yaml
raven-actions/actionlint@v2 runs npm install internally which fails on pnpm workspace repos due to workspace:* protocol. Switch to direct binary download which has no npm dependency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ke-packages Co-authored-by: Cursor <cursoragent@cursor.com>
Run actionlint from the runner temp directory with NODE_PATH to avoid npm workspace protocol errors. Co-authored-by: Cursor <cursoragent@cursor.com>
Preserve tree-shaking metadata in project uploads and avoid logging values derived from environment variables. Co-authored-by: Cursor <cursoragent@cursor.com>
…e into treeshake-packages
Run treeshake server/frontend e2e tests in a separate CI job and wire it into the matrix. Co-authored-by: Cursor <cursoragent@cursor.com>
Include treeshake server and frontend e2e runs in the local CI script with the affected check. Co-authored-by: Cursor <cursoragent@cursor.com>
Define explicit read-only token permissions for the treeshake E2E workflow. Co-authored-by: Cursor <cursoragent@cursor.com>
Adds the new treeshake build service + UI packages and hardens the server-side build/upload path.
What’s in this PR
@module-federation/treeshake-server: adapter-driven build service (Hono) that builds shared artifacts and serves an embedded UI.@module-federation/treeshake-frontend: UI to compare full vs treeshaken outputs.hostName)..json)..npmrc+.gitignore) and prettier ignore for the server template folder.How to try
pnpm --filter @module-federation/treeshake-server devhttp://localhost:3000/tree-shakinghttp://localhost:3000/tree-shaking-sharedNotes
mainandpnpm-lock.yamlwas regenerated frommain’s version.