Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors Tyrian’s “classic” runtime into a new cross-platform tyrian-platform module by abstracting view presentation behind a PresentView typeclass, while also adding new core/location types and introducing Scala Native support across shared modules.
Changes:
- Introduces
tyrian-platform(Cmd/Sub + platform-agnostic runtime) and wires JS “classic” to it viaPresentView(HtmlViewState). - Moves JS-only subscription constructors (
timeout,every,fromEvent,animationFrameTick, etc.) intotyrian.classic.syntax. - Adds
tyrian-corelocation parsing/types and begins enabling Scala Native builds/CI (including native implementations inindigoengine-shared).
Reviewed changes
Copilot reviewed 49 out of 55 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tyrian/src-js/tyrian/classic/websocket/WebSocket.scala | Imports classic syntax to use JS-only Sub constructors (e.g., Sub.emit, Sub.every). |
| tyrian/src-js/tyrian/classic/syntax.scala | Adds JS-only extensions and Sub constructors previously living in Sub (timeouts, intervals, events, RAF ticks). |
| tyrian/src-js/tyrian/classic/rendering/Rendering.scala | Moves rendering package namespace to tyrian.classic.rendering. |
| tyrian/src-js/tyrian/classic/rendering/RendererState.scala | Moves renderer state package namespace to tyrian.classic.rendering. |
| tyrian/src-js/tyrian/classic/rendering/HtmlViewState.scala | Renames/reshapes renderer state into HtmlViewState and provides PresentView[Html, HtmlViewState]. |
| tyrian/src-js/tyrian/classic/package.scala | Adds classic aliases to platform Cmd/Sub types/companions. |
| tyrian/src-js/tyrian/classic/TyrianApp.scala | Switches classic app startup to use platform runtime with HtmlViewState initial state. |
| tyrian/src-js/tyrian/Watcher.scala | Imports classic syntax to keep using JS-only Sub constructors for watchers. |
| tyrian/package.mill | Switches Tyrian to depend on tyrian-platform (and trims JS-only deps from Tyrian module). |
| tyrian-tags/package.mill | Adjusts JS/JVM module structure and dependencies to account for new core/platform separation. |
| tyrian-platform/test/src/tyrian/platform/SubTests.scala | Updates tests for new package/module location and avoids callback state clashes. |
| tyrian-platform/test/src/tyrian/platform/SubLawsTest.scala | Updates laws tests to new runtime/helper package and changes Arbitrary Sub construction. |
| tyrian-platform/test/src/tyrian/platform/CmdTests.scala | Updates package and removes classic syntax usage in favor of direct Cmd.Run. |
| tyrian-platform/test/src/tyrian/platform/CmdSubUtils.scala | Updates package to tyrian.platform. |
| tyrian-platform/test/src/tyrian/platform/CmdLawsTest.scala | Updates helper import/package to tyrian.platform.runtime. |
| tyrian-platform/src/tyrian/platform/runtime/TyrianRuntime.scala | Makes runtime view-platform-agnostic via PresentView, storing a generic view state Ref. |
| tyrian-platform/src/tyrian/platform/runtime/SubHelper.scala | Moves helper into tyrian.platform.runtime and updates imports. |
| tyrian-platform/src/tyrian/platform/runtime/PresentView.scala | Introduces the rendering/presentation typeclass used by TyrianRuntime. |
| tyrian-platform/src/tyrian/platform/runtime/CmdHelper.scala | Moves helper into tyrian.platform.runtime and updates imports. |
| tyrian-platform/src/tyrian/platform/Sub.scala | Moves Sub to tyrian.platform and removes JS-only constructors from platform core. |
| tyrian-platform/src/tyrian/platform/Cmd.scala | Moves Cmd to tyrian.platform and updates helper import. |
| tyrian-platform/package.mill | Adds new cross-platform module with js/jvm/native targets and dependencies. |
| tyrian-platform/README.md | Documents purpose of new tyrian-platform module. |
| tyrian-htmx/package.mill | Adjusts module ordering/deps consistent with new tags/core/platform split. |
| tyrian-core/test/src/tyrian/LocationTests.scala | Adds tests for Location.fromUrl internal vs external behavior. |
| tyrian-core/test/src/tyrian/LocationDetailsTests.scala | Adds comprehensive parsing tests for LocationDetails.fromUrl and query params. |
| tyrian-core/src/tyrian/LocationDetails.scala | Adds URL parsing and query-param decoding model used by Location. |
| tyrian-core/src/tyrian/Location.scala | Adds Location ADT with Internal/External and fromUrl helper. |
| tyrian-core/src-native/tyrian/LocationPlatform.scala | Adds native platform trait stub for Location platform extensions. |
| tyrian-core/src-jvm/tyrian/LocationPlatform.scala | Adds JVM platform trait stub for Location platform extensions. |
| tyrian-core/src-js/tyrian/LocationPlatform.scala | Adds JS platform helper to build internal Location from org.scalajs.dom.Location. |
| tyrian-core/package.mill | Adds new tyrian-core module with js/jvm/native targets (js depends on scalajs-dom). |
| tyrian-core/README.md | Documents purpose of new tyrian-core module. |
| indigoengine-shared/test/src/indigoengine/shared/datatypes/RadiansTests.scala | Updates tests for removed Double arithmetic overloads on Radians. |
| indigoengine-shared/test/src-native/indigoengine/shared/collections/NonEmptyBatchTests.scala | Adds Scala Native tests for NonEmptyBatch. |
| indigoengine-shared/test/src-native/indigoengine/shared/collections/BatchStructureTests.scala | Adds Scala Native tests for Batch structure/equals/compact. |
| indigoengine-shared/src/indigoengine/shared/datatypes/Radians.scala | Removes @targetName Double overloads (not available under chosen native constraints). |
| indigoengine-shared/src/indigoengine/shared/datatypes/Degrees.scala | Removes @targetName Double overloads (same reason as Radians). |
| indigoengine-shared/src-native/indigoengine/shared/syntax.scala | Adds native syntax entrypoint and re-exports shared syntax helpers. |
| indigoengine-shared/src-native/indigoengine/shared/collections/mutable/KVP.scala | Adds mutable native KVP implementation for performance-sensitive use cases. |
| indigoengine-shared/src-native/indigoengine/shared/collections/mutable/Batch.scala | Adds mutable native Batch implementation backed by ArrayBuffer. |
| indigoengine-shared/src-native/indigoengine/shared/collections/NonEmptyBatch.scala | Adds native NonEmptyBatch implementation. |
| indigoengine-shared/src-native/indigoengine/shared/collections/KVP.scala | Adds native immutable KVP implementation. |
| indigoengine-shared/src-native/indigoengine/shared/collections/Batch.scala | Adds native Batch implementation (Vector-backed) for Scala Native. |
| indigoengine-shared/package.mill | Adds a native target for indigoengine-shared and enables publishing for JVM too. |
| indigo-sandboxes/sandbox/src/main/scala/com/example/sandbox/scenes/WaypointScene.scala | Updates angle math to avoid removed scalar overloads on Radians. |
| indigo-sandboxes/sandbox/src/main/scala/com/example/sandbox/scenes/PerformerScene.scala | Updates rotation math to avoid removed scalar overloads on Radians. |
| indigo-extras/test/src/indigoextras/waypoints/WaypointPathTests.scala | Updates expected angle calculation for removed scalar overloads. |
| indigo-core/test/src/indigo/core/geometry/VertexTests.scala | Updates rotation math for removed scalar overloads. |
| indigo-core/test/src/indigo/core/datatypes/Vector2Tests.scala | Updates rotation math for removed scalar overloads. |
| indigo-core/test/src/indigo/core/datatypes/PointTests.scala | Updates rotation math for removed scalar overloads. |
| indigo-core/src/indigo/core/dice/Dice.scala | Updates random angle math for removed scalar overloads. |
| ci.sh | Adds native linking step to CI pipeline. |
| build.sh | Adds native linking step to local build pipeline. |
| build.mill | Adds Scala Native support, a SharedNative module trait, and native dependency versions. |
indigoengine-shared/test/src/indigoengine/shared/datatypes/RadiansTests.scala
Outdated
Show resolved
Hide resolved
indigoengine-shared/src-native/indigoengine/shared/collections/NonEmptyBatch.scala
Outdated
Show resolved
Hide resolved
indigoengine-shared/src-native/indigoengine/shared/collections/Batch.scala
Outdated
Show resolved
Hide resolved
This reverts commit f1e144b.
This file contains hidden or 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
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.