aerb
06/14/2020, 12:45 AMturansky
06/14/2020, 2:00 AMjw
06/14/2020, 2:00 AMjw
06/14/2020, 2:01 AMfkrauthan
06/14/2020, 2:37 AMjw
06/14/2020, 2:41 AMnapperley
06/14/2020, 2:55 AMjw
06/14/2020, 2:59 AMfkrauthan
06/14/2020, 3:28 AMfkrauthan
06/14/2020, 3:30 AMjw
06/14/2020, 3:34 AMIlya Goncharov [JB]
06/14/2020, 6:32 AMfkrauthan
06/15/2020, 4:55 AManton.bannykh
06/16/2020, 1:15 PManton.bannykh
06/16/2020, 1:19 PManton.bannykh
06/16/2020, 1:25 PMfkrauthan
06/16/2020, 4:41 PMfkrauthan
06/16/2020, 4:41 PManton.bannykh
06/17/2020, 2:08 PManton.bannykh
06/17/2020, 2:11 PMTristan
06/17/2020, 2:26 PM@Deferred
import com.something
Then later in the code, when you use the deferred library, we can have a little icon on the left, like for suspend, which allow us to recognize a deferred library. And throw errors if it is not called in a suspend funtion.
Kotlin compiler would automatically do the wrap.
@Deferred
import com.something
fun badUsage() {
externalFunction()
}
suspend fun goodUsage() {
externalFunction()
}
To which the compiler plugin could add the missing function.
suspend fun goodUsage() {
loadLibrary()
externalFunction()
}
Just throwing some ideas 😅anton.bannykh
06/17/2020, 2:36 PManton.bannykh
06/17/2020, 2:37 PMturansky
06/17/2020, 2:37 PMI don’t see a way around right now, but would be glad to be proven wrong.It can be emulated right now via multiple outputs Assumtion: Chunk == separate class/package
Tristan
06/17/2020, 2:38 PMturansky
06/17/2020, 2:39 PMturansky
06/17/2020, 2:40 PMsuspend
function - most flexible solution in my opinionanton.bannykh
06/17/2020, 2:45 PM// chunk 1 (loaded lazily / on demand / dynamically )
function foo() {....}
// chunk 2
// Non-suspend context
foo() // <- we cannot stop and wait until chunk 1 is loaded
// So this should either be prohibited
// Or the developer should explicitely expect that `foo()` might not be able to execute because the module was not loaded.
So it seems impossible to eliminate certain dependencies without changing the program semantics.turansky
06/17/2020, 2:45 PM// service in "main.js"
class MyExporter {
@Chunk // "svg-export.js"
suspend toSvg():Promise<File> {
// load big chunk
// create job
}
@Chunk // "pdf-export.js"
suspend toPdf():Promise<File> {
// load big chunk
// create job
}
@Chunk // "vsdx-export.js"
suspend toVsdx():Promise<File> {
// load big chunk
// create job
}
}
anton.bannykh
06/17/2020, 2:46 PMturansky
06/17/2020, 2:48 PMsuspend
turansky
06/17/2020, 2:55 PMTristan
06/17/2020, 2:55 PManton.bannykh
06/17/2020, 3:02 PMturansky
06/17/2020, 3:06 PMwas about the compilerI miss this condition/context
anton.bannykh
06/17/2020, 3:06 PMturansky
06/17/2020, 3:14 PMBrandon Saunders
07/27/2020, 6:28 PMMarc Knaup
11/20/2020, 3:57 PM-Xir-per-module
which helps with code splitting. It generates separate JS files per Gradle module and dependency.
It definitely helps with splitting up a Kotlin React project and loading parts of it dynamically.
I haven’t tried to use it for multiple entry points in Webpack but in theory it shouldn’t be a problem 🤔
https://github.com/fluidsonic/kjs-chunks