Skip to content

chore(crud): move shell bson parser into a webworker - #8260

Draft
gribnoysup wants to merge 1 commit into
mainfrom
poc-shell-bson-parser-webworker
Draft

chore(crud): move shell bson parser into a webworker#8260
gribnoysup wants to merge 1 commit into
mainfrom
poc-shell-bson-parser-webworker

Conversation

@gribnoysup

Copy link
Copy Markdown
Collaborator

Something we discussed with Anna multiple times, I wanted to see how hard it would be to do. This patch is a quick POC that moves shell-bson-parser usage into a WebWorker to isolate it from the main renderer process of the app. This small change works fine, but a bunch of extra things need to be addressed for this to be considered ready:

  • A couple of other places use shell-bson-parser directly, so those should also be refactored
    • Worth noting that this changes the interface to be async, so while this one small change wasn't affected much, it might be that more code would need to be adjusted for other cases where we expect the parsing to happen synchronously
    • As this takes quite a setup to wire it all together, we should probably consolidate wrapping the parser in one place and re-export
  • mongodb-query-parser uses shell-bson-parser internally, so we will have to re-asses the usage: should probably use just one library for this functionality instead of two where one of them is just wrapping another
  • Using a WebWorker like that breaks loading localhost version of compass-web in deployed cloud environments (can't load a worker script from http when on https page), need to find a workaround for that for localdev (maybe can force inline the whole script in the url?)

Comment thread packages/compass-crud/src/utils/parse-shell-bson-worker.ts Dismissed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants