-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Worklet support #5837
Worklet support #5837
Conversation
|
|
||
export default (new Transformer({ | ||
transform({asset}) { | ||
asset.symbols.clear(); |
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.
Can you give us some context about why this plugin is necessary?
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.
@mischnic perhaps you could speak to this?
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.
I'm not really sure how this.#value.symbols
is used, the worklet or worker will likely not be able to share dependencies with the main javascript thread (for now) so I'm curious if this is an attempt to prevent the asset from having additional globals or other dependencies incorrectly bundled into the asset during packaging?
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 is purely to workaround the foo.js does not export 'default'
error when doing import x from "worker:./foo.js"
, has nothing to do with shared bundles.
An alternative is special-casing asset.isIsolated
in the symbol propagation logic itself.
I wouldn't need this branch merged if I knew how to run parcel commands without having it mess with the dependencies, is there a flag for that? |
|
Cleared node modules and reinstalled, I'm getting lots of packaging headaches. I've also tried making the parcel repo a submodule (on the |
I haven't had any problems so far with adding a Parcel plugin to a monorepo, for example here: https://github.com/mischnic/parcel-resolver-root. |
Okay I got it working and it was really easy in the end:
and then I updated my monorepo config: // myProject/package.json
{
"workspaces": [
"packages/*", // mine
"parcel/packages/*/*" // yours
],
"dependencies": {
"parcel": "2.0.0-beta.1"
}
} The problem I had was I was previously using nightly releases, but the packages from So instead, I decided it's easier to treat the entire parcel dependency tree as a submodule that I can checkout whatever version I want. To get the dependency to work correctly, I had to ensure that my root I would recommend these instructions for simplicity and minimal dependency headache in the future ^ |
I should mention that the way you guys are setting up your dependencies on I would recommend peaking at your |
Sounds like #5816 |
Yup that looks like what I'm experiencing and it looks like it was fixed after this branch was created |
I rebased this branch on top of the latest v2 locally and tried building again but it's still showing up for me :/ any tips what I should be looking at? |
↪️ Pull Request
Support for worklets.
💻 Examples
import url from 'worklet:./my-worklet.js'
🚨 Test instructions
✔️ PR Todo