Skip to content

v7.0.0

Compare
Choose a tag to compare
@neet neet released this 01 May 03:01
5138dba

7.0.0 (2025-04-28)

Migration Guide

Upgrade Node.js to 20.x

Since Security Support for Node.js 18.x ended on April 30, 2025, we dropped the support for that version. 20.x is now the minimum required version, so please upgrade it for further use.

If you're using from a browser environment, please make sure that the browsers you're going to support offer corresponding APIs to ones implemented by Node.js 20, such as AbortSignal.any. Otherwise, you may need to use poyfills.

Paginator.{next, return, throw, clone} are removed

Due to the simplicity, we have changed Paginator API not to implement AsyncIterator directly, but to implement AsyncIterable instead, which has [Symbol.asyncIterator] property that returns AsyncIterator. We also offer values method as an alias for [Symbol.asyncIterator].

Therefore, if you're using paginator.next() in your codebase, you must explicitly convert them to AsyncIterator first, then use the iterator methods.

- const page = await paginator.next()
+ const page = await paginator[Symbol.asyncIterator].next()
+ const page = await paginator.values().next()

Also, the unnecessary paginator.clone() method is now removed, because [Symbol.asyncIterator] generates a new iterator instance every time.

- const paginator1 = masto.v1.lists.select("123").accounts.list();
- const paginator2 = await paginator.clone()

+ const paginator = masto.v1.lists.$select("123").accounts.list()
+ const pagenator1 = await paginator.values()
+ const pagenator2 = await paginator.values()

Renamed APIs

The following Mastodon APIs were removed due to the upstream changes or our naming convention. Please refer to the table below for the newer names.

Old name New name
SuggestionSource LegacySuggestionSource
SuggestionSource_ SuggestionSource
CreateTokenParamsWithPassword CreateTokenWithPasswordParams
v1.search.fetch Removed. Use v1.search.list
v2.search.fetch Removed. Use v2.search.list

⚠ BREAKING CHANGES

  • Remove deprecated APIs (CreateTokenParamsWithPassword, v1.search.fetch, v2.search.fetch, SuggestionSource)
  • Change PaginatorHttp.values to a generator
  • Replace mergeAbortSignals with AbortSignal.any

Features

  • Change PaginatorHttp.values to a generator (cba6d19)
  • Promote Symbol.dispose for WebSocketSubscription to a stable API (abd385a)
  • Remove deprecated APIs (CreateTokenParamsWithPassword, v1.search.fetch, v2.search.fetch, SuggestionSource) (b2ae9b5)

Bug Fixes

  • Fix URL Search Parameter with falsy value gets omitted (1b2418f)
  • Replace mergeAbortSignals with AbortSignal.any (15ee586)