Fix/styles in vue sfc not injected to shadow dom#784
Conversation
…it in config file to bundle js file.
… then replace it in packager
|
Sorry, I've clicked a wrong button. |
|
@gogoend no worries, re-openning |
There was a problem hiding this comment.
This is very interesting - I assume you copied the js file from parcel upstream and pruned their flow type.
Any chance we can use their module directly, and do minor tweak if needed? (i.e via subclassing, or via referencing their exported functions?)
There was a problem hiding this comment.
Yeah, the file is from the dist file of https://github.com/parcel-bundler/parcel/blob/v2/packages/packagers/js/src/ScopeHoistingPackager.js .
There was a problem hiding this comment.
Can we use typescript for this file?
There was a problem hiding this comment.
Is this copied from upstream?
louisgv
left a comment
There was a problem hiding this comment.
I'm very intrigued by this PR - the ability to package a separate bundle for style and inject it directly into the transformer seems very powerful. It's a tad sad that the parcel upstream source is flow-based, forcing downstream consumer to resolve to a lot of module copy hack instead of import their stuff directly with typing lol..
Tho, we were able to pull some of their file. So maybe we can reduce the amount of tech debt/copied over code by doing something similar?
see: https://github.com/PlasmoHQ/plasmo/blob/main/core/parcel-core/src/index.ts#L6-L33
emmmm, in fact, I'm trying to do some explorations, and want to view the diff online, but choose the wrong repo, and open this PR by accident. Maybe I should view the diff in my forked repo . |
oh lol - feel free to do it however you like, not a bad PR at all. It helps with visibility too |
Details
This PR aims to fix the issue: The style tag in the nested component in content scripts doesn't take effect when using Vue SFC.
What I've done is:
VUE_SFC_STYLE_PLACEHOLDERwhen process thestyle-rawpipeline in parcel-transformer-vueCode of Conduct
Contacts
If your PR is accepted, we will award you with the
Contributorrole on Discord server.To join the server, visit: https://www.plasmo.com/s/d