Last 12 weeks · 16 commits
5 of 6 standards met
Changes In this PR I’ve expanded the option to support a new string value, . This allows users to enable JSX style whitespace stripping in Astro. Handy for folks like me who often pair Astro and React. No more mental shift when jumping between components… all my JSX code looks and behaves the same way. If you all are more curious about rationale, please let me know, I’ve got more to say about the topic but didn’t want to clog up the PR description. The JSX spec unfortunately doesn’t specify how whitespace is dealt with in JSX, but JS tooling has landed on Babel’s whitespace handling as a kind of standard. The implementation is heavily inspired by esbuild’s JSX whitespace handling, which is an exact implementation of TypeScript’s JSX whitespace handling, which in turn is an implementation of Babel’s whitespace handling. I did this work with some serious assistance from Claude Code + Opus, but I have read each line of code and gone through the tests as well. Testing New tests added Docs Docs updated, PR link coming soon
Repository: withastro/compiler. Description: The Astro compiler. Written in Go. Distributed as WASM. Stars: 635, Forks: 92. Primary language: Go. Languages: Go (84%), TypeScript (15.9%), Dockerfile (0.1%), Makefile (0%). Latest release: @astrojs/compiler@2.13.1 (3w ago). Open PRs: 16, open issues: 81. Last activity: 1w ago. Community health: 87%. Top contributors: natemoo-re, github-actions[bot], matthewp, drwpow, MoustaphaDev, Princesseuh, bluwy, ematipico, jasikpark, delucis and others.
Changes This PR rewrites our compiler from scratch in Rust using a oxc-based parser. The Astro parser for oxc is available to review here: https://github.com/Princesseuh/oxc/pull/2 Fixes #1077 Fixes #1069 Fixes #1049 Fixes #920 Fixes #984 Fixes #988 Fixes #983 Fixes #966 Fixes #958 Fixes #945 Fixes #944 Fixes #913 Fixes #893 Fixes #876 Fixes #723 Fixes #724 Fixes #622 Fixes #554 Fixes #432 Fixes #1116 Fixes #1096 Fixes #1046 Fixes #1009 Fixes #971 Fixes #778 Fixes #725 Fixes #811 Fixes #1110 Fixes #1117 Fixes #643 Fixes #1124 Fixes #982 Fixes #868 Fixes #946 Fixes #1015 Fixes #715 Fixes #1091 Fixes #1095 Fixes #1089 Fixes #914 Fixes #506 Fixes #854 Fixes #996 Fixes #980 Fixes #1086 Fixes #911 Fixes #341 Fixes #729 Fixes #960 Fixes #1122 Fixes #1048 Fixes #1129 Fixes #1045 Fixes #956 Fixes #852 Fixes #893 Testing Both the codegen and the parser have a lot of tests, even more so than the Go compiler. Docs
Changes Adjusts astro compiler to adhere to JSX semantic prop overrides. Manually overriding like that is a rare occurance, but consider this far more common issue Testing Added both ts and go tests for testing the compiler (parser/printer) for deduping various example and cornercases like svg namespaces, multiple spreads, etc. Tested via standard test workflow: Docs Doesn't require any direct documentation changes imho, but does require a breaking change notice in the changelog / announcement post of the version (even though majority of users should be unaffected by this change) Closing remarks Full disclosure, I have very limited experience. I did my best to address the necessary changes in a meaningful and performant way, but I wanted to make it explicitly clear -- My expertise is TypeScript with a hobbylang of Rust, so just so we're on the same page -- I did use AI to help me get this PR over the finish line to make up for my lack of go knowledge. I did my best to verify everything and write a comprehensive test suite for it, but it is more than likely that there may be something suboptimal given the scope of the compiler, the fact that it's my first change and that I have very limited go experience from a single sideproject ~2 years ago. Either way hopefully this should serve as a solid starting point and wanted to deliver you guys'n'gals bit of an early christmas present for all the hard work you've been putting in all this time. Have wonderful holidays 🎄 [ ] Closes https://github.com/withastro/astro/issues/11920
Changes Separates from transition detection in internal/transform/transform.go. + transition scope are now only set when , , or are present. Keeps head propagation for without enabling transition behavior. Adds regression coverage in internal/transform/transform_test.go for: only → no transition flag, head propagation enabled transition directive cases → transition flag + head propagation enabled Closes #1148 Testing Added new tests in internal/transform/transform_test.go to cover the updated transition/head-propagation behavior. Ran . Result: passing. Docs No public docs updated (internal compiler behavior fix + test coverage)
Astro Info If this issue only occurs in one browser, which browser is a problem? _No response_ Describe the Bug I'm not using ViewTransitions / ClientRouter. But when I have a component loaded on a page with , the viewtransitions.css file gets loaded. What's the expected result? I'm not using it, so it shouldn't be loaded. Unless server deferred components depend on view transitions. Link to Minimal Reproducible Example https://stackblitz.com/edit/github-bxkihzxf?file=src%2Fpages%2Findex.astro Participation [ ] I am willing to submit a pull request for this issue.