-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(search): use new Orama components #8175
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
Co-authored-by: Aviv Keller <[email protected]> Signed-off-by: Aileen Villanueva Lecuona <[email protected]>
> | ||
<DocumentTextIcon /> | ||
<div> | ||
{typeof hit.document?.pageSectionTitle === |
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.
Can you extract this to a proper function? Too much complexity in a single component.
} = useSearch(); | ||
const containerRef = useRef<HTMLDivElement>(null); | ||
|
||
const clearAll = useCallback(() => { |
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.
Lifecycle Hooks (React Reducer)
dispatch({ type: 'SET_RESULTS', payload: { results: [] } }); | ||
}, [dispatch]); | ||
|
||
useEffect(() => { |
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.
Lifecycle Hooks
}; | ||
}, [clearAll]); | ||
|
||
useEffect(() => { |
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.
I'm strongly against using querySelectors within React, it breaks the nature of React.
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.
Good point. I revisited the logic and removed the querySelectorAll
.
I double-checked that I have access to all interactive elements directly, so each of them now handles its own tabIndex
. Thanks for catching that!
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.
This component is just too big, please break it down into smaller parts 🙇
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.
I’ve refactored the component and split it into smaller, more focused parts. Let me know if you think this structure works better now!
|
||
const oramaLogo = `https://website-assets.oramasearch.com/orama-when-${resolvedTheme}.svg`; | ||
|
||
const clearAll = useCallback(() => { |
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.
Lifecycle Hooks
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.
Searching on this branch is broken?

There are a few things here and there I believe need to be addressed. Some components are too big, some have way too many Effects that can become React Reducers for Lifecycle management.
I genuinely appreciate the effort done here ❤️ and 100% value the effort and time Orama team is spending on this PR 🙇
Hey @ovflowd! Thank you for your review ❤️ I'll try to manage everything soon, I'll keep you posted. |
@avivkeller I updated the workflow. Can you please confirm that you also set this env vars on github/vercel?
Thanks! |
![]() |
@nodejs/web-infra Can you copy the |
Apologies for the delays here! I was at JSConf. @g-francesca Can you please "Resolve" all the conversations that you believe have been resolved, and then re-request a review from @ovflowd? |
I've set these as |
This PR supersedes #7971 and integrates the new Orama components, powered by the new OramaCore backend.
Description
New components - React-based to replace the old WebComponents-based ones. New backend (OramaCore instead of old Orama Cloud), all hosted and maintained on https://app.orama.com. Credentials have been shared privately with the repository maintainers on Slack.
Validation
Tested locally and on remote demo environment.
Related Issues
Check List
pnpm format
to ensure the code follows the style guide.pnpm test
to check if all tests are passing.pnpm build
to check if the website builds without errors.