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

std(media_types): change .ts content type to application/typescript #4563

Merged
merged 2 commits into from
Apr 1, 2020
Merged

std(media_types): change .ts content type to application/typescript #4563

merged 2 commits into from
Apr 1, 2020

Conversation

zhmushan
Copy link
Contributor

@zhmushan zhmushan commented Apr 1, 2020

follow #4555

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Thanks! Since we're forking the database, can you please rename the file std/media_types/db_c50e0d1.json to std/media_types/db.json ?

@KSXGitHub
Copy link
Contributor

I don't think this database should be modified directly. What if the standard change in the future and we need to update the database using automated script without having our custom patch (typescript in this case) erased? Beside, this is not standard complaint, nor is it useful for all cases.

Instead, I think you should leave the database alone and create another database (let's call it web_media_types) for our own patch. Web server can then get Content-Type by doing web_media_types.contentType(ext) || media_types.contentType(ext).

@zhmushan
Copy link
Contributor Author

zhmushan commented Apr 1, 2020

@KSXGitHub In fact, TS videos cannot be played directly in the browser, and it's no big deal that we make changes
Sorry i misunderstood what you meant

@ry
Copy link
Member

ry commented Apr 1, 2020

I don't think it's such a big deal to fork the database... any changes to the database at this point are going to be very minor - I think we would be able to handle maintaining it.

@KSXGitHub your solution is a clean way to overlay changes on top of the existing database... but maybe it's less cognitive overhead to just fork.

@KSXGitHub
Copy link
Contributor

@zhmushan Let me re-iterate my points:

  1. We may need to update our media type database in the future. Doing so would likely erase this change you made today.
  2. Not everyone wants to use /std/media_types for web server. So .ts file should report according to standard.

@KSXGitHub
Copy link
Contributor

@ry

Forking would duplicate the amount of data. On the other hand, making a specialized database is very lightweight: It contains only TypeScript and JavaScript.

@ry
Copy link
Member

ry commented Apr 1, 2020

@KSXGitHub By "forking" I mean that we would never again pull updates from the origin.

cc @kitsonk

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM

@ry ry merged commit 3a0b617 into denoland:master Apr 1, 2020
@kitsonk
Copy link
Contributor

kitsonk commented Apr 1, 2020

I'm fine with it. There is no official source for media types. Even this source db is a conglomeration of different sources. I think it is fine to maintain wholly seperate. Git history can serve as our record of differences. If we ever wanted to update from the source again, we would just apply a git diff.

@zhmushan zhmushan deleted the media_types branch April 1, 2020 23:09
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.

None yet

4 participants