-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow using web worker RPC on embedded LGV #3276
Conversation
e028694
to
85801b1
Compare
e9f81d2
to
30ad46f
Compare
one way to isolate makeWorkerInstance even more would be to make it part of a separate package the user has to download to use. it is sort of convenient as is though, and also can be seen in the storybook which is kinda nice. we could try a release with just this PR's approach, and if it causes problems, could consider externalizing into another package |
can see result here https://jbrowse.org/storybook/lgv/rpc_embedded/?path=/story/linear-view--with-web-worker compare with loading the deep sequencing track on e.g. https://jbrowse.org/storybook/lgv/rpc_embedded/?path=/story/linear-view--one-linear-genome-view |
{ MainThreadRpcDriver: { type: 'MainThreadRpcDriver' } }, | ||
{ | ||
MainThreadRpcDriver: { type: 'MainThreadRpcDriver' }, | ||
WebWorkerRpcDriver: { type: 'WebWorkerRpcDriver' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if there is any reason to avoid just making the webworkerrpc config available, reduces the boilerplate in apps that want to use webworker rpc hence this diff
@@ -88,7 +88,6 @@ export default function RootModel( | |||
), | |||
savedSessionsVolatile: observable.map({}), | |||
textSearchManager: new TextSearchManager(pluginManager), | |||
pluginManager, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rider change, but this looked unused, and probably better to not have it unnecessarily. pluginmanager can/should be obtained from getEnv
30ad46f
to
7532cb6
Compare
7532cb6
to
eca0996
Compare
Codecov Report
@@ Coverage Diff @@
## main #3276 +/- ##
==========================================
- Coverage 59.52% 59.39% -0.14%
==========================================
Files 676 678 +2
Lines 28807 28859 +52
Branches 7041 7041
==========================================
- Hits 17148 17141 -7
- Misses 11385 11444 +59
Partials 274 274
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
modified now so that the "ES5" build (used in nodejs and bundlers that don't use the "module" field of package.json) don't have the makeWorkerInstance and the "ESM" (most bundlers) can use makeWorkerInstance |
maybe can merge and see how it goes :) |
This allows the user to manually configure web worker RPC for the embedded LGV. I sort of rushed as i ususally do to get this kind of wired up, but it seems to work. Can try the "deep_sequencing" track to see the difference in the storybook between the instance with webworker and without, the scroll jank much less affected on the webworker version
The web worker is not enabled by default, and is instead a manual process that the developer follows, because I do not want to make too many presumptions about the users bundler, and by making it a function (
makeWorkerInstance
) that they manually have to pull in to use, it would get easily tree-shaken and ignored and not cause build errors if they do not use the makeWorkerInstance functiona demo of this in the storybook actually appears to work as they use webpack 5, and looks like the below
fixes #2942