Skip to content

feat: Enforce Optionally Required Attributes Through Types #528

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

harlan-zw
Copy link
Collaborator

@harlan-zw harlan-zw commented Mar 23, 2025

πŸ”— Linked issue

#527

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Copy link
Contributor

Bundle Size Analysis

File Size Gzipped Size Size Diff Gzipped Size Diff
Client 10.7 kB (11001 B) 4.5 kB (4582 B) 0.00% (0 B) 0.00% ( 0 B)
Server 8 kB (8179 B) 3.4 kB (3467 B) 0.00% (0 B) 0.00% ( 0 B)

export interface PreloadLink extends BaseLinkAttributes {
rel: 'preload' | 'modulepreload' | 'prefetch'
href: string
as: 'audio' | 'document' | 'embed' | 'fetch' | 'image' |
Copy link
Member

Choose a reason for hiding this comment

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

is this meant to exclude 'image' so the type isn't inferred as PreloadLink | ImagePreloadLink?

just like you did with FontPreloadLink / `'font'

Copy link
Collaborator Author

@harlan-zw harlan-zw Mar 25, 2025

Choose a reason for hiding this comment

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

Thanks for the review, this is mostly AI generated as a proof of concept so there's likely issues.

Will take a look when I tackle this again but I think it's inheritly risky given the v2 stable was just released so likely being parked for a couple of months while I focus on other things.

Feel free to help out though if you're interested, can fast track it

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