Skip to content
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

Re-export meilisearch package, and expose created MeiliSearch instance #1271

Merged
merged 4 commits into from
Feb 27, 2024

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

@@ -2,7 +2,6 @@
"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:

.changeset/sharp-beds-lie.md Show resolved Hide resolved
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
Copy link
Contributor

meili-bors bot commented Feb 27, 2024

@meili-bors meili-bors bot merged commit 717e0ab into meilisearch:main Feb 27, 2024
7 checks passed
@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