-
Notifications
You must be signed in to change notification settings - Fork 336
feat(shared): introduce autocomplete-shared package #359
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
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit d6ec55e:
|
| "@algolia/autocomplete-shared": "1.0.0-alpha.34" | ||
| }, | ||
| "devDependencies": { | ||
| "@algolia/client-search": "4.5.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this one only used in tests? otherwise it should be also in peerDependencies; even if it's a transitive dependency (I think).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's to use the Hit type: https://github.com/algolia/autocomplete.js/blob/25316b82e0fbe2d3091e41d572c338e825e87a15/packages/autocomplete-preset-algolia/src/highlight/parseAlgoliaHitHighlight.ts#L2
So yeah it should be in peer deps I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in d6ec55e.
Haroenv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good now!
This enables to share code between packages by introducing a new package:
@algolia/autocomplete-shared.This package is only compiled to ESM (no UMD) because it's meant to stay internal. We could have not transpiled it at all (i.e., shipping TypeScript files) but we might break apps using the ESM imports of our libs that don't transpile TS files.