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 importThis is a targeted fix for a Turbopack-specific bundler issue. The change is small and well-reasoned. What the fix doesBy constructing the module specifier as Positives
Minor concern: inline type annotation lengthThe type annotation on line 31 is quite long and wraps awkwardly: ({ SqliteVfsPool }: { SqliteVfsPool: new (opts: { actorsPerInstance: number; idleDestroyMs: number }) => { acquire(actorId: string): Promise<ISqliteVfs>; shutdown(): Promise<void> } }) =>Since the file already imports type SqliteVfsPoolCtor = new (opts: { actorsPerInstance: number; idleDestroyMs: number }) => {
acquire(actorId: string): Promise<ISqliteVfs>;
shutdown(): Promise<void>;
};
this.#poolPromise = import(specifier).then(
({ SqliteVfsPool }: { SqliteVfsPool: SqliteVfsPoolCtor }) =>
new SqliteVfsPool({ actorsPerInstance: poolConfig.actorsPerInstance, idleDestroyMs: poolConfig.idleDestroyMs }),
);This is a readability nit only — the current code is functionally correct. Questions / considerations
SummaryThe fix is correct and well-commented. The only suggestion is a minor readability improvement on the inline type annotation. LGTM. |

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: