!NhAsaYbbgmzHtXTPQJ:funklause.de

Nix NodeJS

210 Members
62 Servers

Load older messages


SenderMessageTime
13 Nov 2023
@ambroisie:belanyi.fr@ambroisie:belanyi.frOooh πŸ‘€22:58:53
@lily:lily.flowersLily Fosterah yes, the classic "i'll reply later" a few months ago (oops....)22:59:09
@lily:lily.flowersLily Fosterforgot about that22:59:12
@ambroisie:belanyi.fr@ambroisie:belanyi.frTurns out I'm already subscribed to the MR, I'd just forgotten it existed... :')23:00:56
14 Nov 2023
@szucsitg:matrix.orgszucsitgAh this looks nicer than yarn2nix πŸ€”04:13:02
@szucsitg:matrix.orgszucsitg

I spent several hours Lily Foster to figure out why yarn2nix doesn't work. I get to a state where it's functioning, there was multiple problems:

  • messing with configurephase screwed me over
  • workspace module build didn't build properly because they referred to each other (multiple layers of mess) and without it module package resolution doesn't work, it has to be mapped manually
  • modules still didn't build because I didn't input the package resolution to the derivation

Now it's a state when it can build selected modules even referencing each other, but yarn.lock is too big, and because of that any module build is 10 minutes due to very slow fixupPhase and eating up too much space. I cannot find anything that how could I exclude them from derivation, it wants to build a module for each packaging regardless of shared offlinecache. Nor I wasn't able to turn off fix up. So unless you have some any other idea, I gave up on this for now πŸ˜• i also tried to add yarn.lock to each module but it’s not maintable either. Anyway, I just wanted to thank you for your kind help πŸ™‚

12:33:19
@lily:lily.flowersLily Foster
In reply to @szucsitg:matrix.org

I spent several hours Lily Foster to figure out why yarn2nix doesn't work. I get to a state where it's functioning, there was multiple problems:

  • messing with configurephase screwed me over
  • workspace module build didn't build properly because they referred to each other (multiple layers of mess) and without it module package resolution doesn't work, it has to be mapped manually
  • modules still didn't build because I didn't input the package resolution to the derivation

Now it's a state when it can build selected modules even referencing each other, but yarn.lock is too big, and because of that any module build is 10 minutes due to very slow fixupPhase and eating up too much space. I cannot find anything that how could I exclude them from derivation, it wants to build a module for each packaging regardless of shared offlinecache. Nor I wasn't able to turn off fix up. So unless you have some any other idea, I gave up on this for now πŸ˜• i also tried to add yarn.lock to each module but it’s not maintable either. Anyway, I just wanted to thank you for your kind help πŸ™‚

