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]>
@g-francesca
Copy link

@ovflowd I’ve addressed the points you mentioned. Thank you for your feedback. Feel free to review it again when you have a moment.


export const oramaClient =
ORAMA_CLOUD_PROJECT_ID && ORAMA_CLOUD_READ_API_KEY
? new OramaCloud({
Copy link
Member

Choose a reason for hiding this comment

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

Out of curiosity: What happens if we create the instance with these params being undefined? Does anything happen during instance creattion?

Choose a reason for hiding this comment

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

If the instance is created with the env vars being undefined, the Orama SDK throws an error like Endpoint and API keys are required. I added a check before creating the instance, so we either have a valid instance or null. When the instance is null, the search button is disabled to prevent runtime errors for contributors who don’t have those vars and don’t need them.

import '@orama/ui/styles.css';
import { SearchboxProvider } from '#site/providers/searchboxProvider';

import styles from './index.module.css';
Copy link
Member

Choose a reason for hiding this comment

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

CSS files should be loaded after everything. I believe there's a rule for that? Pretty much:

import { InnerSearchboxModal } from './InnerSearchboxModal';
import { oramaClient } from './orama-client';

import styles from './index.module.css';

Choose a reason for hiding this comment

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

@ovflowd I tried to update the import order, but on save, VSCode automatically sorts imports because editor.formatOnSave is enabled, and ESLint’s import-x/order rule enforces grouping and newlines. On save, the CSS import gets reordered.

),
});

const ThemeToggle = dynamic(
Copy link
Member

Choose a reason for hiding this comment

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

I know unrelated to this PR, but @nodejs/nodejs-website what's the reason behind this? Usage of dynamic makes Next.js eject SSR.

import { useTranslations } from 'next-intl';

import { ChatMessage } from '../ChatMessage';
import styles from './index.module.css';
Copy link
Member

Choose a reason for hiding this comment

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

tiny nit: we always keep styles after all other imports and separated by an empty line (afaics)

import { ChatInteractions } from '@orama/ui/components';
import type { FC } from 'react';

import styles from './index.module.css';
Copy link
Member

Choose a reason for hiding this comment

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

nit: style imports after all others

import { ChatInteractions } from '@orama/ui/components';
import type { FC } from 'react';

import styles from './index.module.css';
Copy link
Member

Choose a reason for hiding this comment

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

nit: style imports after all others

import { ChatInput } from '../ChatInput';
import { ChatInteractionsContainer } from '../ChatInteractions';
import { Footer } from '../Footer';
import styles from './index.module.css';
Copy link
Member

Choose a reason for hiding this comment

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

nit: style imports after all others

import { DEFAULT_ORAMA_QUERY_PARAMS } from '#site/next.constants.mjs';
import { useSearchbox } from '#site/providers/searchboxProvider';

import styles from './index.module.css';
Copy link
Member

Choose a reason for hiding this comment

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

nit: style imports after all others

import { MagnifyingGlassIcon } from '@heroicons/react/24/solid';
import { SearchInput } from '@orama/ui/components';
import { useTranslations } from 'next-intl';
import { type FC, type PropsWithChildren } from 'react';
Copy link
Member

@ovflowd ovflowd Nov 2, 2025

Choose a reason for hiding this comment

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

small nit: this can be a type import

Suggested change
import { type FC, type PropsWithChildren } from 'react';
import type { FC, PropsWithChildren } from 'react';

import { SearchResults } from '@orama/ui/components';
import { useReducer, type FC } from 'react';

import searchboxReducer, {
Copy link
Member

Choose a reason for hiding this comment

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

nit: simplify this to just seachReducer, searchState

import { DEFAULT_ORAMA_QUERY_PARAMS } from '#site/next.constants.mjs';
import { useSearchbox } from '#site/providers/searchboxProvider';

import styles from './index.module.css';
Copy link
Member

Choose a reason for hiding this comment

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

nit: style iports after all others

import type { FC, PropsWithChildren } from 'react';

import { ChatInput } from '../ChatInput';
import styles from './index.module.css';
Copy link
Member

Choose a reason for hiding this comment

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

nit: style imports after all others

@@ -0,0 +1,54 @@
import type { Dispatch } from 'react';

import type * as Types from '#site/types/searchbox';
Copy link
Member

Choose a reason for hiding this comment

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

cc @nodejs/nodejs-website do we use to do wildcard imports of types?

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.

SGTM! I left a few final comment reviews that I'd appreciate to get answered still in this PR, but I believe this PR isn't anymore in a blocked state and ultimately "could" get merged as is.

@nodejs/nodejs-website, team keep me humble. Can y'all also give a final round of reviews here and help me out?

And finally for the Orama team. Thank you so so much for your patience and for the incredible work done here. Really appreciate it!!!!

@ovflowd
Copy link
Member

ovflowd commented Nov 2, 2025

(Also, thank you @g-francesca for your patience 🙇)

@g-francesca
Copy link

(Also, thank you @g-francesca for your patience 🙇)

With pleasure 🤗​ . Thank you too for the time spent improving this PR. I'm addressing the latest comments rn.

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