forked from buefy/buefy
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TypeScript Rollout Tier 9 - Numberinput (#375)
* feat(lib): rewrite Numberinput in TS Rewrites `Numberinput` in the `src/components/numberinput` folder in Typescript: - `modelValue` accepts `null` in addition to `number` - Since `computedValue` may be `string`, a leading plus (`+`) is added to each occurrence of `computedValue` to make it a number - Introduces new types: - `ControlsAlignment`: type of the `controlsAlignment` prop. Values are defined as a constant `CONTROLS_ALIGNMENTS`. - `ControlOperation`: represents an operation associated with a button (plus or minus). Values are defined as a constant `CONTROL_OPERATIONS`. - Introduces a missing data field `_$intervalRef` Here is a tip for TypeScript migration: - Registers Buefy components with the "direct" names rather than the `name` fields so that they are type-checked. * test(lib): rewrite Numberinput.spec in TS Rewrites the spec for `Numberinput` in the `src/components/numberinput` folder in TypeScript: - Replaces an empty string given to the `modelValue` prop with `null`, which was illegal Other changes are straightforward. Here are some tips for Jest → Vitest migration: - Imports the spec building blocks from the `vitest` package - Replaces `jest` with `vi` * chore(lib): bundle numberinput in TS `rollup.config.mjs` removes "numberinput" from `JS_COMPONENTS`. * feat(docs): rewrite Numberinput docs in TS Rewrites the documentation for `Numberinput` in the `src/pages/components/numberinput` folder in TypeScript. All the changes are straightforward. Here is a TypeScript migration tip: - Explicitly import and register components so that they are type checked. No type-checking is performed for globally registered components.
- Loading branch information
Showing
14 changed files
with
147 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.