Skip to content

Conversation

@8bittitan
Copy link
Contributor

@8bittitan 8bittitan commented Sep 16, 2025

Explicitly exports DocSearchModal, DocSearchButton, useDocSearchKeyboardEvents, useTheme and version as their own standalone exports. This is to reduce overall bundle size if wanting to use these components on their own.

With this you could now import like the following:

import { DocSearchButton } from '@docsearch/react/button'
import { DocSearchModal } from '@docsearch/react/modal'
import { useDocSearchKeyboardEvents } from '@docsearch/react/useDocSearchKeyboardEvents'
import { useTheme } from '@docsearch/react/useTheme'
import { version } from '@docsearch/react/version'

The new @docsearch/react dist directory will look like the following:

.
├── esm
│   ├── DocSearchButton.d.ts
│   ├── DocSearchButton.js
│   ├── DocSearchModal.d.ts
│   ├── DocSearchModal.js
│   ├── index.d.ts
│   ├── index.js
│   ├── useDocSearchKeyboardEvents.d.ts
│   ├── useDocSearchKeyboardEvents.js
│   ├── useTheme.d.ts
│   ├── useTheme.js
│   ├── version.d.ts
│   └── version.js
└── umd
    ├── DocsearchButton.js
    ├── DocsearchButton.js.map
    ├── DocSearchModal.js
    ├── DocSearchModal.js.map
    ├── index.js
    ├── index.js.map
    ├── useDocSearchKeyboardEvents.js
    ├── useDocSearchKeyboardEvents.js.map
    ├── useTheme.js
    ├── useTheme.js.map
    ├── version.js
    └── version.js.map

@netlify
Copy link

netlify bot commented Sep 16, 2025

Deploy Preview for docsearch ready!

Name Link
🔨 Latest commit 36ed6e8
🔍 Latest deploy log https://app.netlify.com/projects/docsearch/deploys/68d18290a7afdb00089a108e
😎 Deploy Preview https://deploy-preview-2764--docsearch.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 project configuration.

@8bittitan 8bittitan merged commit b15f302 into main Sep 22, 2025
10 checks passed
@8bittitan 8bittitan deleted the feat/split-docsearch-react-exports-better branch September 22, 2025 17:46
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.

4 participants