Skip to content

danysantiago/room-web-demo

Repository files navigation

This is a Kotlin Multiplatform project targeting Web and uses Room 3.0.

  • /composeApp is the code that will be shared across your Compose Multiplatform app in Js and WasmJs.
  • /sqliteWasmWorker contains a web worker that implements the WebWorkerSQLiteDriver protocol using the SQLite WASM library.
  • /sqlJsmWorker contains a web worker that implements the WebWorkerSQLiteDriver protocol using the sql.js library. This worker, as implemented only support in-memory databases.

Room for the Web

This small project demonstrates setting up Room 3.0 targeting the Web and configuring it with a WebWorkerSQLiteDriver whose Web Worker are local NPM modules. Even though this project demonstrates two web worker implementations, only one is needed for your project.

Build and Run Web Application

To build and run the development version of the web app, use the run configuration from the run widget in your IDE's toolbar or run it directly from the terminal:

  • for the Wasm target (faster, modern browsers):
    • on macOS/Linux
      ./gradlew :composeApp:wasmJsBrowserDevelopmentRun
    • on Windows
      .\gradlew.bat :composeApp:wasmJsBrowserDevelopmentRun
  • for the JS target (slower, supports older browsers):
    • on macOS/Linux
      ./gradlew :composeApp:jsBrowserDevelopmentRun
    • on Windows
      .\gradlew.bat :composeApp:jsBrowserDevelopmentRun

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors