-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Reduce @squoosh/lib
Node.js API usage (make it run on the web)
#1123
Conversation
loadFile
parameter to ImagePool
constructor@squoosh/lib
(make it run on the web)
@squoosh/lib
(make it run on the web)@squoosh/lib
(make it run on the web)
@squoosh/lib
(make it run on the web)@squoosh/lib
Node.js API usage (make it run on the web)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the plan is to make this code fully platform-agnostic, then it looks great, I just found some minor issues :)
However, I believe we agreed that it would be nice to have wrappers for specific platforms, which would (among other things) still allow passing file paths to ingestImage
, and still allow the default worker_threads
to be set with cpus.length
?
If that is still the plan, I would suggest making that wrapper before publishing a new version. These changes are very breaking, and it is pretty annoying for all parties involved to be forced to implement these new changes, only to see them be reverted in the near future.
Co-authored-by: Anton <dev@atjn.dk>
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
I don't think it's worth the maintenance burden because the consumer only needs to add one line of code to get CPU count. If we wanted to do this, we would need to make sure CI tested each of those platforms (it looks like there isn't even any tests yet at all 😬 ) Let's keep |
I just realized, the only remaining Node.js API is Should I swap that out for web-worker in this PR or create a new PR after this one is merged? |
Hm, I’m torn. I kind agree with @atjn that this is pretty breaking and it’d be nice to provide wrappers. That being said, we have removed paths as parameters from To your question, @styfle: Yes, let’s pull in |
@surma @developit I tried to convert from Node.js Any thoughts on how to restructure this code to make squoosh/libsquoosh/src/index.ts Lines 281 to 283 in 816d1f9
|
I'm doing some work locally based on this PR to try to get |
@developit Thats great to hear! Are you going to submit it as a new PR with all the changes or should we merge this PR first and you create a follow up? |
Co-authored-by: Anton <dev@atjn.dk>
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
1 similar comment
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@surma Everything is up to date and the CLI works as expected 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much, @styfle!
Thanks @styfle |
fs
since its Node.js onlyos
since its Node.js onlyThis lays the foundation for making
@squoosh/lib
run on the web.Related to #1084