Improve performance for extension types generation#7747
Conversation
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260608100421Caution After installing, validate the version by running |
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260610101222Caution After installing, validate the version by running |
|
/snapit |
|
🫰✨ Thanks @gonzaloriestra! Your snapshot has been published to npm. Test the snapshot by installing your package globally: pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260611111520Caution After installing, validate the version by running |
isaacroldan
left a comment
There was a problem hiding this comment.
Review assisted by pair-review
96a37f8 to
2049a1d
Compare
| const {configPath, fileNames, hasExplicitFiles} = await loadTsConfig(fromFile, options.tsConfigCache) | ||
| if (!configPath || !hasExplicitFiles) return | ||
|
|
||
| if (!isWithinBoundary(configPath, extensionDirectory)) return |
There was a problem hiding this comment.
Can we remove this? Many apps share utils imported outside of the immediate extension folder and we'd be breaking that
| } | ||
|
|
||
| if ( | ||
| node.exportClause && |
There was a problem hiding this comment.
Can you make the type only check a reusable util?
| if (!resolvedPath.includes('node_modules')) { | ||
| resolvedPaths.push(resolvedPath) | ||
| } | ||
| resolvedPaths.push(resolvedPath) |
WHY are these changes introduced?
Re: https://community.shopify.dev/t/cli-type-generation-for-ui-extensions-reads-too-many-files-restrict-scanner-to-tsconfig-include-or-toml-entry/34957
UI extension type generation can recursively scan too many files, including external imports and files excluded by a project's TypeScript config. This can make
shopify app buildand app loading noticeably slower.WHAT is this pull request doing?
.d.tsfiles.tsconfig.jsonfiles/includelists when present.How to test your changes?
shopify app buildChecklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add