Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build performance optimizations #2171

Merged
merged 6 commits into from
Aug 7, 2024
Merged

Build performance optimizations #2171

merged 6 commits into from
Aug 7, 2024

Conversation

delucis
Copy link
Member

@delucis delucis commented Aug 7, 2024

Description

  • Aims to improve some build performance by avoiding some well-known slower operations
  • Updates a few places dealing with trailing slashes to use our existing trailing slash utilities instead of using .replace() with a regular expression
  • Updates the stripExtension() utility in sidebar generation to use lower-level string operations instead of a regular expression in .replace(). (In this case the logic is technically subtly different as the RegExp was matching \w+ after a final period, but given the limited scope of usage for this utility on file paths ending in .md, .mdx etc., it should be fine.)
  • Updates the slugToParam() utility to avoid an unnecessary .replace() in favour of a faster .slice()
  • Refactors some slug processing in linkFromInternalSidebarLinkItem() to avoid the need to .replace() entirely

Copy link

changeset-bot bot commented Aug 7, 2024

🦋 Changeset detected

Latest commit: af29d34

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 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

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Aug 7, 2024
Copy link

netlify bot commented Aug 7, 2024

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit af29d34
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/66b395b8c322dd0007546915
😎 Deploy Preview https://deploy-preview-2171--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@astrobot-houston
Copy link
Collaborator

astrobot-houston commented Aug 7, 2024

size-limit report 📦

Path Size
/index.html 5.95 KB (0%)
/_astro/*.js 21.93 KB (0%)
/_astro/*.css 13.81 KB (0%)

@delucis delucis changed the title Performance optimizations Build performance optimizations Aug 7, 2024
@delucis delucis marked this pull request as ready for review August 7, 2024 11:08
Copy link
Member

@HiDeoo HiDeoo left a comment

Choose a reason for hiding this comment

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

Lovely changes 🔥

packages/starlight/utils/navigation.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 core Changes to Starlight’s main package 🌟 patch Change that triggers a patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants