Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ fun <CONTENT_CATEGORY: ContentCategory, TAG: Tag<CONTENT_CATEGORY>> Component<TA
fun <CONTENT_CATEGORY: ContentCategory> component(
block: StatedDsl<CONTENT_CATEGORY>.() -> Unit,
): Component0<Tag<in CONTENT_CATEGORY>, in CONTENT_CATEGORY> {
println("component start $block")
return object: Component0<Tag<CONTENT_CATEGORY>, CONTENT_CATEGORY> {
override fun render(
parentDsl: StatedDsl<out
CONTENT_CATEGORY>,
key: String?,
) {
println("component")
@OptIn(ExperimentalUuidApi::class)
val nonNullKey = key ?: Uuid.random().toString()
val state = parentDsl.dslState.getOrCreateSubDslState(nonNullKey, this)
Expand All @@ -38,9 +36,7 @@ fun <CONTENT_CATEGORY: ContentCategory> component(
return parentDsl.applyElement(element)
}
}
println("component newDsl")
newDsl.block()
println("component end")
parentDsl.registerSubDsl(
RegisteredDslData(
newDsl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ interface StructuredComponent<
fun newDsl(dslState: DslState): DSL
@OptIn(ExperimentalUuidApi::class)
override fun render(parentDsl: StatedDsl<out CONTENT_CATEGORY>, arg1: DSL.() -> Unit, key: String?) {
println("render start $arg1")
val nonNullKey = key ?: Uuid.random().toString()
val dslState = parentDsl.dslState.getOrCreateSubDslState(nonNullKey, this)
val dsl = newDsl(dslState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ interface StatedDsl<CONTENT_CATEGORY: ContentCategory>: Dsl {
operator fun <TAG: Tag<in CONTENT_CATEGORY>, DSL> Component1<TAG, in CONTENT_CATEGORY, DSL>.invoke(
key: String? = null, block: DSL,
) {
println("invoke")
return [email protected](this@StatedDsl, block, key)
}

Expand Down
1 change: 0 additions & 1 deletion renlin/src/jsMain/kotlin/net/kigawa/renlin/Entrypoint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class Entrypoint(
fun <CONTENT_CATEGORY: ContentCategory> render(
component: Component0<*, CONTENT_CATEGORY>, dispatcher: StateDispatcher,
) {
println("Entrypoint")
val dsl = DomDsl<CONTENT_CATEGORY>(element, dispatcher)
component.render(dsl, "root")
}
Expand Down
2 changes: 0 additions & 2 deletions sample/src/jsMain/kotlin/net/kigawa/renlin/sample/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ fun main() {
val sub = Sub()
val sample = SampleComponent("sample", sub)
val dispatcher = HakateInitializer().newStateDispatcher()
println("Hello, world!")
Entrypoint(root).render(sample.root, dispatcher)
println("Hello, world! 2")
var i = 0
window.setInterval(
{
Expand Down
Loading