generated from mshdabiola/SkeletonMultiplatform
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/support_wasm #179
Merged
Merged
feature/support_wasm #179
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit updates dependencies and enables hierarchical project structure for database. Specifically, the following changes were made: - Enabled hierarchical project structure for Kotlin Multiplatform module in the `database` module. - Moved dependencies to the common source set to enable shared code between platforms. - Removed unused `kotlinx-coroutines-android` dependency from commonMainApi configuration.
Adds a nonJsMain source set to the database module for shared code between Android and JVM. This allows to exclude the coroutines-android dependency from commonMainApi and add sqlite-bundled to commonMain.
This commit upgrades Ktor to version 3.0.2, updates dependencies, and introduces a new hierarchy setup for multiplatform modules. Additionally, it removes unnecessary dependencies and replaces `coil-network-okhttp` with `coil-network-ktor3` for network image loading. Here's a breakdown of the changes: - Upgraded ktor version to 3.0.2. - Updated dependencies, including coil and others. - Changed datastore's android implementation to nonJsMain. - Reorganized dependencies in testing and data modules. - Removed paging.common implementation from data. - Introduced defaultHierarchyTemplate for JVM, Android, and WASM targets. - Removed unused kermit.koin dependency from AndroidMain. - Added kermit.koin to nonJsMain source set. - Added browser support with debug capabilities to Android and library modules.
This commit introduces the implementation of the `Store` interface for the Wasm platform. It adds a new `StoreImple` class that provides in-memory storage for user data. It also adds a platform-specific module to provide the `Store` instance using Koin dependency injection.
This commit migrates the database models, DAOs, and related components from the `commonMain` source set to the `nonJsMain` source set. This change isolates the database logic to platforms that support it, while ensuring compatibility with other platforms. The following files were moved or renamed: - Model classes: `NoteEntity`, `ImageEntity` - DAO interfaces: `NoteDao`, `ImageDao` - Database class: `SkeletonDatabase` - Database module: `DatabaseModule` - Database migrations: `DatabaseMigrations` - Platform-specific code: `Platform` - Constants: `Constant` Additionally, tests were updated to reflect the new location of the database components.
This commit updates the `RealModelRepository` and `DataModule` to support multiplatform. Specifically, the following changes were made: - Moved `RealModelRepository` from `commonMain` to `nonJsMain` and `wasmJsMain`. - Created a common `DataModule` and platform-specific `DataModule` implementations for `nonJsMain` and `wasmJsMain`. - Updated dependencies and imports to reflect the new structure.
Move the model module dependency to commonMain and remove the unnecessary kotlinx-coroutines dependency. Add the sqlite-bundled dependency to the nonJsMain source set to support non-JavaScript platforms.
This commit introduces a platform-specific implementation of the `HttpClient` for Wasm using the Ktor Js engine. The `httpClient` function is now implemented for the Wasm platform, utilizing the `HttpClient(Js)` constructor and calling the `init()` function for configuration. Additionally, an empty `initPlatform` function is provided for platform-specific configuration of the `HttpClientEngineConfig`.
This commit removes the `NavigationPreview` expect/actual implementation. Instead, the preview function is now directly defined in the platform-specific modules (jvmMain and main). This simplifies the code and removes unnecessary indirection.
This commit adds `Web` as a supported platform in the `Platform` enum. It also provides implementations for `generalPath` and `currentPlatform` in the `wasmJsMain` source set, returning an empty string and `Platform.Web` respectively.
This commit replaces the `Math.toRadians` function with a new `radiansToDegrees` function in the `Background` component. This change improves code readability and ensures consistency in calculating angles. Additionally, the commit introduces a new `radiansToDegrees` function in the common code and provides a platform-specific implementation for non-JS platforms.
Moves the `NoteEx` class from the `commonMain` source set to the `nonJsMain` source set. This suggests that the functionality provided by this class is not intended or compatible with JavaScript targets.
This commit implements the analytics module for Wasm. It creates an `AnalyticsHelper` object which is responsible for logging analytics events. Currently, it does not perform any action, acting as a placeholder for future implementation.
This commit implements the analytics module for Wasm. It creates an `AnalyticsHelper` object which is responsible for logging analytics events. Currently, it does not perform any action, acting as a placeholder for future implementation.
This commit adds basic support for running the application on the web. It includes the following changes: - Added an `index.html` file to serve as the entry point for the web application. - Added a `styles.css` file for basic styling. - Added a `Main.kt` file for the web entry point, which sets up a `ComposeViewport` and renders the `SkeletonApp`.
This commit removes the `expect` and `actual` keywords from the `ProfileCardPreview` composable function, making it platform-agnostic. Additionally, it initializes Koin in the `main` function for the Wasm target and includes Kermit logger initialization. This allows dependency injection and logging in the Wasm environment. The changes also include removing platform-specific `ProfileCardPreview` implementations. Instead, the `ProfileCardPreview` function is now defined once and used for all platforms.
This commit introduces a splash screen for the Wasm target. The splash screen displays the app icon and name centered on a primary-colored background. It provides a visual cue during app initialization. Additionally, the commit includes adjustments to preview functions in `ProfileCard` and introduces `FlowExt` for semantic properties in Wasm.
This commit introduces WasmJs implementations for Background, Theme, and Type components, enabling them to function correctly in a Wasm environment. Specifically, it includes: - An implementation for `radiansToDegrees` in Background.wasmJs.kt. - Support for dynamic theming and color retrieval in Theme.wasmJs.kt. - Definitions for various text styles in Type.wasmJs.kt.
This commit adds a splash screen to the WebAssembly build of the application. The splash screen is displayed for 2 seconds before the main application is loaded. This provides a more polished user experience and allows time for the application to initialize. The splash screen is implemented using a simple `SplashScreen` composable function that displays a logo and some text. It is displayed in a `Box` composable function that also contains the main application. The `show` state variable is used to control the visibility of the splash screen. When the `show` state variable is `true`, the splash screen is displayed. When the `show` state variable is `false`, the main application is displayed. The `LaunchedEffect` composable function is used to delay the loading of the main application by 2 seconds. This ensures that the splash screen is displayed for the desired amount of time. The `mainApp` function has been created to encapsulate the splash screen and main application logic. This makes it easier to manage the splash screen and main application.
The `upsert` function in `RealModelRepository` has been updated to correctly generate unique IDs for new notes and handle updates to existing notes. Previously, `upsert` would simply add a new note to the list without considering existing IDs, potentially leading to duplicate IDs or overwriting existing notes. This change ensures that: - New notes are assigned a unique ID based on the maximum existing ID. - Updates to existing notes preserve the original ID and replace the old note in the list. - It returns the ID of the upserted note.
This commit optimizes resource access in the `SettingScreen` composable by caching string array resources to avoid redundant lookups. Specifically, the following changes were made: - Stored string array resources for theme and day/night options in local variables: `themeArray` and `dayLightArray`, respectively. - Used these cached variables to display text values in the setting items and the options dialog, using `getOrNull` for safer access and providing a fallback for empty strings. This change improves performance by reducing the number of resource lookups and ensuring safer access to string array elements.
This commit implements the `Store` interface for the wasm target using the KStore library. The `StoreImple` class now uses `storeOf` to create a `KStore` instance for storing `UserData`. The `userData` flow is now derived from the `KStore` updates, ensuring updates are reflected in the flow. The `updateUserData` function now updates the `KStore` with the transformed `UserData` and returns the updated data. This implementation provides a persistent and efficient way to manage user data in the wasm environment.
This commit makes the `Note` data class serializable using the `@Serializable` annotation from kotlinx.serialization. This enables the `Note` object to be easily converted to and from various formats like JSON, facilitating data persistence and network communication.
This commit adds the kstore dependency to the project's version catalog. Specifically, the following changes were made: - Added `kstore` version to the `[versions]` section. - Added `kstore-storage` and `kstore` libraries to the `[libraries]` section.
This commit renames `NoteEntityN` to `NoteEntity` and `NoteDaoN` to `NoteDao` in the database module. This change improves the clarity and consistency of the database module's naming conventions.
This commit changes the title of the web application from "Testing" to "Hydraulic" in the index.html file. This provides a more appropriate title for the application when viewed in a web browser.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.