fix(rivetkit): prevent Turbopack from tracing sqlite-vfs dynamic import#4490
Conversation
|
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. |
|
🚅 Deployed to the rivet-pr-4490 environment in rivet-frontend
|
PR Review: fix(rivetkit) prevent Turbopack from tracing sqlite-vfs dynamic importSummaryThe fix is correct and the approach is a well-known workaround for bundlers that statically analyze dynamic import strings. Overall this is a good minimal change. IssuesInline type annotation is verbose and duplicates existing typeThe type annotation on line 31 is a very long one-liner that is hard to read. Worse, the return shape of SqliteVfsPool (acquire and shutdown) is already captured in the poolPromise field type at lines 9-13. These two definitions can drift silently. Consider extracting named local types SqliteVfsPoolInstance and SqliteVfsPoolCtor to avoid duplication, then reuse SqliteVfsPoolInstance in the field type too. Webpack and other bundlers may warn on computed specifierWebpack and other bundlers that perform static analysis of import() expressions will emit a warning when the specifier is not a string literal. This is usually just a warning and not a breakage, but worth validating that existing webpack/esbuild consumers do not regress. Nits
VerdictApprove with the suggestion to extract the inline type to improve readability and prevent future drift. The core fix is correct. |
0c1316c to
f04465b
Compare
9782f44 to
1bcf7a1
Compare

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: