Skip to content

Js Support#250

Open
KevinSchildhorn wants to merge 60 commits into
mainfrom
ks/Web4
Open

Js Support#250
KevinSchildhorn wants to merge 60 commits into
mainfrom
ks/Web4

Conversation

@KevinSchildhorn

@KevinSchildhorn KevinSchildhorn commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Web Support

This PR adds Web support for Droidcon.

Note: This PR uses JS, not WASM, because of certain limitations of libraries. When those libraries are updated we can include WASM Support.

Note: The UI is not final, hence the draft. We are using Adaptive Layout and need to adjust some small parts

How to run:
./gradlew web:jsBrowserDevelopmentRun

To test local times, you need to set testNotificationTimes = true in shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultSyncService.kt

Screenshots

I have to fix these

Android Web
Screenshot 2026-04-22 at 1 53 14 PM Screenshot_20260422_141042
Screenshot 2026-04-22 at 2 11 00 PM
Screenshot 2026-04-22 at 2 11 31 PM Screenshot_20260422_141054
Screenshot 2026-04-22 at 2 12 38 PM Screenshot_20260422_141133
Screenshot 2026-04-22 at 2 13 32 PM Screenshot_20260422_141339
Screenshot 2026-04-22 at 2 13 50 PM Screenshot_20260422_141352
Screenshot 2026-04-22 at 2 14 08 PM Screenshot_20260422_141401
Screenshot 2026-04-22 at 2 14 12 PM Screenshot_20260422_141415
Screenshot 2026-04-22 at 2 15 14 PM Screenshot_20260422_141511
Screenshot 2026-04-22 at 2 17 15 PM Screenshot_20260422_141649

@wellingtoncosta wellingtoncosta left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. LGTM overall.

Comment thread web/src/webMain/kotlin/co/touchlab/droidcon/web/DependencyInjection.kt Outdated
Comment thread build.gradle.kts Outdated

@wellingtoncosta wellingtoncosta left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested locally and it looks good to me.

@DanielSouzaBertoldi DanielSouzaBertoldi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good direction overall, most of the comments are really minor stuff, but there are some of them I think it's really important that we address before we merge. Great work! 🚀

lifecycle.whileAttached {
try {
syncService.runSynchronization(conference = conference)
syncService.forceSynchronize(conference)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like dead code to me 🤔

While reading the runSynchronization code, I noticed it suspends inside a coroutineScope { launch { while(isActive) } } and it just never returns while the scope is alive.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, digging a bit deeper, I believe that we don't even need this forced synchronization.

runSynchronization instantiates the lastSessionizeSyncThisLoop with the current time - 3 hours:

var lastSessionizeSyncThisLoop: Instant = dateTimeService.now().minus(3, DateTimeUnit.HOUR)

Which a bit down below timeToSync checks if lastSessionizeSyncThisLoop is equals or more than 15 minutes ago:

// simplified
val timeToSync = lastSessionizeSyncThisLoop <= dateTimeService.now().minus(15, DateTimeUnit.MINUTE)

Which means that runSynchronization will always trigger a sync when it first runs.

What do you think? Is there a corner case of some sort I'm not aware of?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was a corner case but I don't remember at this time. Let me play around with it and see if there's an issue.

Comment thread shared/src/jsMain/kotlin/co/touchlab/droidcon/Koin.js.kt Outdated
Comment thread web/src/webMain/kotlin/co/touchlab/droidcon/web/DependencyInjection.kt Outdated
Comment on lines -67 to 70
additionalModules +
platformModule +
coreModule,
platformModule +
coreModule +
additionalModules,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we reverse the order here? Can't this affect Android/iOS too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll revert this and see if it works. It might've been based on some of the SQL koin work I'm reverting.

),
conferenceTableAdapter = ConferenceTable.Adapter(
conferenceTimeZoneAdapter = timeZoneAdapter,
// Note: selectedAdapter will be added when the adapter is regenerated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When exactly is the adapter going to be regenerated? Without it the conference table might not deserialize correctly on web right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. It's an object so maybe it won't? I'm not sure exactly what you mean sorry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was asking because of the comment "selectedAdapter will be added when the adapter is regenerated", which to me looks like some leftover work? Idk, I'm not sure either what it means lol

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea it was a leftover, sorry.

Comment thread web/src/jsTest/kotlin/co/touchlab/droidcon/web/WebKoinTest.kt Outdated

@DanielSouzaBertoldi DanielSouzaBertoldi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good direction overall, most of the comments are really minor stuff, but there are some of them I think it's really important that we address before we merge. Great work! 🚀

KevinSchildhorn and others added 23 commits May 28, 2026 15:33
Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
…/session/SessionDetailViewModel.kt

Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
…/session/SessionDayViewModel.kt

Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
…/session/BaseSessionListViewModel.kt

Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
…mposeView.kt

Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
…ce/impl/DefaultApiDataSource.kt

Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
…ce/impl/DefaultApiDataSource.kt

Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
…ce/impl/DefaultApiDataSource.kt

Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
…ce/impl/DefaultApiDataSource.kt

Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
Co-authored-by: Daniel Bertoldi <dsdanielbertoldi@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants