types: leverage variadic tuple for plugin tuple#91
Conversation
67ef0cb to
882f7fa
Compare
This comment has been minimized.
This comment has been minimized.
|
As I understand it, starting to use TS4 only features would break all TS3 users, correct? |
It would break TS 3 users directly depending on unified's typings or who have strict lib checks enabled
The frustration previously was from introducing a typescript version requirement/upgrade in a minor release. Combined a clear changelog, this allows downstream adopters to choose when they want to upgrade. |
|
Another option on available. |
|
To me maintaining two versions for a bit doesn’t seem too bad. It allows us to push TS 4 earlier and to more folks (it doesn’t need to bubble through remark/rehype/retext). While the load of maintaining two versions shouldn’t be very time consuming (some copy/pasting, and we don’t touch them too much after creation). Then, say in a year or so, when a next major is due to some other reason, we can ditch TS 3.2? |
882f7fa to
4f6ad66
Compare
Done, the types have been split. |
when `use([plugin, setting])` syntax is used, typescript can now warn if the settings object does not match with what the plugin expects.
4f6ad66 to
b846694
Compare
|
Good to go? Minor? |
|
Yep, good to go, and semver minor should be accurate. |
|
Released in 9.2.0! |
|
Not sure if it's related to this change or not, but just so you know, I got this error after upgrading to v9.2.0: I'm not using TS 4 yet. Solution was to use 9.1.0. |
|
@diegohaz could you open a thread in https://github.com/unifiedjs/unified/discussions? This change has been tested across typescript versions from 3.4 to 4.0 using dtslint, both in this repo, and again downstream in most remark/rehype plugins that provide typings (for example remark itself) |
when
use([plugin, setting])syntax is used, typescript can now warn if the settings object does not match with what the plugin expects.TypeScript 4 is currently in beta, this should not be merged until after there is a stable release.