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

Temporarily ignore transfer/options argument in postMessage() #10617

Closed
101arrowz opened this issue May 12, 2021 · 3 comments
Closed

Temporarily ignore transfer/options argument in postMessage() #10617

101arrowz opened this issue May 12, 2021 · 3 comments
Labels
suggestion suggestions for new features (yet to be agreed) web related to Web APIs

Comments

@101arrowz
Copy link

101arrowz commented May 12, 2021

I maintain a package that targets Node.js and the browser. I'm currently trying to make the browser target compatible with Deno.

The main incompatibility is the use of inline workers. My package dynamically generates JS, embeds it into a temporary URL, and creates a worker from it. v1.9 added support for blob URLs, and v1.10 has fixed the structured cloning algorithm; thanks to the Deno team for your hard work on the project.

My package is actually very close to working on v1.10, but I'm facing the issue that postMessage(msg, transfer) fails:

Uncaught Error: Not yet implemented: `transfer` and `options` are not supported.`

I've seen #8341, but I'm specifically requesting that until support for transfer is added, the argument is simply ignored. Obviously, the difference between transferring ownership and cloning is massive internally, but the only effect it has from JS's point of view is that the object is inaccessible from the parent thread. Of course, if implementing #8341 is not too difficult, there's no need for this stop-gap solution.

@aaronhuggins
Copy link

Commenting to watch the discussion on this issue as it impacts a project with similar worker patterns I am developing.

@kitsonk kitsonk added suggestion suggestions for new features (yet to be agreed) web related to Web APIs labels May 13, 2021
@kitsonk
Copy link
Contributor

kitsonk commented May 13, 2021

@lucacasonato thoughts? I can see how this is a pain to write isomorphic code.

@bartlomieju
Copy link
Member

bartlomieju commented Aug 4, 2021

This is now implemented, both transfer and options are supported in postMessage()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion suggestions for new features (yet to be agreed) web related to Web APIs
Projects
None yet
Development

No branches or pull requests

4 participants