Scala JS

1785 Members
Scala.js, the Scala to JavaScript compiler7 Servers

Load older messages

8 Dec 2023
@_discord_845013677816021083:t2bot.ioarmanbilge try removing this
@_discord_845013677816021083:t2bot.ioarmanbilge I don't think it's compatible with what you are doing 17:42:20
@_discord_845013677816021083:t2bot.ioarmanbilge also I see you are adding an AWS crypto dependency 17:42:50
@_discord_845013677816021083:t2bot.ioarmanbilge firstly, are you sure you need to bundle it? I don't know what JS libraries are available by default in JS lambdas 17:43:11
@_discord_845013677816021083:t2bot.ioarmanbilge secondly, I would strongly recommend avoiding JS dependencies and just using Scala alternatives 17:43:24
@_discord_845013677816021083:t2bot.ioarmanbilge for example, look at the smithy4s project which has good support for calling AWS APIs, and has already implemented the necessary cryptography support 17:43:46
@_discord_845013677816021083:t2bot.ioarmanbilge https://disneystreaming.github.io/smithy4s/ 17:44:02
@_discord_845013677816021083:t2bot.ioarmanbilge * https://disneystreaming.github.io/smithy4s/docs/protocols/aws/aws 17:44:30
@_discord_258642656052248579:t2bot.iowindymelt ah, I was going to just demonstrate that we can use npm libraries in Scala.js. 17:45:11
@_discord_845013677816021083:t2bot.ioarmanbilge does it have to be in a lambda? 😄 17:45:44
@_discord_845013677816021083:t2bot.ioarmanbilge anyway, personally I don't recommend that. we have very good support for pure Scala libraries on Node.js 17:46:03
@_discord_258642656052248579:t2bot.iowindymelt Of course, there are many good pure libraries for Scala.js. But I think it is still important to interop/bundle npm library in industrial use case. Sometimes we cannot get Scala.js support for some libraries... 17:49:32
@_discord_258642656052248579:t2bot.iowindymelt (@aws-crypto/sha256-js is just example) 17:50:09
@_discord_845013677816021083:t2bot.ioarmanbilge well, the key word here is "bundling" 17:50:12
@_discord_845013677816021083:t2bot.ioarmanbilge depending on how you are deploying it, you may or may not need to bundle 17:50:24
@_discord_845013677816021083:t2bot.ioarmanbilge for example, if you are publishing it as a CLI tool to npm, you don't need to bundle 17:50:40
@_discord_845013677816021083:t2bot.ioarmanbilge I guess this is my follow-up advice 😄 17:51:12
@_discord_845013677816021083:t2bot.ioarmanbilge if you insist to use npm dependencies, don't bundle them unless you have to 17:51:21
@_discord_845013677816021083:t2bot.ioarmanbilge it's perfectly fine to use them out of the node_modules/ directory 17:51:33
@_discord_845013677816021083:t2bot.ioarmanbilge pretty sure you can do a similar thing with lambda 17:52:09
@_discord_258642656052248579:t2bot.iowindymelt Thank you, I'll try isolating node_modules/ to care about libraries. 🥰 17:55:37
@_discord_845013677816021083:t2bot.ioarmanbilge if you run npm i @aws-crypto/sha256-js it will install in a node_modules/ and node will automatically pick it up 17:56:51
@_discord_1181711741743284265:t2bot.ioleafywind2 joined the room.18:00:06
@_discord_252141382507036672:t2bot.iopaava007 joined the room.19:04:26
9 Dec 2023
@_discord_316549337167560706:t2bot.iounarist scalajs-bundler only supports fastOptJS/fullOptJS, which only accepts single module from fastLinkJS/fullLinkJS. So it is not compatible with ModuleSplitStyle.SmallModulesFor(). 07:17:17
@_discord_316549337167560706:t2bot.iounarist 07:17:18
@_discord_316549337167560706:t2bot.iounarist Hmm, my private project also uses webpack to deploy lambda function but I'm not sure why 🤔
Maybe I can deploy it with only zipping node_modules.
@_discord_376643841857552384:t2bot.iojeengbe joined the room.13:31:03
10 Dec 2023
@_discord_757661936661037118:t2bot.iolmlynik 10:34:12
@_discord_273562710745284628:t2bot.ioaxyolotl changed their display name from ekhx#0 to axyolotl.17:55:50

There are no newer messages yet.

Back to Room ListRoom Version: 9