docs: add Astro language documentation#905
Conversation
WalkthroughAdded a complete Astro language documentation page and updated multiple starter templates to use dynamic title generation and refine DOM/input/output/button handling within template scripts. No public API changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant UI as Template UI
participant TS as Template Script
participant DOM as Output/Buttons
U->>UI: enter input / click Run
UI->>TS: pass input (trimmed/normalized)
alt successful run
TS->>DOM: update output text
TS->>DOM: set button state ("Run" -> "Running" -> "Run")
else error
TS->>DOM: display error message
TS->>DOM: reset button state
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for livecodes ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
functions/vendors/templates.js (1)
1326-1353: Simplified to stdin/stdout pattern but removed goroutine demo.The rewritten Go code effectively demonstrates stdin/stdout interaction with WASM, making it simpler and more focused. However, the original version included a goroutine example (
go greet()at line 1166) that demonstrated Go's concurrency features working in WASM, which was a valuable learning point.Consider whether the goroutine demonstration should be preserved in a comment or additional example section.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/docs/languages/astro.mdx(1 hunks)functions/vendors/templates.js(8 hunks)
🔇 Additional comments (11)
docs/docs/languages/astro.mdx (5)
1-2: LGTM! Clear and accurate introduction.The description accurately captures Astro's core philosophy and architecture.
52-59: LGTM! Well-structured language metadata.The language information section provides clear and useful metadata for developers.
62-84: LGTM! Clear formatting and configuration guidance.The sections provide accurate information about code formatting and configuration options.
87-106: LGTM! Clear and practical examples.Both static and dynamic examples effectively demonstrate Astro's core patterns.
110-117: All external links verified and accessible.The Official Resources section passes verification. All five links (documentation, GitHub repository, StackBlitz playground, blog, and Discord community) are live and accessible.
functions/vendors/templates.js (6)
696-696: LGTM! Consistency fix for template formatting.Adding
.trimStart()ensures consistent whitespace handling across all templates.
1199-1199: LGTM! More descriptive title.Changing the title from a generic greeting to "Go (Wasm)" immediately clarifies the technology being demonstrated.
1232-1255: LGTM! Well-structured WASM interaction pattern.The JavaScript code properly demonstrates stdin/stdout interaction with Go WebAssembly, including proper async handling and error checking.
1474-1474: LGTM! Consistency fix.Adding
.trimStart()maintains consistency with other templates.
1646-1646: LGTM! Consistency fixes for Jest and jQuery templates.Adding
.trimStart()to both templates maintains consistency across the codebase.Also applies to: 1672-1672
3956-3956: LGTM! Final consistency fix.Completes the pattern of ensuring all template content strings properly call
.trimStart().
|
Thank you, @nhussein2026 Please change the dynamic example to something like this, since LiveCodes currently does not support files (e.g. ---
const res = await fetch('https://jsonplaceholder.typicode.com/users/1');
const data = await res.json();
---
<h1>Hello {data.name}!</h1>Also, LiveCodes uses a relatively old Astro compiler v0.9.2 You may want to add a link to Astro starter template |
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
docs/docs/languages/astro.mdx (1)
33-49: Clarify: API endpoint example may not work in LiveCodes; align with reviewer feedback.The past review feedback noted that "LiveCodes does not support project files (e.g.,
src/pages/api/)" and suggested focusing on an inline Astro example instead. While the inline fetch example (lines 43–49) correctly implements the suggestion, the API endpoint example (lines 33–39) preceding it documents a pattern that won't execute in LiveCodes.Consider either:
- Removing the API endpoint section entirely and keeping only the inline example (lines 43–49), or
- Clarifying that the endpoint pattern is for reference but won't work in LiveCodes' current constraints.
🧹 Nitpick comments (1)
docs/docs/languages/astro.mdx (1)
59-61: Minor: Clarify version information positioning.The "Version: Latest (v4.x and above)" (line 59) is immediately followed by a caveat that LiveCodes uses v0.9.2. While the warning is present, the placement can confuse readers who see "Latest" and only later discover the actual version constraint.
Consider reframing line 59 to "Version: v0.9.2 (Docs for v4.x)" or moving the caveat warning earlier in the Language Info section for better clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/docs/languages/astro.mdx(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Redirect rules - livecodes
- GitHub Check: Header rules - livecodes
- GitHub Check: Pages changed - livecodes
🔇 Additional comments (1)
docs/docs/languages/astro.mdx (1)
90-122: Documentation structure and examples look solid.The Example Usage and Official Resources sections are well-organized, include appropriate static and dynamic examples, and provide comprehensive resource links including the LiveCodes starter template. Code formatting is consistent, and examples are practical.
|
Thank you @nhussein2026 |
|



What type of PR is this? (check all applicable)
Description
This PR adds documentation for the Astro framework under the supported languages section.
It explains both Static (pre-rendered) and Dynamic (server-rendered) modes, includes configuration examples, language details, and usage snippets.
The content follows the same structure and style as the existing art-template documentation to maintain consistency across language docs.
Related Tickets & Documents
Fixes #769
#769
Mobile & Desktop Screenshots/Recordings
No visual changes.
Added tests?
Added to documentations?
[optional] Are there any post-deployment tasks we need to perform?
None.
[optional] What gif best describes this PR or how it makes you feel?
Summary by CodeRabbit
Documentation
Chores