Skip to content

Add support for WebWorker with worker-plugin #5464

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

Closed
wants to merge 1 commit into from
Closed

Add support for WebWorker with worker-plugin #5464

wants to merge 1 commit into from

Conversation

Krivega
Copy link

@Krivega Krivega commented Oct 17, 2018

Closes #3660

I used to test a simple example of the test plugin

// index.js

const worker = new Worker('./worker', { type: 'module' });

worker.onmessage = ({ data }) => {
  console.log('page got data: ', data);
};

worker.postMessage('hello');
// worker.js

import { foo } from './dep';

console.log('hello from worker');

addEventListener('message', ({ data }) => {
  console.log('worker got message', data);

  if (data === 'hello') {
    postMessage(foo);
  }
});
// deep.js

export const foo = 'bar';

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@iansu
Copy link
Contributor

iansu commented Oct 17, 2018

There is an existing PR that's very similar here: #3934

In the thread for #3660 there were some issued raised about browser compatibility with worker-plugin which I think need to be investigated.

@Krivega
Copy link
Author

Krivega commented Oct 18, 2018

@iasu right, I'll try to fix it in the plugin and then try again

@Krivega Krivega closed this Oct 18, 2018
@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants