Skip to content

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 requested review from blacklen and HQCuong October 7, 2024 07:40
@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