Faster startup (3/4): Inline app-init and hydrogen-init hooks#7053
Draft
gonzaloriestra wants to merge 1 commit intofaster-startup-2from
Draft
Faster startup (3/4): Inline app-init and hydrogen-init hooks#7053gonzaloriestra wants to merge 1 commit intofaster-startup-2from
gonzaloriestra wants to merge 1 commit intofaster-startup-2from
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Mar 19, 2026
b573cb7 to
e520d26
Compare
9adcd0c to
35d5a30
Compare
Replace re-exports from @shopify/app and @shopify/cli-hydrogen with inlined versions. app-init now lazily imports LocalStorage instead of pulling the entire @shopify/app chain (~1s). hydrogen-init skips loading @shopify/cli-hydrogen entirely for non-hydrogen commands (~300ms). Startup time: 710ms → 530ms (-25%) Made-with: Cursor
35d5a30 to
ea5104e
Compare
e520d26 to
d67ea57
Compare
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.

WHY are these changes introduced?
The CLI requires too much time to start working, it feels slow
WHAT is this pull request doing?
Replaces the re-export hook stubs from PR 1/4 with inlined implementations that avoid loading heavy package dependency chains.
app-init.ts: lazily importsLocalStorageinstead of pulling in the entire@shopify/appchain (~1s of imports). Uses Node's nativecrypto.randomUUID()instead of importing from cli-kithydrogen-init.ts: skips loading@shopify/cli-hydrogenentirely for non-hydrogen commands (~300ms+ saved). Only loads the module whenoptions.idstarts withhydrogen:Startup time: 710ms → 530ms (-25%)
How to test your changes?
shopify app devstill initializes correctly (LocalStorage cleared, run ID set)shopify hydrogen devstill runs hydrogen init hookMeasuring impact
Checklist
Made with Cursor