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

Fixing TypeScript type definitions for image components #3980

Merged
merged 5 commits into from
Jul 20, 2022

Conversation

tony-sull
Copy link
Contributor

closes #3967

Changes

Typescript isn't properly inferring types from @astrojs/image unless imported from @astrojs/image/components. Reverting the package to import from the components directory for now until we find a clear best practices for Astro component packages

Alternatives tried

I got close using typesVersions in the integration's package.json, but TypeScript then ran into an error that the imported <Image /> component couldn't be used because it is exported with export type.

Future work

Find the right solution here to allow package authors to easily use named exports for Astro components, with full TypeScript support

Testing

Existing tests should pass

Docs

README examples updated

@changeset-bot
Copy link

changeset-bot bot commented Jul 19, 2022

🦋 Changeset detected

Latest commit: c37b6c5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/image Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: integration Related to any renderer integration (scope) label Jul 19, 2022
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, LGTM!

@tony-sull tony-sull merged commit eaf187f into main Jul 20, 2022
@tony-sull tony-sull deleted the fix/image-component-types branch July 20, 2022 00:33
@astrobot-houston astrobot-houston mentioned this pull request Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 BUG: @astrojs/image types are wacky
2 participants