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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: force bundle is-svg #740

Merged
merged 1 commit into from Aug 23, 2023
Merged

fix: force bundle is-svg #740

merged 1 commit into from Aug 23, 2023

Conversation

skjnldsv
Copy link
Contributor

Increase the size a bit, but it's the only solution I've found 馃槥

Signed-off-by: John Molakvo忙 <skjnldsv@protonmail.com>
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #740 (5b87bb9) into master (82e5420) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #740   +/-   ##
=======================================
  Coverage   77.15%   77.15%           
=======================================
  Files          17       17           
  Lines         394      394           
  Branches      107      107           
=======================================
  Hits          304      304           
  Misses         77       77           
  Partials       13       13           

@susnux
Copy link
Contributor

susnux commented Aug 23, 2023

But we have some pure ESM packages, if you add them to the jest transform it should work? (see nextcloud-vue there are a lot of pure ESM dependencies).

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Aug 23, 2023

Try it yourself, I tried for hours, 馃槩
Adding to the jest transform have no effect on server, I don't understand why

@susnux
Copy link
Contributor

susnux commented Aug 23, 2023

Because bundling dependencies here for just jest is a anti pattern I think.
Maybe just import it like import('is-svg').default which work also for commonjs?

Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

I would prefer not bundling and instead dynamically importing it, but 馃し

@skjnldsv
Copy link
Contributor Author

skjnldsv commented Aug 23, 2023

I would prefer not bundling and instead dynamically importing it, but 馃し

Tried it too, can't dynamically import in a class (async issues) or at the root of the file.
Both fails. If you have any better solution, I'm up for it, that's all I could find, and I'm not super happy about it either :(

@skjnldsv skjnldsv merged commit f4bfe29 into master Aug 23, 2023
10 checks passed
@skjnldsv skjnldsv deleted the fix/is-svg branch August 23, 2023 11:03
@susnux
Copy link
Contributor

susnux commented Aug 23, 2023

Then the only other solution I can think of at the moment would be to only bundle for CJS, but not sure if this is possible. So lets stick with this for the moment.

(wanted to submit, but: Maybe it works if we also drop CJS support. This way the using libraries and apps have to handle it as ESM so there will be no require('is-svg') issue. But not sure if this has any sideeffects, so just an idea.)

@skjnldsv skjnldsv mentioned this pull request Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants