Closed malcolmredheron closed 3 months ago
Yeah, these are all generated in https://github.com/shadaj/slinky/blob/main/generator/src/main/scala/slinky/generator/Generator.scala, which uses the JSON files in the web subproject to generate typed attributes. So that could be extended to generate the capture variants!
Happy to review any PRs for improvements around this!
Thanks! This will be the first time that I've modified Scala code outside my source tree. Do you have a recommended way for me to link my project against a fork that I make before I send you a PR?
Sent with Superhuman ( https://superhuman.com/refer/cmsqjaxn ). Please favor brief email ( http://three.sentenc.es/ ) over chat, especially for tasks. For chat (+1-415-235-0687), WhatsApp is best. Never Signal unless there are legal issues.
On Mon, Dec 25, 2023 at 3:07 PM, Shadaj Laddad < @.*** > wrote:
Yeah, these are all generated in https:/ / github. com/ shadaj/ slinky/ blob/ main/ generator/ src/ main/ scala/ slinky/ generator/ Generator. scala ( https://github.com/shadaj/slinky/blob/main/generator/src/main/scala/slinky/generator/Generator.scala ) , which uses the JSON files in the web subproject to generate typed attributes. So that could be extended to generate the capture variants!
Happy to review any PRs for improvements around this!
— Reply to this email directly, view it on GitHub ( https://github.com/shadaj/slinky/issues/689#issuecomment-1869146321 ) , or unsubscribe ( https://github.com/notifications/unsubscribe-auth/AAAOIXIBTKFCWJPYAOUQWWDYLIBMBAVCNFSM6AAAAABBCBL3D2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGE2DMMZSGE ). You are receiving this because you authored the thread. Message ID: <shadaj/slinky/issues/689/1869146321 @ github. com>
You'll want to commit to a branch in your local copy, and then run sbt publishLocal
, which will generate a version based on the current git commit. You can then just point your projects against that version and it should work!
Cool. I'm trying to add onBeforeInput for a start. Some questions so far:
sbt compile
and sbt tests/test
didn't seem to do it, but when I git clean
-ed everything and built again then I got lots of mentions of onBeforeInput.sbt compile
takes multiple minutes even though it claims that it's building incrementally. What's your workflow for testing changes?sbt publishLocal
to build a version for Scala 3? I tried changing ThisBuild / scalaVersion
to scala3
in build.sbt
but that generated lots of compiler errors.To re-generate, you need to run sbt web/clean
. Unfortunately, due to the sheer number of generated files, incremental compilation isn't super helpful so the iteration time will be pretty slow.
To build for Scala 3, you'll want to run ++3.x.x
(for your preferred version` in the SBT shell.
When using react directly (say, from Typescript or JS), I can set an event handler that runs during the capture phase of event dispatch like this:
div({onKeyDownCapture: handler})
Slinky seems to be missing the subclasses of slinky.core.TagElement to let this happen naturally. So when I want to do this, I do something like:
Have you thought about adding them? I'm happy to help, but would need some pointers. Are these files auto-generated? I hope so. From what? I'd be even more happy to sponsor this project if that helps to get this kind of thing done.