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

add support for node engine 18 for @squoosh/lib #1242

Closed
pumano opened this issue Apr 29, 2022 · 26 comments · May be fixed by #1266
Closed

add support for node engine 18 for @squoosh/lib #1242

pumano opened this issue Apr 29, 2022 · 26 comments · May be fixed by #1266

Comments

@pumano
Copy link

pumano commented Apr 29, 2022

Is your feature request related to a problem? Please describe.
Problem when l need to use --ignore-engines flag for using @squoosh/lib with nodejs 18

Describe the solution you'd like
add support nodejs 18 to:

https://github.com/GoogleChromeLabs/squoosh/blob/dev/libsquoosh/package.json#L22-L24

Does other service/app have this feature?
Add any service you know/use that has this feature (We want to know for research)
https://github.com/bcheidemann/squoosh-webpack-plugin
Additional context
Add any other context or screenshots about the feature request here.

@dasa
Copy link

dasa commented May 12, 2022

This change may be need too: emscripten-core/emscripten#16917

@drcmda
Copy link

drcmda commented Jul 14, 2022

Can somebody confirm if this mean that when a package is published relying on squoosh it will crash the package on the client if they don't have node 14 or 16? I was about to use squoosh in a published gltf converter.

@Cyclic
Copy link

Cyclic commented Jul 15, 2022

Any updates on this? Is there a workaround for now? Thank you in advance.

@donmccurdy
Copy link

donmccurdy commented Jul 15, 2022

Please let us know if a PR would be welcome for this issue. Thanks! 🙏

@jpchatt
Copy link

jpchatt commented Jul 18, 2022

Upvote this

@devinmatte
Copy link

I filed #1265 but I suspect my issue is actually related to using Node 18

danielgamage added a commit to oakstudios/joinmastodon that referenced this issue Aug 11, 2022
Gargron pushed a commit to mastodon/joinmastodon that referenced this issue Aug 26, 2022
* added updating servers_count to filters in stable lists (items with 0 still shown)

pretty complicated setup, but i think works well

* fixed footer swoosh getting clipped, re-exported swoosh to make its edges tighter to the footer bounding box

* wrapping apps categories on mobile

* move SponsorGroup to a separate component file

* render out platinum + gold sponsors

* rm errant coma, add `light: true` for logos that need to be inverted

* add silver sponsors

* add `SponsorCard` component

* add link to silver sponsors

* add hero copy

* add sponsorship info sections

* extract sponsor strings

* rename `SponsorGroup` => `SponsorLogoGroup`

* updating iconCard styling to use a white bg

* rm redundant margin

* add rounded corners to default sponsor icon

* adding more api types

* using unicode-bidi:plaintext on potentially RTL user-supplied content

* adding language dropdown to servers filters

* linked homepage hero to servers

* add bg illo

* more large buttons on the homepage #48

* using `medium` button size for `large` buttons on mobile #48

* fix bug where the illo is too tall and repeats

* updating homepage hero CTAs

leaving the get_started string at that id because localizations aren't necessarily going to have the repetition with get the app that english does, and there's a lot of translations for it already

via https://www.figma.com/file/Wk8L4YNZvgTBcrpthCYmBj?node-id=320:1244#235296710

* use updated illo

* rename illo

* removing commented-out server-side code. thinking servers should be lazy loaded because they're big for an initial page load and might hold up FCP; and the server filtering should be implemented upstream in api.joinmastodon.org

* adding caching ONLY for categories, added all topics option, removed server count from language dropdown, using accessible checkboxes for filters

* updated server card design, localized number formatter

* i added rounded too many times. just needed to update it on the image

* removed sass-specific code and using tailwind breakpoints in globals to reduce redundancy

* removing old badges

* right-aligning AppCard text when RTL

* using large buttons on app features

* extracting apps grid into its own file

* try adding homepage hero

* reduce `SponsorLogoGroup` size, add hover transition

closes #46

* add server cards

* oops fix duplicate keys

* sorting apps, removing prettier where we're defining data because it's just.... so verbose and irregular

* move cards to the bottom if this is a subsequent visit

* fixing some typescript issues in apps grid, making released_on a real date

* fix duplicate message key

* add /server link to header

* refactoring twoupfeature (name?) out of the apps page

