Update guides/client-side-scripts/ #11165
OliverSpeir
started this conversation in
Ideas
Replies: 2 comments
-
Maybe this would be a fun talking and docing project |
Beta Was this translation helpful? Give feedback.
0 replies
-
Also think it would be good to add something like guides/styling/#bundle-control to this page explaining about inlining, like the inline limit and what happens after it’s reached |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://docs.astro.build/en/guides/client-side-scripts/
Here are some of the things I've noticed about this page that I think could be updated to fall more inline with Astro docs style guide and be more correct
There are a lot of Notes that I think could be upgraded to actual content
#client-side-scripts section could be omitted and possibly have some of its content moved into a second paragraph in the overview as it seems to function as an overview to me
The first sentence implies that
<script>
s in Astro are standard HTML scripts which they are not, Astro does magic here with its processingImprovements to #script-processing
<script>
s are typescript by default, and you will get lint errors unless you opt out of ts checking themtype="module"
addedThe entire section starting at "The type="module" attribute makes the browser treat the script as a JavaScript module. This has several performance benefits:" is not actually Astro specific and we are venturing into the realm of teaching how HTML and JS actually work, which is fine but I think since this page was written we've shifted the style guide to a harder line of only including astro specific elements. Maybe we could link to some resources ( MDN, HTML spec etc )
type="module"
scripts are external, which they were always when this was written (v4 astro hoisted and didn't inline scripts) and so some of the information is misleading#common-script-patterns is a lot of non astro specific content
Beta Was this translation helpful? Give feedback.
All reactions