Was nodejs require removed from stdlib in 1.4? Can...
# javascript
b
Was nodejs require removed from stdlib in 1.4? Can't find it anymore
t
Looks like expected
Separate nodejs wrappers are already available
b
But require is useful when building for the browser too
E.g. importing css
t
It's target specific API in my understanding Similar name - not marker
b
How do you mean?
t
require
exists for node and browser targets
But it doesn't mean, that it will exist in new target
b
nodejs’
require
wasn’t part of stdlib
b
i could swear i saw it in kotlinext.js package
b
there is
require
funs in the
kotlin
package for preconditions
Hasn't moved to kotlinx.js package when kotlinext was renamed
b
Probably it’s from kotlin-extensions
b
I think this is a significant regresion, because now you need to declare an unused variable to include css (or declare require yourself as external function) From this:
Copy code
fun main() {
  require("css/main.css")
}
To this:
Copy code
@JsModule("css/main.css")
@JsName("default")
external val useless:dynamic

fun main() {
}
⬆️ 1
Wasn't kotlin extensions (kotlinext) just migrated to kotlinx?
b
No
b
I see, my bad
b
Declarations from
kotlin.dom
and
kotlin.browser
moved to
kotlinx.dom
and
kotlinx.browser
b
I'm guessing JsObject interface an builder also is in kotlin-extensions?
g
aren't you able to define
external fun require(path: String)
?
b
I am, I was just baffled where the old one went.
In the end turns out I've just removed kotlin-extensions
b
Yeap