Skip to content
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

removing init backend hack with polyfill #1

Open
kdabir opened this issue Oct 10, 2022 · 1 comment
Open

removing init backend hack with polyfill #1

kdabir opened this issue Oct 10, 2022 · 1 comment

Comments

@kdabir
Copy link

kdabir commented Oct 10, 2022

With Reference to the following Snippet:

import { initBackend } from 'absurd-sql/dist/indexeddb-main-thread';

function init() {
  let worker = new Worker(new URL('./index.worker.js', import.meta.url));
  // This is only required because Safari doesn't support nested
  // workers. This installs a handler that will proxy creating web
  // workers through the main thread
  initBackend(worker);
}

init();

WebKit has merged this PR, so soon we won't require the hack to initBackend.

Until that release is widely adopted, would this Polyfill help for safari?
https://github.com/johanholmerin/nested-worker

So, is it possible to remove this block and upgrade the code to directly create nested worker. This will greatly improve the DX.

@quolpr
Copy link
Contributor

quolpr commented Oct 11, 2022

@kdabir good idea! I will take a look soon

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

No branches or pull requests

2 participants