Skip to content

v0.50.0 🦫

Compare
Choose a tag to compare
@meili-bot meili-bot released this 15 Apr 01:47
· 37 commits to refs/heads/main since this release

This release adds new features related to Meilisearch 1.14.

⚠️ Breaking changes

Refactored HTTP client (#1741) @flevi29

Important

The Meilisearch class now accepts a requestInit parameter instead of requestConfig. Parameters of requestInit are the same, except it no longer accepts signal.

const client = new Meilisearch({
  host: 'https://edge.meilisearch.com',
  apiKey: 'your meilisearch API key',
  // `requestConfig` is removed, use `requestInit` instead
  requestInit: {
    headers: {
      "A-Http-Header": "The Value",
    },
  },
});

Refactored tasks and batches usage (#1825) @flevi29

Important

TaskClient and BatchClient are no longer exported

Migration guide: tasks promises now have a "waitTask" method

// Replace this 
const task = client.createIndex("test");
 await client.waitForTask(task.taskUid);
 
// By this
await client.createIndex("test").waitTask();

Migration guide: access TaskClient via the tasks property

// Replace this
client.getTask(1)
client.tasks.getTask(1)

// by this
client.getTasks()
client.tasks.getTasks()

Note

TaskClient is also accessible through the Index class, e.g., client.index('myindex').tasks

Migration guide: access BatchClient via the batches property

// Replace this
client.getBatch(1)
client.batches.getBatch(1)

// By this
client.getBatches()
client.batches.getBatches()

Note

BatchClient is also accessible through the Index class, e.g., client.index('myindex').batches

Updated exported types

Important

  • Removed Batch, EnqueuedTask, and Task classes. The types are still exported!
  • Date properties on Batch, EnqueuedTask, and Task are now string. They can be converted to a date using e.g. new Date(string)
  • Renamed MeiliSearchTimeOutError to MeiliSearchRequestTimeOutError
  • Renamed TasksQuery to TasksOrBatchesQuery

🚀 Enhancements

🐛 Bug Fixes

  • Refactor HttpRequests (#1741) @flevi29
  • Remove custom TypeScript ESLint rules and adapt code, fix HttpRequests issue where timeout errors sometimes weren't properly thrown (#1749) @Barabasbalazs
  • Improve TaskClient, BatchClient and associated types (#1825) @flevi29

⚙️ Maintenance/misc

Thanks again to @Barabasbalazs, @Strift, @consoleLogIt, and @flevi29! 🎉