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

fix: export props types of each component #405

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

KamaljeetSahoo
Copy link

@KamaljeetSahoo KamaljeetSahoo commented Oct 4, 2024

Export Component Types for Improved TypeScript Support

Overview

This pull request exports TypeScript types for all components in the polaris-vue library, enhancing developer experience without impacting bundle size or runtime performance.

Changes Made

  • Updated index.ts files to export types from their respective types.ts files
  • Example:
    export { default as VideoThumbnail } from './VideoThumbnail.vue';
    export * from './types';

Benefits

  1. Improved IDE Autocomplete and type information.
  2. No Bundle Size Impact

Example

Current:

<script setup lang="ts">
import { Button } from '@ownego/polaris-vue'
type ButtonProperties = InstanceType<typeof Button>['$props']
</script>

Proposed:

import { type IndexTableHeading, IndexTable } from '@ownego/polaris-vue';

Considerations

  • Backward compatible.
  • Reduces prop type mismatch issues.

Thank you for considering this pull request.

@juzser juzser added the feat: types All tweaks relate to typescript label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat: types All tweaks relate to typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants