Open lamba92 opened 2 years ago
I'm not particularly interested in nodejs (if you are using Kotlin it makes little sense to use it). The main blocker though would be that (beyond the JS ecosystem being a bit bonkers) kotlin multiplatform doesn't really support multiplatform well. If I do something I'd probably do some runtime detection magic that would allow using jsdom at runtime, but work "automagically".
My usecase would be AWS Lambdas to cope with the cold start issue, but I understand your point. Indeed I would prefer 2 really separated target for JS which is one NodeJS and another the browser in the K/MP model to solve those evil issues.
@lamba92 You may be able to try native for lambda's (they are best on cold start).
I wonder what you've ended up using for Node @lamba92. This library would suite me perfectly but the missing piece is really Node.js.
For context @pdvrieze, I'm developing a multiplatform library that will be consumed by Eclipse plugins, VS Code plugins, and native CLIs.
I can probably make it work using the generic parser/serializer, but it would still be limited as it still doesn't provide dom. Alternatively I may be able to use WASM/WASI as both are properly supported.
In the past months I developed my own solution using https://github.com/WebReflection/linkedom as DOM replacement under Node.js.
Small lib, and it is performant.
I probably just need to create a way to load the browser dom if available, and the fallback dom if not.
When running into NodeJS the dom API are not available. I would recommend a fallback to https://github.com/jsdom/jsdom with a separate artifact for nodejs.