document behavior of script tags in JSX expressions#3111
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
I'm not sure why my specific review was asked for, but this looks good to me 👍 I wonder if there would be value in documenting workarounds, though those also come with caveats |
|
I'm sorry if the ping was too broad, but glad to hear it looks good |
|
Give me some time to think about this, @MoustaphaDev , because you've changed the focus of the note now away from the idea of adding an attribute to a script tag (and them what happens when you do that), and it now is starting to list different things that happen to have the same effect / end result, putting the focus on the things that make scripts not bundled. It's a subtle difference, but it really does change the original note's purpose. So, I've been thinking about how to best include this new information. |
|
I understand, I've seen the use of two consecutive admonitions in some pages of the docs. We can document this addition in a “warning” block maybe? |
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
What kind of changes does this PR include?
Description
Closes withastro/astro#6905
Scripts inside JSX expressions are treated as inline scripts tags. I believe this is because the compiler doesn't extract these scripts because we wouldn't be able to know whether or not to include them in the head until the component template is run.
All these scripts will be inline scripts