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

fix: use sgtpooki/file-type for resolving image type #7326

Merged

Conversation

pengx17
Copy link
Collaborator

@pengx17 pengx17 commented Jun 25, 2024

No description provided.

Copy link

graphite-app bot commented Jun 25, 2024

Your org has enabled the Graphite merge queue for merging into canary

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Collaborator Author

pengx17 commented Jun 25, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @pengx17 and the rest of your teammates on Graphite Graphite

@pengx17 pengx17 marked this pull request as ready for review June 25, 2024 11:07
Copy link

nx-cloud bot commented Jun 25, 2024

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 28.33%. Comparing base (81462fe) to head (7b181a6).
Report is 4 commits behind head on canary.

Files Patch % Lines
...src/modules/peek-view/view/image-preview/index.tsx 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           canary    #7326       +/-   ##
===========================================
- Coverage   58.30%   28.33%   -29.98%     
===========================================
  Files         854      654      -200     
  Lines       37714    14938    -22776     
  Branches     4086     2626     -1460     
===========================================
- Hits        21990     4233    -17757     
+ Misses      15430    10461     -4969     
+ Partials      294      244       -50     
Flag Coverage Δ
server-test ?
unittest 28.33% <0.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@forehalo forehalo left a comment

Choose a reason for hiding this comment

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

this library is ridiculous, can we really trust it?

Copy link
Collaborator Author

pengx17 commented Jun 25, 2024

this library is ridiculous, can we really trust it?

There could be other image types like webp that we may also need to introduce soon. Besides blocksuite already has its as the dependency in https://github.com/toeverything/blocksuite/blob/45bdebd333aef568fd4c0e7bd5aebf9e6a8662f0/packages/blocks/src/attachment-block/utils.ts#L185.

Copy link
Member

@pengx17 I dont know the reason but why don't we use file-type directly? browser support is included after I checked

@EYHN
Copy link
Member

EYHN commented Jun 25, 2024

@pengx17 I dont know the reason but why don't we use file-type directly? browser support is included after I checked

More context:

toeverything/blocksuite#6803
sindresorhus/file-type#578

@forehalo
Copy link
Member

forehalo commented Jun 25, 2024

I prefer easily patching file-type with yarn by our own

@EYHN
Copy link
Member

EYHN commented Jun 26, 2024

I prefer easily patching file-type with yarn by our own

I also tried patch, but the reference to node:buffer comes from his upstream package token-types

@pengx17 pengx17 force-pushed the 06-25-fix_use_sgtpooki_file-type_for_resolving_image_type branch from 4f98f0b to 0d96148 Compare June 27, 2024 01:58
@pengx17 pengx17 force-pushed the 06-25-fix_use_sgtpooki_file-type_for_resolving_image_type branch from 0d96148 to 7b181a6 Compare June 27, 2024 09:58
@forehalo forehalo enabled auto-merge (squash) June 27, 2024 10:01
@forehalo forehalo merged commit c8f418f into canary Jun 27, 2024
32 checks passed
@forehalo forehalo deleted the 06-25-fix_use_sgtpooki_file-type_for_resolving_image_type branch June 27, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants