Skip to content

Latest commit

 

History

History
38 lines (33 loc) · 1.72 KB

File metadata and controls

38 lines (33 loc) · 1.72 KB

This is a Kotlin Multiplatform project targeting Web and uses Room 3.0. Refer Figma : https://www.figma.com/design/4ncw03sYtNwO95HWyylb2a/To-do-List-Web-App-Design--Community-?node-id=26-119&t=oipiHvJN3f7FxXbY-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