what's it trying to do during fixup? if it's just taking a while to strip stuff you could dontStrip = true; on the derivation
12:57:49
@lily:lily.flowersLily Fosteralso i'm glad you figured out at least those problems! sorry i didn't end up being more helpful πŸ˜…12:58:03
@szucsitg:matrix.orgszucsitgThanks, dontstrip does made it much faster. Also I figured out that I had the unlink error I just forgot to mention due to parallel writes to cache. Unfortunately I ran into another issue. Infinite recursion... My colleagues made circular dependency between workspace modules πŸ˜…13:49:07
@lily:lily.flowersLily Foster
In reply to @szucsitg:matrix.org
Thanks, dontstrip does made it much faster. Also I figured out that I had the unlink error I just forgot to mention due to parallel writes to cache. Unfortunately I ran into another issue. Infinite recursion... My colleagues made circular dependency between workspace modules πŸ˜…
oof
13:49:49
@lily:lily.flowersLily Fosteridk how yarn or yarn2nix does peer dep handling13:50:00
@joepie91:pixie.town@joepie91:pixie.townyarn 1.x treats peer dependencies as optional dependencies; it does not automatically install them, and just produce a warning if they are missing. this is what used to be the behaviour of npm as well. I don't know if newer Yarn versions have changed this13:51:37
@joepie91:pixie.town@joepie91:pixie.town * yarn 1.x treats peer dependencies as optional dependencies; it does not automatically install them, and just produces a warning if they are missing. this is what used to be the behaviour of npm as well. I don't know if newer Yarn versions have changed this13:51:43
@lily:lily.flowersLily Foster
In reply to @joepie91:pixie.town
yarn 1.x treats peer dependencies as optional dependencies; it does not automatically install them, and just produce a warning if they are missing. this is what used to be the behaviour of npm as well. I don't know if newer Yarn versions have changed this
but it otherwise does the circular resolution okay? i figure it's probably a yarn2nix bug anyway (there seems to be no shortage of those, unfortunately...)
13:52:32
@joepie91:pixie.town@joepie91:pixie.townI think circular dependencies are undefined behaviour in JS modules?13:54:36
@joepie91:pixie.town@joepie91:pixie.town not sure how Yarn handles those in general actually 13:54:45
@joepie91:pixie.town@joepie91:pixie.towntypical peer dependency use would involve one 'primary' package and a bunch of eg. plugin packages that peer-depend on that primary package; I've never really seen peer dependencies used outside of plugin architectures like that13:55:23
@joepie91:pixie.town@joepie91:pixie.townso that wouldn't be circular, exactly13:55:43
@lily:lily.flowersLily Fosteryeah i suppose they're not designed to be circular, but i thought they were designed to be used in scenarios that otherwise might be circular, like plugin deps13:57:30
@lily:lily.flowersLily Fosteridk i need coffee anyway and brain is not working well yet13:57:45
@lily:lily.flowersLily Foster(i'd definitely trust your judgement way more than my own on this anyway)13:58:46
@szucsitg:matrix.orgszucsitgI checked the code they really cross-referenced the project while not even declaring the module in package.json πŸ™„πŸ€¦β€β™‚οΈ13:59:51
@joepie91:pixie.town@joepie91:pixie.town

perhaps there are circular plugin architecures, but usually it's more something like

const thing = require("thing");
const thingPluginA = require("thing-plugin-a);
const thingPluginB = require("thing-plugin-b");

let instance = thing({ plugins: thingPluginA, thingPluginB });

and so both the "core" package and the plugin packages are loaded from the application code, the plugins don't load the core and the core doesn't load the plugins, the peer dependency constraint just serves to give people a warning if they have an incompatible core and plugins in the same project

14:02:22
@joepie91:pixie.town@joepie91:pixie.town *

perhaps there are circular plugin architecures, but usually it's more something like

const thing = require("thing");
const thingPluginA = require("thing-plugin-a");
const thingPluginB = require("thing-plugin-b");

let instance = thing({ plugins: thingPluginA, thingPluginB });

and so both the "core" package and the plugin packages are loaded from the application code, the plugins don't load the core and the core doesn't load the plugins, the peer dependency constraint just serves to give people a warning if they have an incompatible core and plugins in the same project

14:02:28
@keiichi:matrix.org@keiichi:matrix.org

I wonder if it's possible to just install a list of dependencies https://github.com/svanderburg/node2nix#adding-unspecified-dependencies , like having a package.json

 [
  "floomatic"
]

npm update doesn't work so I think not. My original issue is that right now I need to use export NODE_PATH="${pulumiSdks}/lib/node_modules/PKG_NAME/lib/modules" while my package has 0 source code, it's just a compilation of dependencies (same package.json as my original)

14:09:55
15 Nov 2023
@kranzes:matrix.org@kranzes:matrix.org joined the room.12:41:52
@grahamc:nixos.org@grahamc:nixos.orgchanged room power levels.16:10:49
@grahamc:nixos.org@grahamc:nixos.org left the room.16:10:49
@qyliss:fairydust.space@qyliss:fairydust.space joined the room.17:38:27
@keiichi:matrix.org@keiichi:matrix.orgIt's funny how no one seems to be using typescript https://www.reddit.com/r/Nix/comments/x7tdxd/building_typescript_node_apps_with_nix/ https://www.reddit.com/r/NixOS/comments/16xlbk2/looking_for_help_to_use_nixos_in_a_typescript/17:41:43

Show newer messages


Back to Room ListRoom Version: 6