Scripts and Event Handling: elaborate on module scripts#4974
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
sarah11918
left a comment
There was a problem hiding this comment.
Some really nice additions here, @lilnasy ! See my comments below and let's see if we can really get this just right!
| ``` | ||
|
|
||
| To avoid bundling the script, you can use the `is:inline` directive. | ||
| #### All processed scripts become module scripts |
There was a problem hiding this comment.
| #### All processed scripts become module scripts | |
| #### module scripts by default | |
| All scripts processed and bundled by Astro become module scripts by default. |
This feels more like a "key fact" than a "section heading". Can we have a more generic heading that is like a "thing", and then lead with the key fact?
Alternatively, this might mean that this really isn't its own section at all? (Or, the section is "advantages of ..."? Consider whether this really is A. Section. I kind of think maybe it's not?
Also, since this sentence then becomes kind of short, we can through "bundled" in here again because we do use that word a lot, and the reinforcement of terms people use/are familiar with helps.
There was a problem hiding this comment.
What do you think about "Why type=module" as the heading? It is introduced as a bullet point a couple of lines above.
There was a problem hiding this comment.
I don't love the "why" part but I like type=module better than anything so far.
Not everything needs to be a heading, and I'm trying to think of justification for this. Headings are useful for navigation, for separating content sections, and as visual breaks. Given that this is a list, we already have some natural visual break for the eyes.
I'm still not convinced this "section" is anything more than how Astro processes your scripts. This still seems content-wise to be in that category.
And, it's not awesome practice for content/navigation to use questions as headers. When people are scanning, they want to know what this section is about. I think the most appropriate heading, if in fact we do need one (which I still am not convinced we do!) is "type-module benefits" -- that is what this section is about.
There was a problem hiding this comment.
It does not have to be a section. I'd be happy with just a sentence that introduces the list.
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
sarah11918
left a comment
There was a problem hiding this comment.
Another fine contribution! 🚀
Description
Clarify a few common points of confusion regarding processing of scripts.
Related issues & labels
None
Direct link to preview
https://deploy-preview-4974--astro-docs-2.netlify.app/en/guides/client-side-scripts/#script-processing