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

Update dependencies. #375

Merged
merged 2 commits into from
Apr 7, 2024
Merged

Update dependencies. #375

merged 2 commits into from
Apr 7, 2024

Conversation

sinamics
Copy link
Owner

Updates:

"next": "^14.1.4",
"prisma": "^5.11.0",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.3"

@sinamics
Copy link
Owner Author

@tinola would these versions work for you?

@tinola
Copy link
Contributor

tinola commented Mar 30, 2024

"next": "^14.1.4",

This is OK, but I still have to apply dirty hack to use swc-wasm edition because of this:

 ✓ Checking validity of types
   Creating an optimized production build ...
   Downloading swc package @next/swc-freebsd-x64...
 ⨯ Failed to download swc package from https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-14.1.4.tgz
Error: request failed with status 404

Dirty patch for node_modules/next/dist/build/swc/index.js:

--- index.js.orig       2024-02-08 09:37:43.117670000 +0100
+++ index.js    2024-02-07 13:28:27.482293000 +0100
@@ -244,7 +244,8 @@ async function loadBindings(useWasmBinary = false) {
         const disableWasmFallback = process.env.NEXT_DISABLE_SWC_WASM;
         const unsupportedPlatform = triples.some((triple)=>!!(triple == null ? void 0 : triple.raw) && knownDefaultWasmFallbackTriples.includes(triple.raw));
         const isWebContainer = process.versions.webcontainer;
-        const shouldLoadWasmFallbackFirst = !disableWasmFallback && unsupportedPlatform && useWasmBinary || isWebContainer;
+        // const shouldLoadWasmFallbackFirst = !disableWasmFallback && unsupportedPlatform && useWasmBinary || isWebContainer;
+        const shouldLoadWasmFallbackFirst = true
         if (!unsupportedPlatform && useWasmBinary) {
             _log.warn(`experimental.useWasmBinary is not an option for supported platform ${PlatformName}/${ArchName} and will be ignored.`);
         }

After this ztnet is building just fine.

Downloading swc package @next/swc-wasm-nodejs...

"prisma": "^5.11.0",

This is strange - with this line prisma client was generated as version 5.6.0.
I have to run inside ztnet folder these two commands:

npm i --save-dev prisma@latest
npm i @prisma/client@latest

After this prisma was generated as v5.11.0.

"tailwindcss": "^3.4.3",
"typescript": "^5.4.3"

Those two lines are just OK.

@tinola
Copy link
Contributor

tinola commented Mar 30, 2024

BTW, so it seems, next-swc just did f**k up with builds packages for FreeBSD and some Linux archs...

vercel/next.js#59997

and here some details:

https://github.com/vercel/next.js/blob/4efe14238b5ab11935e73aa09631ef5ec8045b13/packages/next/src/build/swc/index.ts#L52

I can't believe, what a mo..ns :(

Now, the goal is how to prepare ztnet to use wasm edition of next-swc to use with deprecated OS'es...
Is there any possibility to do it in package.json file with some conditions?
I mean:

if my_os_is_deprecated {
  use next-swc-wasm
} else { 
  do not use next-swc-wasm
}

@sinamics
Copy link
Owner Author

sinamics commented Apr 2, 2024

Now, the goal is how to prepare ztnet to use wasm edition of next-swc to use with deprecated OS'es...
Is there any possibility to do it in package.json file with some conditions?

its not possible to set conditions directly in package-json to my knowledge, but we could do these checks in the installer script.
if you know the exact os versions that needs the wasm edition i can add it in.

@tinola
Copy link
Contributor

tinola commented Apr 2, 2024

Understood.

So analysing https://github.com/vercel/next.js/blob/4efe14238b5ab11935e73aa09631ef5ec8045b13/packages/next/src/build/swc/index.ts#L122 there're some triples which falling back to use wasm bindings.
FreeBSD OS triple is listed (however does not load wasm during build process, wrrr), and Linux OS'es installed on armv7 architecture devices, for example Raspberry Pi 4B is worth to test if wasm edition is loading during build... Unfortunately I haven't got RPi to do that :(

@tinola
Copy link
Contributor

tinola commented Apr 4, 2024

@sinamics, I think you can merge this PR into main anyway :)

@sinamics sinamics marked this pull request as ready for review April 7, 2024 18:44
@sinamics sinamics merged commit 5820ac9 into main Apr 7, 2024
2 checks passed
@sinamics sinamics deleted the update-nextjs branch April 7, 2024 18:45
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.

2 participants