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

chore(theme-search-algolia): revert docsearch package range downgrade after bugfix release #9320

Merged
merged 3 commits into from Sep 19, 2023

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Sep 18, 2023

Motivation

Follow-up of #9148

Revert downgrade of Algolia DocSearch package after type issue being fixed in v3.5.2 (algolia/docsearch#2007)

Test Plan

CI

Test links

Deploy preview: https://deploy-preview-9320--docusaurus-2.netlify.app/

@slorber slorber added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Sep 18, 2023
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Sep 18, 2023
@netlify
Copy link

netlify bot commented Sep 18, 2023

[V2]

Name Link
🔨 Latest commit 9a0d18d
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6508870765288e00074a9c95
😎 Deploy Preview https://deploy-preview-9320--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions
Copy link

github-actions bot commented Sep 18, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 84 🟢 97 🟢 92 🟢 100 🟠 89 Report
/docs/installation 🟠 73 🟢 98 🟢 92 🟢 100 🟠 89 Report

@slorber slorber changed the title chore: upgrade docsearch package chore(theme-search-algolia): revert docsearch package range downgrade after bugfix release Sep 18, 2023
@@ -87,6 +87,7 @@
"@docusaurus/tsconfig": "3.0.0-beta.0",
"@types/jest": "^29.5.3",
"cross-env": "^7.0.3",
"rimraf": "^3.0.2"
"rimraf": "^3.0.2",
"search-insights": "^2.8.2"
Copy link
Collaborator Author

@slorber slorber Sep 18, 2023

Choose a reason for hiding this comment

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

@shortcuts FYI this requires me to add this extra deps to our website because it's an optional peerDeps of docsearch react but it's used for typechecking. Without this extra deps we still get the TypeScript errors:

Error: ../node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/types/InsightsClient.d.ts(1,75): error TS2307: Cannot find module 'search-insights' or its corresponding type declarations.
Error: ../node_modules/@algolia/autocomplete-plugin-algolia-insights/dist/esm/types/InsightsClient.d.ts(2,212): error TS2307: Cannot find module 'search-insights' or its corresponding type declarations.

This is due to our usage of TypeScript option "skipLibCheck": false, on the website. Most users should use skipLibCheck: true normally.

Not sure why this deps is an optional peer deps, or if you should do anything, but I thought you might be interested to know ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

hey @slorber, there's a new optional feature with DocSearch which allow users to track events and we use the search-insights Algolia library to do so, I believe it's optional because the option is opt-in, so I guess the behavior is correct here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

CleanShot 2023-09-19 at 10 47 52@2x

@shortcuts if I use @algolia/autocomplete-plugin-algolia-insights, isn't it expected that search-insights should be available in deps? Maybe it's @algolia/autocomplete-plugin-algolia-insights that should be a peer deps instead?

I don't have a solution to this problem, and not sure to understand it fully, but something feels a bit weird to me in your current setup 😅 Even if your package does not require/import 'search-insights', it still depends on its types, so types should rather be included? I don't know. We probably won't be the only one using skipLibCheck: false and stumble upon this issue.

@github-actions
Copy link

Size Change: 0 B

Total Size: 1.11 MB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 117 kB
website/build/assets/css/styles.********.css 113 kB
website/build/assets/js/main.********.js 836 kB
website/build/index.html 41.4 kB

compressed-size-action

Copy link
Collaborator

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

We can merge it if you like; we should be adding peer deps ourselves anyway.

Copy link
Contributor

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

thanks!

@@ -87,6 +87,7 @@
"@docusaurus/tsconfig": "3.0.0-beta.0",
"@types/jest": "^29.5.3",
"cross-env": "^7.0.3",
"rimraf": "^3.0.2"
"rimraf": "^3.0.2",
"search-insights": "^2.8.2"
Copy link
Contributor

Choose a reason for hiding this comment

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

hey @slorber, there's a new optional feature with DocSearch which allow users to track events and we use the search-insights Algolia library to do so, I believe it's optional because the option is opt-in, so I guess the behavior is correct here?

@slorber slorber merged commit 507d658 into main Sep 19, 2023
29 of 30 checks passed
@slorber slorber deleted the slorber/change-algolia-deps-range branch September 19, 2023 09:28
This was referenced Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants