|
1 | 1 | # @meilisearch/autocomplete-client |
2 | 2 |
|
| 3 | +## 0.8.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 9642256: # Rework exports and bundling |
| 8 | + - Update usage of `MeiliSearch` to lower case `Meilisearch` to eliminate some possible issues arising from JSPM and maybe other CDNs/package resolvers (#1472, #1468) |
| 9 | + - From now on [`meilisearch`](https://github.com/meilisearch/meilisearch-js/) is marked as a peer dependency |
| 10 | + - Update README.md to show the HTML example with [`importmap`](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap) |
| 11 | + - Changed TypeScript settings, and adapted some files to it, so we can let in the future Node.js execute `*.ts` files directly; for now executing them with [`tsx`](https://github.com/privatenumber/tsx) |
| 12 | + - There is no need anymore for separate version file within source files, as they import the package JSON file to get the version |
| 13 | + - Node.js ^20 can now `require(esm)`, so there's no point in bundling to commonjs anymore |
| 14 | + - https://vite.dev/blog/announcing-vite8#node-js-support |
| 15 | + - https://github.com/vitejs/vite/blob/main/packages/vite/package.json |
| 16 | + - Remove UMD bundle, modern browsers support importing ESM from URLs and `type="module"` scripts for almost a decade now, even Node.js supports requiring ESM as stated above |
| 17 | + - Remove any fields regarding exports outside of `"exports"` field, all supported Node.js versions support "exports" field, as do all modern bundlers and CDNs |
| 18 | + - Make use of [`publishConfig`](https://pnpm.io/package_json#publishconfig), so we can export to other workspace packages the TypeScript source files |
| 19 | + - Thanks to this change, running build script is only required for publishing, and not for developing |
| 20 | + - Put `package.json` into exports, mainly so bundlers can read it via directly importing it, and it seems to be the industry norm |
| 21 | + |
| 22 | + ## Migration |
| 23 | + 1. - CommonJS and UMD bundles aren't available anymore |
| 24 | + - `package.json` `"main"` and `"types"` fields aren't available anymore |
| 25 | + |
| 26 | + If you relied on any of these outdated features, you will have to bundle for any target environment that requires them, or update the environment if that's possible. |
| 27 | + 2. From now on [`meilisearch`](https://github.com/meilisearch/meilisearch-js/) is a peer dependency (if the package manager used doesn't automatically install it, add it to the list of dependencies manually): |
| 28 | + |
| 29 | + ```diff |
| 30 | + - import { meilisearch } from '@meilisearch/instant-meilisearch' |
| 31 | + - import { meilisearch } from '@meilisearch/autocomplete-client' |
| 32 | + + import * as meilisearch from 'meilisearch' |
| 33 | + + import { Meilisearch } from 'meilisearch' |
| 34 | + ``` |
| 35 | + |
| 36 | +### Patch Changes |
| 37 | + |
| 38 | +- Updated dependencies [9642256] |
| 39 | + - @meilisearch/instant-meilisearch@0.31.0 |
| 40 | + |
3 | 41 | ## 0.7.0 |
4 | 42 |
|
5 | 43 | ### Minor Changes |
|
0 commit comments