perf(org-browser): resolve effect ESM to shrink bundle (POC) - W-23293744#7675
Merged
mshanemc merged 7 commits intoJul 6, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Baseline (effect resolves dist/cjs/*): - node dist/index.js = 1,447,135B; fast-check bytesInOutput = 234,890B - web dist/web/index.js = 1,422,362B; fast-check bytesInOutput = 223,587B Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…293744 Add conditions:['import'] to node + browser esbuild configs (local override) so effect resolves dist/esm/* instead of dist/cjs/*, letting the tree-shaker drop most of fast-check (pulled in unconditionally by cjs Schema.js). Measured (output format stays CJS; no import.meta / ESM syntax in output): - effect resolution: dist/cjs/* -> dist/esm/* - node dist/index.js: 1,447,135B -> 698,929B (-51.7%) fast-check bytesInOutput: 234,890B -> 47,189B (-79.9%) - web dist/web/index.js: 1,422,362B -> 719,525B (-49.4%) fast-check bytesInOutput: 223,587B -> 51,876B (-76.8%) fast-check reduced ~80%, NOT eliminated (effect/FastCheck.js barrel re-export + reachable fastCheck_.array in nonEmptyChunkArbitrary). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Verdict ACHIEVED, local-only. Node bundle 1,447,135B -> 698,929B (-51.7%), web 1,422,362B -> 719,525B (-49.4%); fast-check ~80% reduced (not eliminated). Both Playwright suites green. Shared-config promotion deferred to follow-up WI. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Extract shared effectEsmOverride spread into node + browser builds (was hand-copied conditions line in both). Use conditions:['import','module', 'default'] matching visualforce for fallback robustness. Clarify comment: cjs output format comes from shared configs, not this file. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…g - W-23293744 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…shrink-org-browser-bundle-via-esbuil
Contributor
Author
|
/ai-auto approve |
peternhale
approved these changes
Jul 6, 2026
peternhale
left a comment
Contributor
There was a problem hiding this comment.
Peer-approved on behalf of @mshanemc per /ai-auto approve
This was referenced Jul 8, 2026
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.
Summary
effect's ESM build (conditions:['import','module','default']) instead of CJS for org-browser, letting the tree-shaker drop most of the bundledfast-checkdependency.dist/index.js: 1,447,135B → 698,929B (-51.7%); fast-check bytesInOutput 234,890B → 47,189B (-79.9%).dist/web/index.js: 1,422,362B → 719,525B (-49.4%); fast-check bytesInOutput 223,587B → 51,876B (-76.8%). Output stays CJS (noimport.meta/ESM syntax leaked). Change scoped locally to org-browser; shared bundling config (16 consumers) left untouched pending follow-up WI.Plan
.claude/plans/W-23293744.md
What issues does this PR fix or reference?
@W-23293744@
🤖 Generated by auto-build pipeline. Original WI: https://gus.lightning.force.com/lightning/r/ADM_Work__c/a07EE00002dnRRSYA2/view