feat: searched params attached to workers are now preserved#22280
Open
jurerotar wants to merge 2 commits into
Open
feat: searched params attached to workers are now preserved#22280jurerotar wants to merge 2 commits into
jurerotar wants to merge 2 commits into
Conversation
7 tasks
Member
switch(vfsName){
case 'opfs':
return new Worker(new URL("sqlite3-opfs-async-proxy.js?vfs=opfs", import.meta.url));
case 'opfs-wl':
return new Worker(new URL("sqlite3-opfs-async-proxy.js?vfs=opfs-wl", import.meta.url));
}To confirm, is this what you have in the source code? Is the expected build output to be like the following? switch(vfsName){
case 'opfs':
return new Worker(new URL("path-to-sqlite-worker.js?vfs=opfs", import.meta.url));
case 'opfs-wl':
return new Worker(new URL("path-to-sqlite-worker.js?vfs=opfs-wl", import.meta.url));
} |
Author
Correct! The worker internally relies on Since this PR was raised, we have managed to find a workaround. It currently works like this: const url = new URL('sqlite3-opfs-async-proxy.js', import.meta.url);
url.searchParams.set('vfs', vfsName);
return new Worker(url.toString());
|
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.
This PR adds support for preserving search params passed to workers. This means that user-provided search params are now appended next to vite-generated ones.
The reason we need this functionality is because we currently have a blocker in sqlite-wasm repository related to this. The short version is that certain database features rely on passing search params to workers on initialization. These search params are currently stripped.
You can find a more in-depth explanation of the issue we're attempting to resolve in this comment.