Skip to content

test(chore): investigate removing barrel files to see if import times during test transpilation improves#1401

Draft
filmaj wants to merge 23 commits into
mainfrom
barreled
Draft

test(chore): investigate removing barrel files to see if import times during test transpilation improves#1401
filmaj wants to merge 23 commits into
mainfrom
barreled

Conversation

@filmaj

@filmaj filmaj commented Jun 29, 2026

Copy link
Copy Markdown
Member

Description

WIP

What to review

Testing

@filmaj filmaj self-assigned this Jun 29, 2026
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — @sanity/cli

Compared against main (277c65c6)

@sanity/cli

Metric Value vs main (277c65c)
Internal (raw) 2.3 KB +63 B, +2.8%
Internal (gzip) 872 B +34 B, +4.1%
Bundled (raw) 11.16 MB +42 B, +0.0%
Bundled (gzip) 2.10 MB -178 B, -0.0%
Import time 320ms -541ms, -62.8%

bin:sanity

Metric Value vs main (277c65c)
Internal (raw) 782 B -
Internal (gzip) 423 B -
Bundled (raw) 9.87 MB -
Bundled (gzip) 1.78 MB -
Import time 2.27s +28ms, +1.2%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — @sanity/cli-core

Compared against main (277c65c6)

Metric Value vs main (277c65c)
Internal (raw) 108.1 KB -
Internal (gzip) 27.0 KB -
Bundled (raw) 21.72 MB -
Bundled (gzip) 3.46 MB -
Import time 757ms -24ms, -3.0%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — create-sanity

Compared against main (277c65c6)

Metric Value vs main (277c65c)
Internal (raw) 908 B -
Internal (gzip) 483 B -
Bundled (raw) 931 B -
Bundled (gzip) 491 B -
Import time ❌ ChildProcess denied: node -
Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Coverage Delta

File Statements
packages/@sanity/cli-build/src/actions/build/buildDebug.ts 100.0% (±0%)
packages/@sanity/cli-build/src/actions/build/buildStaticFiles.ts 32.5% (±0%)
packages/@sanity/cli-build/src/actions/build/resolveVendorBuildConfig.ts 5.1% (±0%)
packages/@sanity/cli/src/actions/build/buildApp.ts 94.4% (±0%)
packages/@sanity/cli/src/actions/build/buildStudio.ts 94.7% (±0%)
packages/@sanity/cli/src/actions/build/determineBasePath.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/build/handlePrereleaseVersions.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/dev/devAction.ts 76.9% (±0%)
packages/@sanity/cli/src/actions/dev/servers/startAppDevServer.ts 96.8% (±0%)
packages/@sanity/cli/src/actions/init/initAction.ts 89.8% (±0%)
packages/@sanity/cli/src/actions/manifest/debug.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/manifest/extractCoreAppManifest.ts 93.9% (±0%)
packages/@sanity/cli/src/actions/manifest/extractManifest.ts 6.3% (±0%)
packages/@sanity/cli/src/actions/manifest/extractStudioManifest.ts 20.0% (±0%)
packages/@sanity/cli/src/actions/manifest/writeManifestFile.ts 22.2% (±0%)
packages/@sanity/cli/src/util/appId.ts 68.4% (±0%)
packages/@sanity/cli/src/util/compareDependencyVersions.ts 100.0% (±0%)
packages/@sanity/cli/src/util/determineIsApp.ts 75.0% (±0%)
packages/@sanity/cli/src/util/getSharedServerConfig.ts 100.0% (±0%)
packages/@sanity/cli/src/util/packageManager/packageManagerChoice.ts 66.1% (±0%)
packages/@sanity/cli/src/util/packageManager/upgradePackages.ts 0.0% (±0%)
packages/@sanity/cli/src/util/resolveReactStrictMode.ts 100.0% (±0%)
packages/@sanity/cli/src/util/warnAboutMissingAppId.ts 100.0% (±0%)
packages/@sanity/workbench-cli/src/actions/build/vite/plugin.ts 4.3% (±0%)
packages/@sanity/workbench-cli/src/actions/build/vite/workbench-vite-plugins.ts 100.0% (±0%)
packages/@sanity/workbench-cli/src/actions/deploy/getWorkbench.ts 100.0% (±0%)
packages/@sanity/workbench-cli/src/actions/dev/appServerSupervisor.ts 100.0% (±0%)
packages/@sanity/workbench-cli/src/actions/dev/deriveInterfaces.ts 100.0% (±0%)
packages/@sanity/workbench-cli/src/actions/dev/registry.ts 4.3% (±0%)
packages/@sanity/workbench-cli/src/actions/dev/startDevManifestWatcher.ts 89.4% (±0%)
packages/@sanity/workbench-cli/src/actions/dev/startDevServerRegistration.ts 100.0% (±0%)
packages/@sanity/workbench-cli/src/actions/dev/startWorkbenchDev.ts 79.3% (- 1.7%)
packages/@sanity/workbench-cli/src/actions/dev/startWorkbenchDevServer.ts 89.1% (±0%)
packages/@sanity/workbench-cli/src/resolveWorkbenchApp.ts 100.0% (±0%)

Comparing 34 changed files against main @ abb240068ba4284625a7e5998a087313b8271d33

Overall Coverage

Metric Coverage
Statements 74.3% (- 0.0%)
Branches 64.2% (+ 0.0%)
Functions 68.4% (- 0.3%)
Lines 74.9% (- 0.0%)

@filmaj filmaj force-pushed the barreled branch 5 times, most recently from 91bf3fc to dcc8014 Compare July 6, 2026 12:45
filmaj added 2 commits July 6, 2026 13:40
add mock modules for cli-core to cli-test

test(chore): use import for vi.mock, some more import hygiene

test(chore): enable reporting import times during test runs

test(chore): do very granular exports, use them wherever possible

test(chore): the great unbarreling continues

test(chore): mock out workbench cli build module in buildapp test

test(chore): fix up test mocks for buildStudio test

test(chore): fix up buildstudio tests

test(chore): fix up comparedep tests

test(chore): fix up buildapp tests

test(chore): fix up workbench unit tests

test(chore): move module URL tests to the right place

test(chore): further chopping up cli-core and cli-build exports

test(chore): export buildStaticFiles

test(chore): fix up extract core tests

test(chore): fix up build studio tests, export some more stuff from cli-build

test(chore): fix up build studio tests

test(chore): fix up build app tests

test(chore): reorganizing cli-core exports, cli tweaks too

test(chore): reorganizing cli-core exports

test(chore): tweaking cli-core exports, workbench-cli to use the fine-grained exports of cli-core

test(chore): remove workbench dev tests in the wrong module

test(chore): fix up remaining workbench tests

test(chore): we dont need cli buildstudio tests anymore really

test(chore): unbarrelinngggggg

test(chore): new export for cli-core

test(chore): cli-core UNBARRELEDDDD

test(chore): add mock output creation helper function to cli/test export. test fixups

test(chore): post-barreling test/mock fixup

test(chore): post-barreling test/mock fixup, expanding cli-test exports with paths util

test(chore): post-barreling test/mock fixup, different way of wedging in mock sanity command

test(chore): speed up imports in test

test(chore): dont do coverage in integration tests, dont use snapshots in unit

test(chore): dataset export tests

refactor(chore): move debug to _exports in cli-core

refactor(chore): big cli-core export reorg

refactor(chore): big cli-core export reorg consumption side

refactor(test): proving out mock modules provided by cli-test

refactor(test): more mocks to cli-test, more tests converted

refactor(test): more tests converted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant