Hey gang, We're trying to complete our migration ...
# javascript
a
Hey gang, We're trying to complete our migration to Kotlin 1.4 and kotlinx.serialization 1.0.1 (using the legacy compiler) We consume our Kotlin/JS libraries as npm artifacts, but the
kotlinx-serialization-kotlinx-serialization-*-jsLegacy
module names are broken with npm because npm doesn't support uppercase characters in package names Does anyone know of a workaround? Is this being worked on?
b
That should just throw a warning, not an error. Live with it until IR compiler is ready
a
I'm consuming Kotlin/JS outputs as npm artifacts in a real JS project The real JS project can't find the npm artifact because the new naming convention is invalid for npm, and it's not just a warning
b
It's not that. They simply do not exist on npm 😀
Check out https://gitlab.com/lt.petuska/npm-publish to publish your outputs properly with bundling kotlin-only deps
Note that currently it only works when installing from tarball, not the repo due to old npm bundledDependencies bug.
I'm planning to release a workaround for that during the weekend.
a
Before 1.4, we would: 1. run DCE 2. generate a package.json for the minified outputs (including a minified kotlin stdlib, and serialization libs) 3. publish each minified js file (and sourcemap) as a separate npm artifact internally 4. pull them in via yarn in our real JS app With the new naming convention of
-jsLegacy
, yarn hangs at step 4.
b
I see
Odd that it fails due to uppercase for you, I was able to install it without issues
I mean via bundledDependencies
But I'm using npm which might be a bit more lax
a
I'm guessing the
-jsLegacy
naming convention is part of the entire JS compiler architecture and not unique to #serialization I'll probably move this over to #javascript in that case. Maybe some clever bash scripts to alter the names of artifacts before publishing would be an easy first step
b
It is compiler specific