* update home page hero asset

* adjust height on smaller screen sizes

* rm unused css class

* use `b2` on testimonial text

closes #47

* moved apps data to its own file, typed and documented structure

* update /sponsors to use `TwoUpFeature` component

* add margin beneath `SponsorLogoGroup`

* wrap server filter line on mobile

* filter out languages that don’t have a label or locale

handles edge case for now where “cz” does not have a label

* adjust breakpoint for server filters/list being stacked

* added old imprint page

* updated imprint for next, with some additional semantics

* added a basic page wrapper component for imprint, etc that don't have designs and are just basic text

* added basic mobile nav

* styled mobile menu a bit, fixed some focus-related menu behavior in safari

* use new homepage hero assets

* use next image

* try using blurred placeholders

* linking footer "Get started" to /servers, adding a redirect from /communities for backwards compatability

* removing an old todo

* add priority to hero images

* add mobile server hero asset

* add mobile and desktop hero illos

* add hero text

* use rich text formatting for body copy, adjust positioning

* added loading state for server cards

* adjust width of body copy

* limiting amount of skeleton styling, using CH units instead of EMs

(they're more or less the same, but characters are easier to count + reason about than root EMs along the x axis

* center image

* get height from image import instead of hardcoding it

* added some basic misc documentation

* framing appHero correctly on /apps

* set hero heights as css variables

forgot that these height classes won’t be generated when tailwind compiles

* bulk documentation and cleanup

* sponsor grid updates for less explicit columns, extracting out cards

* typescript updates

* using general as the default filter to match current site, prevent page from loading 100+ servers on load

* going to two grid cols a little earlier on /servers

* added focus-visible-within selector ("variant"??)

* adding hocus selector, adding more focus styles

* containing reordered server sections to reduce the number of indexes counted. putting filter heading up top next to the serverFilters. spacing out GettingStartedCards and the grid section

* using icons from figma for GettingStartedCards

* added recovertranslations script to package.json and ran extract

* using jsdoc where comments defines descriptions on single variables

* marking linkAttr attributes as optional

* using plain string props if there's no interpolation that needs template strings

* added privacy-policy, updated imprint

* moved hero into its own file, added variants for homepage/inner pages, default illustration, etc etc

illos should still have 2x renderings later, but the code scaffolding should support dropping them in when that happens

* add carousel for testimonials

* try adding carousel to “Why Mastodon?” section

* Revert "try adding carousel to “Why Mastodon?” section"

This reverts commit 1f32e19.

* updated features_ images on homepage from drive

fixes #54

* add missing key

* add missing key

* add favicons

* tightened h1 leading #56, made spacing more even on homepage hero

* update testimonials card

* use grid instead of carousel

* add target/rel to link

* add missing key

* reduce max height for logos, update text style

closes #46

* rm `mix-blend-luminosity` on hover/focus

* removing unused global styles

* h2: 1.1 leading

fixes #56

* /apps hero, illos pending

* updating spacing on features to match figma via discord, using sh1 for copy

* removing carousel deps for now

* added wide apps hero

* add `cursor-pointer` to filter buttons

* only use giant size on 2xl (option 1)

* bump elephant over on tablet size

* reimplementing mika's server-side ordering of categories by their servers_count

this puts general at the top of the real list, since it's the default, and prevents the order from changing when other filters change

* padding the /servers category filters to match the mockup more closely

* white-bg nav dropdowns

* added active styling to nav items and language selector. lightened mobile menu weights accordingly

fixes #63

* adding a couple of aria-current attrs for #63

* slightly better (wrapped) server categories on mobile. could still use some disclosure ui to hide/show

* reduce max height on logos, fit on 5 lines

* add links to feature section buttons

* randomize testimonials and show first 6

* increase line height, show last 6 testimonials

closes #47

* mirror hero image when text is rtl

closes #64

* update locale files

* using more traditional badges, adjusting their layout

fixes #60

* adjust padding on `TwoUpFeature` on sponsors page

* load translations, rel #30

* closing mobile takeover menu when clicking menu items (not dropdown buttons)

fixes #59

* updated button hover state from figma and added buttons to the /guide

* used values from tailwind config in the guide to improve maintainability of the guide a bit

* adding gap to icons section of the guide

* scoped hero changed to the homepage

* added drop shadow behind text in heros

* removing overflow:auto when dropdown closed,

also removing max-height on mobile submenus, since that makes a nested scroll context

rel #65

* using margin-inline-start instead of margin-left for better RTL support on homepage hero

fixes #74

* adding translation string props to /servers, noting which pages don't need them

* update copy, closes #69

* fix duplicated ID warnings

* center items on TwoUpFeature, closes #73

* use b2, closes #47

* add meta title and description to the homepage, rel #75

* increase border radius on avatars, rel #72

* add sponsors page description, rel #75

* edit text alignment on centered TwoUpFeature, rel #73

* add og:image, rel #75

* fix key warning

* og:image needs to be an absolute url, move illo

* add carousel

* add breakpoint for number of slides shown

* trying to figure out rtl

* keep carousel ltr

* re-org file so components are listed in order of use

* add carousel to WhyMastodon section

* edit spacing, hide shadow on mobile

* fixing our react implementation of the <select> menu

* giving select menus pointer cursors and gray bg on hover

* Add hover state to navbar dropdown menus

Fixes #70

* add cache header, rel #66

* move loadIntlMessages to getStaticProps

these messages only change when the repo is updated, so these can just be loaded on build

* nvm, can’t mix ssg and getstaticprops!!

Didn’t realize you couldn’t have both. This reverts commit 37e8941.

* realizing the header offset on mobile is there for the safe-area, but that would be a pain to reliably implement

making the offset 0 on mobile for now so it's not offset on load

* touch ups for header nav updates

* black bg on mobile menu?

* fixing submenu weight

* adjustments for black-bg submenus

* hotfix for the un-scrolled state of the header's backdrop blur, which was a fully transparent blur

rel #70

* load messages

* update category list to be fetched client side only

* restore stable category list, clean up code

* clean up comments

* clean up unused imports

* add skelton text

* placeholder link to test on preview

* rm test link

* pull from query cache

* show prev server count when the new data is loading

* removed spatial keyboard navigation

could be reimplemented with https://open-ui.org/components/focusgroup.explainer when it lands, but maintaining the functionality from scratch is a bit too involved

* tightened above-the-fold space on /apps

* setting node version suggestion because of GoogleChromeLabs/squoosh#1242

* removed filters label from /servers

fixes #68

* arranged tailwind grayscales to match gradient order in :root

* adding sponsor.name as logo img's alt

was trying this out with a screen reader and think "link, image, oak studios" is clear, succinct, and scannable rather than saying having a sea of `Logo of company X` labels

* adding descriptive label to menu button

* adding descriptive label to 文A, which i think is communicative visually, but on its own, less so aurally

notably, the comma helps the screenreader pause so it doesn't sound like "文—A translated site" rather than "文A—Translate site"

* documentation update

* adding back the no_results text on /servers

* making error response text translateable

* removing featured servers logic until the data is available

* added alt text on /apps screenshots

* lighthouse thinks footer headings should be h2s—makes sense.

* move data transforms to `select()`, don’t use query cache

* rm comment

* show previous data while the new data is loading

* keep the initial order

* safelisting type/bgColor classes for /guide

* moving header/footer's `nav.__` ids to `nav.__.title` to harmonize nav structure and allow for other properties like description,

ran extract/recover again

* realizing that even though imprint/privacy policy don't need translations for content, they still need to loadIntlMessasges for the navs. also making the content dir=ltr so that reading flows more clearly

* expanding /guide with more component examples, better wrapper styling

* adding old <title> for /servers

* updating sponsors data from upstream (49e398, 6d9faa)

* deleting z_archive

rel oakstudios#29

* removing ignoreBuildErrors from next config. build does seem fine locally

* adding existing upstream publish github actions workflow

* bumped all deps

* accessing arbitrary named properties on resolved tailwind config with bracket notation so that the keys' types match the config typings

(fixing broken build after dep update)

* rm recoverTranslations file,now that we’re done with the archive

Co-authored-by: Mika Busante <mika@mikabusante.com>
Co-authored-by: Mika Busante <31963784+mikabusante@users.noreply.github.com>
Co-authored-by: Skylar Challand <skylar@oakmade.com>
@message
Copy link

message commented Sep 20, 2022

bump

@rodoabad
Copy link

rodoabad commented Oct 31, 2022

Are we just thinking of updating the engine rules? No changes needed from squoosh itself?

Switching to Node 18, I get this error.

TypeError: Failed to parse URL from /foo/node_modules/@squoosh/lib/build/imagequant_node-a4aafbae.wasm
    at Object.fetch (node:internal/deps/undici/undici:11118:11) {
  [cause]: TypeError [ERR_INVALID_URL]: Invalid URL

@rodoabad
Copy link

Found the issue - #1033.

@meotimdihia
Copy link

I am getting this error too.

TypeError: Failed to parse URL from ......./node_modules/@squoosh/lib/build/imagequant_node-a4aafbae.wasm

Node.js 18

@chr33s
Copy link

chr33s commented Nov 23, 2022

work around for node >= 18, run node --no-experimental-fetch ./script.js

@xavierfoucrier
Copy link

xavierfoucrier commented Nov 23, 2022

Hello @GoogleChromeLabs team!
cc @surma @jakearchibald 😸

Any news about NodeJS 18 support? This is a serious issue.
I was surprised that the latest version of Squoosh was published more than a year ago..

The v16 is now in "maintenance" mode and will be dropped 2023.
See https://github.com/nodejs/release#release-schedule.

@limenote
Copy link

limenote commented Dec 5, 2022

work around for node >= 18, run node --no-experimental-fetch ./script.js

can you share your ./scripts.js ? or a sample code ?
thanks

@chr33s
Copy link

chr33s commented Dec 7, 2022

@limenote simply run node with the --no-experimental-fetch flag, and don't rely on the native fetch implementation.

@cristianvasquez
Copy link

but is squoosh to be supported?

@JacobWeisenburger
Copy link

running --no-experimental-fetch worked for me

@jakearchibald
Copy link
Collaborator

Unfortunately, due to a few people leaving the team, and staffing issues resulting from the current economic climate (ugh), the CLI and libsquoosh packages are no longer actively maintained. I know that sucks, but there simply isn't the time & people to work on this. If anyone from the community wants to fork it, you have my blessing. The squoosh.app web app will continue to be supported and improved.

@jakearchibald jakearchibald closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2023
@JacobWeisenburger
Copy link

@jakearchibald
Does the squoosh.app web app support rest endpoints or some way of using it programmatically?

@websours
Copy link

websours commented Jan 4, 2023

@jakearchibald Can you or someone else suggest some good alternatives to @squoosh/lib?

@donmccurdy
Copy link

@websours if you need similar functionality in a library format for Node.js, I would consider Sharp, which is based on libvips. There appears to be some effort underway to bring libvips to WASM for web browsers as well. Since Node.js 18 is the subject of the thread here, I've confirmed that Sharp is working fine in that environment.

@JacobWeisenburger
Copy link

thanks

@xavierfoucrier
Copy link

@jakearchibald sad, but that's so reflective of the reality of open source projects right now, see project like Atom inside Github team...

Anyway, thanks a lot for letting us know! 🙏 😉

@jakearchibald
Copy link
Collaborator

@JacobWeisenburger

@jakearchibald Does the squoosh.app web app support rest endpoints or some way of using it programmatically?

It doesn't. It's entirely client side. Part of the privacy benefits is the image doesn't leave your device.

@JacobWeisenburger
Copy link

Sounds good. thanks.

kodiakhq bot pushed a commit to roots/bud that referenced this issue Jan 18, 2023
- bump node to v18 lts

blocked by: 

- GoogleChromeLabs/squoosh#1242

refers:

- #2011 

## Type of change

**PATCH: backwards compatible change**



This PR includes breaking changes to the following core packages:

- none

This PR includes breaking changes to the follow extensions:

- none

## Dependencies

### Adds

- none

### Removes

- none
@ecelliitbhu
Copy link

I'm using yarn to build my Next.js application using the command yarn build and getting this error. How could I run --no-experimental-fetch with yarn?

@burlackoff
Copy link

I'm using yarn to build my Next.js application using the command yarn build and getting this error. How could I run --no-experimental-fetch with yarn?

"build": "NODE_OPTIONS=--openssl-legacy-provider NODE_OPTIONS=--no-experimental-fetch next build"

its work for me

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 a pull request may close this issue.