starlight icon indicating copy to clipboard operation
starlight copied to clipboard

Update @astrojs/mdx to v3

Open delucis opened this issue 1 year ago β€’ 4 comments

Description

  • Updates the version of @astrojs/mdx bundled with Starlight to the new v3 release, which comes with several performance improvements
  • Enables the optimize option to MDX for even faster builds.
  • Also updates the peer dependency version of Astro, which is now ^4.8.0
  • Taking the Starlight docs as a benchmark, it looks like builds are roughly 40% faster for us. Will be curious to see how things improves for other people!

Some other small changes I needed to make:

  • ~~Updated Vitest to 1.4.0 β€” there were some compatibility issues with the upgraded Vite and the older Vitest version we were using. (Did not update to latest Vitest as that was also causing another issue we can investigate later.)~~ Superseded by #1861
  • Fixed a type issue due to a content collection types change β€” based on HiDeoo’s change here: https://github.com/withastro/starlight/pull/1841/files/c193d55f0046553772bfa540f15d956290f258e4#r1593616510
  • ~~Ignored some more .d.ts files being generated during tests~~ Turned out that was only happening with Vitest 1.6.0 β€” reverted.

delucis avatar May 09 '24 14:05 delucis

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Updated (UTC)
starlight βœ… Ready (Inspect) Visit Preview May 17, 2024 2:39pm
1 Ignored Deployment
Name Status Preview Updated (UTC)
starlight-i18n ⬜️ Ignored (Inspect) May 17, 2024 2:39pm

vercel[bot] avatar May 09 '24 14:05 vercel[bot]

πŸ¦‹ Changeset detected

Latest commit: 6fe71de5795d4301133e75af6f3bb4e108be1b85

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

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Minor

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

changeset-bot[bot] avatar May 09 '24 14:05 changeset-bot[bot]

size-limit report πŸ“¦

Path Size
/index.html 5.26 KB (-13.94% πŸ”½)
/_astro/*.js 21.81 KB (-0.92% πŸ”½)
/_astro/*.css 13.46 KB (0%)

astrobot-houston avatar May 09 '24 14:05 astrobot-houston

Given Astro 4.8 seems to break script hoisting MDX and this forces an upgrade to 4.8, we might need to hold off merging this until https://github.com/withastro/astro/issues/11063 is fixed?

delucis avatar May 16 '24 20:05 delucis

I've sent https://github.com/withastro/astro/pull/11084 that fixes it.

bluwy avatar May 17 '24 09:05 bluwy

Thank you for the quick fix @bluwy! πŸ’–

delucis avatar May 17 '24 14:05 delucis