Skip to content

Conversation

micheleriva
Copy link
Contributor

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

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

g-francesca and others added 30 commits July 9, 2025 11:54
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 ===
Copy link
Member

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(() => {
Copy link
Member

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(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Lifecycle Hooks

};
}, [clearAll]);

useEffect(() => {
Copy link
Member

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.

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!

Copy link
Member

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 🙇

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(() => {
Copy link
Member

Choose a reason for hiding this comment

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

Lifecycle Hooks

ovflowd

This comment was marked as outdated.

Copy link
Member

@ovflowd ovflowd left a 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?

Image

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 🙇

@g-francesca
Copy link

Searching on this branch is broken?

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

@g-francesca
Copy link

Can you update https://github.com/nodejs/nodejs.org/blob/main/.github/workflows/sync-orama.yml to use the new API keys?

See https://github.com/nodejs/nodejs.org/actions/runs/18316807448/job/52159169199?pr=8175

@avivkeller I updated the workflow. Can you please confirm that you also set this env vars on github/vercel?

NEW_ORAMA_PROJECT_ID
NEW_ORAMA_PRIVATE_API_KEY
NEW_ORAMA_DATASOURCE_ID

Thanks!

@avivkeller
Copy link
Member

Can you update main/.github/workflows/sync-orama.yml to use the new API keys?
See nodejs/nodejs.org/actions/runs/18316807448/job/52159169199?pr=8175

@avivkeller I updated the workflow. Can you please confirm that you also set this env vars on github/vercel?

NEW_ORAMA_PROJECT_ID
NEW_ORAMA_PRIVATE_API_KEY
NEW_ORAMA_DATASOURCE_ID

Thanks!

Screenshot 2025-10-10 at 13 38 01

@avivkeller
Copy link
Member

avivkeller commented Oct 10, 2025

@nodejs/web-infra Can you copy the NEW_ORAMA_PROJECT_ID / NEW_PRODUCTION_ORAMA_PROJECT_ID from Vercel into GH Actions?

@avivkeller
Copy link
Member

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?

@avivkeller
Copy link
Member

@nodejs/web-infra Can you copy the NEW_ORAMA_PROJECT_ID / NEW_PRODUCTION_ORAMA_PROJECT_ID from Vercel into GH Actions?

I've set these as 2eac5680-790b-44b7-8640-359608f104bd / 939d8d74-dbb7-4098-ac46-00325a783e17 respectively (per https://openjs-foundation.slack.com/archives/CVAMEJ4UV/p1756145667553889?thread_ts=1755714272.918999&cid=CVAMEJ4UV and https://openjs-foundation.slack.com/archives/CVAMEJ4UV/p1755908231889699?thread_ts=1755714272.918999&cid=CVAMEJ4UV, respectively)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants