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

feat(jsx): improve type (MIME) attribute types #3305

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

ssssota
Copy link
Contributor

@ssssota ssssota commented Aug 21, 2024

embed, link, object, script, source, and style elements

embed
link
object

I did NOT add BaseMime to either source, script or style element. Should I do this?

source
script
style

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

embed, link, object, script, source, and style elements
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.31%. Comparing base (b0af71f) to head (5cb3ac2).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3305   +/-   ##
=======================================
  Coverage   96.31%   96.31%           
=======================================
  Files         151      151           
  Lines       15368    15368           
  Branches     2671     2656   -15     
=======================================
  Hits        14801    14801           
  Misses        567      567           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ryuapp
Copy link
Contributor

ryuapp commented Aug 21, 2024

Nice PR. Allow me to leave comments.

In my opinion, wouldn't it be better to provide only practical types in link tags?
Since the purpose of this PR is supporting coding for developers, it seems more reasonable to not include types that are never used, such as application/epub+zip and application/gzip.

Even in source tags, it seems more reasonable to use only media resource types(image, audio, picture and video).

@ssssota
Copy link
Contributor Author

ssssota commented Aug 22, 2024

@ryuapp

In my opinion, wouldn't it be better to provide only practical types in link tags?

Looks good! So how can I choose "practical types"? Just text/html and text/css?
The link element is also used to rel="preload" to preload assets like this: Including a MIME type.

Even in source tags, it seems more reasonable to use only media resource types(image, audio, picture and video).

Looks good too! I'll try it!

@ryuapp
Copy link
Contributor

ryuapp commented Aug 22, 2024

@ssssota

Looks good! So how can I choose "practical types"? Just text/html and text/css?
The link element is also used to rel="preload" to preload assets like this: Including a MIME type.

preload is often only used for font, css and image types, but as you pointed out, it seems that virtually all BaseMime types can be used with link tags. So, I reconsider that it would be fine for us to continue as is.

Also, the type of source tag's type attribute is awesome. Thank you.

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Member

@ssssota

Great PR, again and again! Thank you for your contribution. Merging now.

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.

3 participants