-
Notifications
You must be signed in to change notification settings - Fork 112
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
Offscreen db #316
Offscreen db #316
Conversation
✔️ No visual differences introduced by this PR. View Playwright Report (note: open the "playwright-report" artifact) |
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.
this looks good. i tested scanning with dictionary media on chrome and firefox and nothing seems broken.
@jbukl Feel free to mark this PR as ready for review, I think it's good enough to merge assuming that it's working! |
checked the payloads in the offscreen handlers - had a typo in text replacements, and realized that serializing and deserializing RegExp isn't as simple as just for now I just used an example from SO, but something like https://github.com/yahoo/serialize-javascript could be good if we want to centralize all the serialization (i.e. of ESM |
39332f7
to
29ba4c0
Compare
moving db from sw to offscreen
originally I was planning on just reflecting all of the methods/handlers for dictionaryDatabase and keeping translator in SW, but I ended up just moving translator as well and manually writing all of the methods/handlers once I realized several methods would actually need explicit serialization. I don't really like how it currently looks - it feels like service-worker.js is really unwieldy with how many methods are in it. The bunch of message handlers is also irritating.
I also don't like the need to serialize - it might be possible to avoid some of it though through a refactor, but I'm mixed on what to do because it would probably mean more duplicated code because of firefox support. generic serializing could be better rather than in each handler.
haven't tested thoroughly - stuff could be broken.