-
Notifications
You must be signed in to change notification settings - Fork 0
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
Algolia hooks: update and patch #700
Conversation
We have an open pull to make a change in this algolia repo, but they likely won't merge it. Since we need this diff to build on vercel, let's just include it directly. When we upgrade to React 18 we just need to drop the `.js` in the import statement. This was made using pnpm's built-in patch commands. Note: `pnpm patch` just hung on pnpm v6, so I updated to v7, ran the commands, then downgraded back to v6.
"pnpm patch" is only available in pnpm 7. Let's give it another try.
husky 4 wasn't compatible with pnpm 7, go figure... Also, allow unmet peer dependencies (this defaults to true for pnpm 7, so we switch it to true to maintain behavior)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CR ⚡ dev_block ⚡ on pinning the husky version, though I'd like it if @federicobadini and/or @dhmacs took a look and made sure this looks reasonable to you too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I meant to request changes instead of approve.
un_dev_block 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR ✌🏻 Cool! I'll let @federicobadini or @dhmacs approve like @sterlinghirsh suggested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that there is something that needs to be handled differently regarding navigation/reconciliation of the search state.
When we navigate from a filtered collection to a supposedly unfiltered collection we end up with the previously selected filters active.
Here is a video showing the problem:
Screen.Recording.2022-09-15.at.08.45.19.mov
This might be unrelated to what @federicobadini discovered, but this is another workaround we added for the url on the first render. react-commerce/frontend/components/common/InstantSearchProvider.tsx Lines 151 to 154 in 943eb88
I wonder if we can drop this |
I did a quick test before and it seemed not present anymore but I have not covered all the possible test cases yet (first render / client side transition / back button navigation etc). I just tried to open the link in the comment. |
I updated the version but I don't have to time to dive deeper right now. Anyone else is welcome to pick this up. |
…-and-patch Conflicts: pnpm-lock.yaml * Lots of conflicts, but our branch and more significant changes (and a version bump of the format). So I kept our version
Master had added one dep since we diverged, so I kept our version of the lock file then did `pnpm install` to ensure it was up to date with with package.json requirements.
Fixed the conflicts. |
We validated that qsModule.parse() already does url decoding and we don't need to re-do it on the return values. Also, drop some defaults on destructuring because they already happen in the code below.
This was added a bit ago because the server side state for algolia wasn't matching up (or wasn't available). See: a5481b5 This concern has been addressed and this code is now *causing* a serverside / clientside state mismatch and react is complaining that the two states don't match. Removing this and depending on algolias knowledge of the refinements produces relaible results.
corepack was saying it can't find any version compatible with '7' I still don't understand why corepack helps us here, so I'm reverting to plain 'npm install' which is simpler and actually let's us install the latest version.
Ok, @masonmcelvain and I have addressed the issues he brought up, so I think we are good. un_dev_block 👍 |
This field is unused as of 4ec07e2, so let's drop it to prevent accidental usage in the future.
aea0aae
to
5155bbc
Compare
CR ⚡ dev_block ⚡ on what looks like relevant test failures. I think we put the deviceItemType stuff in the findProductList function in part to make sure that the canonical on item type pages included that. It's possible that didn't work before because of the Algolia bugs fixed by the new hooks version. I don't remember if we added a test for canonicals on item type pages, but it's worth a check. |
I think the failures were a quirk of having installed pnpm through both corepack and npm. Notice it only failed on one of them. Either way, I think we don't need to dev block on a CI failure (the CI failure already blocks). un_dev_block 👍 I've re-run the failed build. |
Previous one was failing for some mysterious reasons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR ✌🏻
QA 🎦
|
We have an open pull to make a change in the algolia
react-instantsearch
repo, but theylikely won't merge it. Since we need this diff to build with the newest version
of the hooks on vercel, let's use pnpm's patch utility to apply the change for now.
When we upgrade to React 18 we just need to drop the
.js
in the importstatement.
This was made using pnpm's built-in patch commands. Note:
pnpm patch
just hung on pnpm v6, so I updated to v7. Seems there were some problems in the past... but they seem to be fixed now?
This also upgrades husky to v8 cause v4 wasn't compatible with pnpm 7
Closes #660