jw
02/10/2025, 8:04 PMregisterExtensions
function called, but a registering an IrGenerationExtension
normally doesn't seem to have it be called. Is there something else I can do to make this work?jw
02/10/2025, 8:20 PMTóth István Zoltán
02/11/2025, 3:00 AMPHondogo
02/11/2025, 6:38 AMkotlin.js.ir.output.granularity=whole-program
And some minimal code example:
// at core library
object Registry {
fun register(component: Any) {
...
}
}
// at component file
@Component
class TestComponent
// below is IR generated code for Js/WasmJs (in the same file with TestComponent)
@EagerInitialization
val TestComponentInit_: Unit = run {
Registry.register(TestComponent())
}PHondogo
02/11/2025, 6:45 AMTóth István Zoltán
02/11/2025, 7:09 AMPHondogo
02/11/2025, 7:11 AMTóth István Zoltán
02/11/2025, 8:03 AMPHondogo
02/11/2025, 8:50 AMjw
02/11/2025, 12:49 PMjw
02/11/2025, 12:50 PMdmitriy.novozhilov
02/17/2025, 8:05 AMWojciech Litewka
02/17/2025, 3:41 PMIrGenerationExtension
is invoked, with IrModuleFragment
representing that module. On the second stage, this and all dependent klibs are read at once and transformed into JS file(s). This is the whole-world IR you are asking about, but unfortunately plugins are not invoked there.
It is theoretically possible to add a new extension point for the second stage that would receive the whole IR (List<IrModuleFragment>
, as the compiler sees it), but it would likely be even more unstable than the current plugin API given our active development in this area.jw
02/18/2025, 4:33 PMWojciech Litewka
02/19/2025, 1:48 PMjw
02/19/2025, 3:05 PMVladimir Sukharev
04/02/2025, 1:43 PMjw
04/02/2025, 1:44 PM