-
Notifications
You must be signed in to change notification settings - Fork 124
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
Static text not present in output when using universal #155
Comments
Is there something else in the toolchain doing this? More complicated example? Just wondering because I can't seem to reproduce this in the tests. |
I believe dom expressions is doing the right thing but it hands a template literal without a cooked value to Babel which will try to transform the literals and fail. I'm not sure how you would repro this in tests without adding the template literal plug-in to the transform chain. Maybe an end to end test. |
@nksaraf keep me honest here, but I believe you chose template literals so you wouldn't need to safe encode the value, as |
I think that might have been the reason.. I'm sorry I don't remember exactly.. |
This is a repro using only Babel. If you go to So you would need a test that chains the template literal plugin into the mix. |
@ryansolid could repro in tests if you use the transform plugin: |
This issue seems to be fixed, I tested the code provided in the zip and both versions output the desire text. |
Summary
When using the
generate: 'universal'
mode of the babel plugin, templates in the form of<element>Static text</element>
will not produce the correct output, omitting the static text.Details
When examining the output of the
universal
renderer, the generated code for static text is not including the raw text passed as child to the elements.The expected output for
<element>Static text</element>
would be similar to:but since 0.33.0 (reflected in babel-plugin-solid 1.3.6), the output I see is
Further investigation points to an issue with babel that won't produce the right output, and that matches the input
dom-expressions
started to give in 0.33.0: babel/babel#14682, more specifically:A workaround would be to revert that transform to use
stringLiteral
with thehtmlentities
decoding as previously done.The text was updated successfully, but these errors were encountered: