Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Rollout Tier 9 - Timepicker #378

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

kikuomax
Copy link
Collaborator

Related issues:

Proposed Changes

  • Migration of timepicker
    • packages/buefy-next/rollup.config.mjs will likely cause a conflict after merging the other PRs in this tier.

Rewrites the `Timepicker` component in the `src/components/timepicker`
in TypeScript.

Directly specifies the names of the other Buefy components that
`Timepicker` depends on instead of indirectly specifying the `name`
props of those components.

Trivial changes in `Timepicker.vue`:
- Adds `lang="ts"` to the `<script>` section
- Wraps the entire component definition with a `defineComponent` call
- Stops importing and registering the `Icon` component because it is not
  used

Trivial changes in `index.js`:
- Replaces the extension: ".js" → ".ts"
- Specifies the parameter type of the `Plugin.install` method
Rewrites `src/components/timepicker/Timepicker.spec.js` in TypeScript.

All changes are straightforward:
- Replaces the extension: ".js" → ".ts"
- Imports the spec build blocks from the `vitest` package
- Appends ".vue" extension to the path to import the `Timepicker`
  component
- Types `wrapper` with `VueWrapper`

In the `src/components/timepicker/__snapshots__` folder, replaces the
spec snapshot produced by Jest with the one by Vitest:
- `Timepicker.spec.js` → `Timepicker.spec.ts`
`rollup.config.mjs` removes "timepicker" from `JS_COMPONENTS`.
Rewrites the documentation for `Timepicker` in the
`src/pages/components/timepicker` 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.
@kikuomax kikuomax requested a review from wesdevpro January 12, 2025 04:55
@kikuomax
Copy link
Collaborator Author

@wesdevpro This PR is ready for your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants