-
Notifications
You must be signed in to change notification settings - Fork 49
How to distribute the runtime (normalizeComponent
and style injection code)?
#36
Comments
I'm not sure I have enough experience in the problem domain in this case. 😕 Or maybe I just don't fully understand the problem. @znck If you think it might also be helpful for other people, could you go into more detail on the problem, potential solutions, and their pros and cons as you understand them? |
Great job @znck , this seems to be the only thing left on the list! I'm at ScriptConf in Austria this week but will try to give this some proper thinking once I'm back. |
The A similar problem is faced inlining But inlining other runtime modules like If we rewrite runtime modules to have no imports and only default export, then converting them to IIFE would work. |
Some thoughts: when users use this compiler in inline mode, they likely want to handle the styles in a more flexible way... for example, in Jest transformer we don't really care about the styles. So instead of built-in style injection, in inline mode the user will be responsible for deciding what to do with the styles, maybe with an API like: {
handleStyles: styles => {
// do something with the compiled styles
// or return code that injects the styles (used in assemble)
}
} By default in inline mode styles will be ignored if this function is not provided. With styles out of the question, |
vue-component-compiler/src/assemble.js Lines 14 to 27 in 7024fb8
For inlining CSS, it assumes |
Not required anymore. The provided assemble method inlines everything. |
The text was updated successfully, but these errors were encountered: