withastro / compiler

The Astro compiler. Written in Go. Distributed as WASM.
Other
502 stars 59 forks source link

Skip printing `createAstro` code if unused #1002

Closed bluwy closed 7 months ago

bluwy commented 7 months ago

Changes

Idea from https://github.com/withastro/astro/pull/10773#pullrequestreview-2005386326

If the Astro global is not used, we don't need to print code that calls createAstro. This saves on runtime execution as it's created but not used.


Perf:

Testing

Updated tests to handle cases where the createAstro code is no longer present.

Docs

n/a. internal improvement.

changeset-bot[bot] commented 7 months ago

🦋 Changeset detected

Latest commit: f02b6de6bea70c02e8f312156b5b89450ef538fa

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

This PR includes changesets to release 1 package | Name | Type | | ----------------- | ----- | | @astrojs/compiler | Patch |

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