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

Upgrade Pagefind to 1.3.0 and configure Pagefind logging levels #2728

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

delucis
Copy link
Member

@delucis delucis commented Dec 18, 2024

Description

  • This PR updates Starlight’s Pagefind dependency to 1.3.0.
  • Thanks to Configurable logging levels CloudCannon/pagefind#745 we can now forward Astro’s logging level to Pagefind to reduce (or increase) log verbosity in line with user preference.
  • Marking this as a draft for now as we still have to consider Update pagefind to version 1.1.0 #1750 and some of the bundle size changes, but wanted to put this up as a PR before I forget about the logging level feature.

Copy link

changeset-bot bot commented Dec 18, 2024

⚠️ No Changeset found

Latest commit: a650e5f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

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

netlify bot commented Dec 18, 2024

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit a650e5f
🔍 Latest deploy log https://app.netlify.com/sites/astro-starlight/deploys/6762ad90b537c1000884d4cb
😎 Deploy Preview https://deploy-preview-2728--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: 100 (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

size-limit report 📦

Path Size
/index.html 7 KB (+0.03% 🔺)
/_astro/*.js 25.71 KB (+21.31% 🔺)
/_astro/*.css 13.75 KB (0%)

@delucis
Copy link
Member Author

delucis commented Dec 18, 2024

I’ve repeated @HiDeoo’s exercise from #1750 of comparing results for a selection of search terms in the Starlight docs.

For results that changed rank, I’ve added the difference in ranking compared to Pagefind v1 to help highlight what changed. Bolded entries are results that I’ve subjectively decided are “good” or “best” results, to help track those across columns. I’ve also added a subjective “impact” assessment for each query to summarize my impressions.

Query data

Query: setup

Impact: 👎 Negative — slightly worse than before, although not terribly

Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 Manual Setup +1 Plugins Reference +1 Plugins Reference +1 Plugins Reference
2 Plugins Reference -1 Manual Setup -1 Manual Setup -1 Manual Setup
3 Using components Using components Using components +2 Customizing Starlight
4 Getting Started Getting Started Getting Started -1 Using components
5 Customizing Starlight Customizing Starlight Customizing Starlight -1 Getting Started

Query: installation

Impact: Neutral — we don’t have clear content for this query, closest being “Manual Setup”

Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 Site Search +1 Authoring Content in Markdown +1 Authoring Content in Markdown +1 Authoring Content in Markdown
2 Authoring Content in Markdown -1 Site Search -1 Site Search +1 Customizing Starlight
3 Customizing Starlight Customizing Starlight Customizing Starlight -2 Site Search
4 CSS & Styling CSS & Styling CSS & Styling CSS & Styling
5 Manual Setup Manual Setup Manual Setup +1 Configuration Reference

Query: page

Impact: 👎 Negative — wildly different results, which in the worst case removes the “Pages” result entirely

Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 Pages +15 Internationalization (i18n) +15 Internationalization (i18n) +5 Overrides Reference
2 Site Search +4 Overrides Reference +4 Overrides Reference +6 Frontmatter Reference
3 Overriding Components -1 Site Search -1 Site Search -2 Pages
4 Customizing Starlight +4 Frontmatter Reference +4 Frontmatter Reference +7 Configuration Reference
5 Eco-friendly docs +6 Configuration Reference +6 Configuration Reference +11 Internationalization (i18n)
(Pages ranked №8) (Pages ranked №8)

Query: markdown

Impact: 👎 Negative — downranks the obvious result, which is not ideal

Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 Authoring Content in Markdown +9 Overrides Reference +9 Overrides Reference Authoring Content in Markdown
2 Link Cards -1 Authoring Content in Markdown -1 Authoring Content in Markdown +8 Overrides Reference
3 Steps -1 Link Cards -1 Link Cards +2 Pages
4 Card Grids +1 Pages +1 Pages Card Grids
5 Pages -1 Card Grids -1 Card Grids -4 Link Cards

Query: component

Impact: 👍 Positive — surfaces the same key content, plus adds “Pages” which does include page component docs

Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 Using components Using components Using components +2 Overrides Reference
2 Overriding Components +19 Pages +19 Pages -1 Using components
3 Overrides Reference Overrides Reference Overrides Reference -1 Overriding Components
4 Eco-friendly docs -2 Overriding Components -2 Overriding Components +2 File Tree
5 Code +1 File Tree +1 File Tree +3 Card Grids

Query: css

Impact: Neutral — no significant changes for the most part

Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 CSS & Styling CSS & Styling CSS & Styling CSS & Styling
2 Icons Icons Icons +2 Customizing Starlight
3 Starlight Showcase +1 Customizing Starlight +1 Customizing Starlight +2 Configuration Reference
4 Customizing Starlight -1 Starlight Showcase -1 Starlight Showcase -2 Icons
5 Configuration Reference Configuration Reference Configuration Reference -2 Starlight Showcase

Query: language

Impact: Neutral — over promotes “Overrides Reference”, but otherwise OK

Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 Internationalization (i18n) +4 Overrides Reference +4 Overrides Reference Internationalization (i18n)
2 Link Cards -1 Internationalization (i18n) -1 Internationalization (i18n) +2 Configuration Reference
3 Make your docs shine with Starlight -1 Link Cards +1 Configuration Reference +2 Overrides Reference
4 Configuration Reference Configuration Reference -2 Link Cards +3 Authoring Content in Markdown
5 Overrides Reference +1 Pages +1 Pages +3 Sidebar Navigation

Query: sidebar

Impact: 👎 Negative — only the termFrequency: 0 variant returns similarly appropriate results

Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 Sidebar Navigation +4 Configuration Reference +4 Configuration Reference Sidebar Navigation
2 Overrides Reference Overrides Reference Overrides Reference Overrides Reference
3 Pages Pages Pages +1 Frontmatter Reference
4 Frontmatter Reference -3 Sidebar Navigation -3 Sidebar Navigation +1 Configuration Reference
5 Configuration Reference -1 Frontmatter Reference -1 Frontmatter Reference -2 Pages

Query: lastUpdated

Impact: Neutral — no change
Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 Overrides Reference Overrides Reference Overrides Reference Overrides Reference
2 Frontmatter Reference Frontmatter Reference Frontmatter Reference Frontmatter Reference
3 Configuration Reference Configuration Reference Configuration Reference Configuration Reference

Query: plugin

Impact: Neutral — no significant change (reference page second would be nice, but hard to expect the search index to distinguish between guides and reference without assistance)

Rank 1.0 1.3, termFrequency: 1 1.3, termFrequency: 0.5 1.3, termFrequency: 0
1 Plugins and Integrations +1 Plugins Reference +1 Plugins Reference +1 Plugins Reference
2 Plugins Reference -1 Plugins and Integrations -1 Plugins and Integrations -1 Plugins and Integrations
3 Configuration Reference CSS & Styling CSS & Styling Configuration Reference
4 CSS & Styling +1 Site Search +1 Site Search CSS & Styling
4 Site Search -1 Configuration Reference -1 Configuration Reference Site Search

Assessment

I find it a bit hard to assess what this data means both for us and our docs results, and more broadly how it is likely to impact our users.

From one perspective results are largely unchanged for many of these queries, and while they may be subtly different, we may not have complained about these results if they had been presented to us out of context.

On the other hand, several of these queries (page and sidebar) seem to suffer from much worse results after the 1.3 update. In both those cases, only setting termFrequency to 0 resulted in a more resonable result. However, there are other more marginal queries like component and installation where termFrequency: 0 seems to slightly worsen results. It’s a bit hard to know whether essentially disabling frequency weighting like this would be an extreme decision or not.

Notes

  • Like @HiDeoo did in Update pagefind to version 1.1.0 #1750, I also experimented with termSaturation, but it appeared to have a near-zero impact. A few of the results shifted up/down one place, but nothing significant. Even extreme values like termSaturation: 0 did not budge the needle on some of the problematic results.

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants