Skip to content

Comments

feat: add new experimental Rust compiler#15543

Merged
Princesseuh merged 17 commits intomainfrom
feat/rust-compiler
Feb 23, 2026
Merged

feat: add new experimental Rust compiler#15543
Princesseuh merged 17 commits intomainfrom
feat/rust-compiler

Conversation

@Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Feb 16, 2026

Changes

Adds a new experimental flag to use the Rust compiler instead of the Go one. This requires users to install @astrojs/compiler-rs in their project manually.

Testing

I edited some tests so that they pass on both the old and the new compiler:

  • Two tests had invalid HTML
  • LightningCSS does some CSS stuff slightly differently, and not all the minification options are currently enabled in the new compiler because of some issues so I had to change the asserts

Apart from that, I believe that all tests pass on both compilers.

Docs

There's a JSDoc and withastro/docs#13303

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: 1255d5f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: example Related to an example package (scope) pkg: astro Related to the core `astro` package (scope) docs pr labels Feb 16, 2026
@github-actions github-actions bot removed the pkg: example Related to an example package (scope) label Feb 16, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 19, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing feat/rust-compiler (fc2b0bf) with main (35bc814)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (3252a25) during the generation of this report, so 35bc814 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see where tests are updated. I don't see tests that use the new experimental flag

@Princesseuh
Copy link
Member Author

I can't see where tests are updated. I don't see tests that use the new experimental flag

There are no tests using the flag, I just updated them so that they can run in local. I can add a test using it, I guess

@ematipico
Copy link
Member

Yes please, I would like to see some tests. Especially the error around unclosed tags, which is part of the expectations of the new compiler

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RUST. RUST. RUST. Incrabible work, @Princesseuh !

Just a sample of what I think we could add to the changeset that I think is helpful!

*/
svgo?: boolean | SvgoConfig;

/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noting that it's expected that there's no @docs tag here for an experimental feature! Everything is documented on the experimental docs page!

Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved by me! Ready for @yanthomasdev !

Copy link
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just two small nits and we are done! 🦀

Princesseuh and others added 2 commits February 23, 2026 23:56
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
@Princesseuh Princesseuh merged commit d43841d into main Feb 23, 2026
14 checks passed
@Princesseuh Princesseuh deleted the feat/rust-compiler branch February 23, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs pr pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants