Skip to content

Conversation

@flevi29
Copy link
Collaborator

@flevi29 flevi29 commented Dec 17, 2023

Pull Request

Related issue

Fixes #1260

What does this PR do?

  • exposed created MeiliSearch instance
  • re-exported all of "meilisearch" package

These improvements make it so that no separate "meilisearch" package
has to be installed in order to use its exports directly. This
way a single MeiliSearch instance can be re-used, and we can potentially
save on bundle size by avoiding a separate different version installation of
"meilisearch".

import { instantMeiliSearch, meilisearch } from '@meilisearch/instant-meilisearch'
// re-exported "meilisearch" ^

const {
  meiliSearchInstance,
  // ^ re-usable MeiliSearch instance
  searchClient
} = instantMeiliSearch(/*...*/)

…already in tsconfig.json which it extends, marked node module imports as explicit ("node:(...)"), added types to some scripts for IDE hints.
@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2023

🦋 Changeset detected

Latest commit: ad3c63b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@meilisearch/instant-meilisearch Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

"extends": "./tsconfig.json",
"compilerOptions": {
"suppressImplicitAnyIndexErrors": true,
"resolveJsonModule": true
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 explain that 😅 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's already set as true in the tsconfig.json this config file extends:

Copy link
Member

@brunoocasali brunoocasali left a comment

Choose a reason for hiding this comment

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

It seems pretty good to me!

@brunoocasali
Copy link
Member

bors merge

@brunoocasali brunoocasali added the enhancement New feature or request label Feb 27, 2024
@meili-bors
Copy link
Contributor

meili-bors bot commented Feb 27, 2024

@meili-bors meili-bors bot merged commit 717e0ab into meilisearch:main Feb 27, 2024
@flevi29 flevi29 deleted the expose-meilisearch-package branch February 28, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose both created MeiliSearch instance, and the used meilisearch package

2 participants