Closed jquesada2016 closed 3 months ago
The documentation imports DL as import Deku.DOM.Listeners as DL
whereas you have import Deku.Listeners as DL
.
I think there was a major change between v0.9.18 (the version published on pursuit) and v0.10.0 (the version afais used in the documentation). Just guessing here, as I haven't checked this myself and am myself a fairly new deku user.
I had to add the following snippet to spago.yaml
to use deku in the way described in the documentation:
workspace:
extra_packages:
hyrule:
git: "https://github.com/mikesol/purescript-hyrule.git"
ref: "f388528a9aaa25a5307bf67f6ed12d2097620929"
dependencies:
- effect
- js-timers
- unsafe-reference
- web-html
- web-uievents
bolson:
git: "https://github.com/mikesol/purescript-bolson.git"
ref: "d87900ceedfb81814bd282be464fa4c8a55677c2"
dependencies:
- hyrule
- fast-vect
deku:
git: "https://github.com/mikesol/purescript-deku.git"
subdir: deku
ref: "22d4756f831ac57c17286bae86a5799a0377239a"
dependencies:
- bolson
deku-core:
git: "https://github.com/mikesol/purescript-deku.git"
subdir: deku-core
ref: "22d4756f831ac57c17286bae86a5799a0377239a"
dependencies:
- bolson
- stringutils
deku-dom:
git: "https://github.com/mikesol/purescript-deku.git"
subdir: deku-dom
ref: "22d4756f831ac57c17286bae86a5799a0377239a"
dependencies:
- bolson
- web-pointerevents
- web-touchevents
Note: ref 22d4756f831ac57c17286bae86a5799a0377239a
corresponds to v.10.0
Maybe the documentation needs to be updated to state in the Getting started
section that it now requires v.10.0 onwards and how to set it up?
Thanks for the writeup @jquesada2016 and the explanation @sprungknoedl . The yaml you have should work, and I'll update the docs!
In general, we could use more version-management rigor in the project. If anyone would like to help out with that, I'd appreciate it! I haven't used Deku at work for nearly a year now, so while I'm happy to maintain it, I'm not encountering it's day-to-day warts the way that some folks do. Of course, if I move back to using it professionally, I'll get to fixing these things faster.
For a monorepo project, the spago.yaml under the root directory should be instead
workspace:
package_set:
registry: 47.10.0
extra_packages:
hyrule:
git: "https://github.com/mikesol/purescript-hyrule.git"
ref: "f388528a9aaa25a5307bf67f6ed12d2097620929"
dependencies:
- effect
- js-timers
- unsafe-reference
- web-html
- web-uievents
bolson:
git: "https://github.com/mikesol/purescript-bolson.git"
ref: "d87900ceedfb81814bd282be464fa4c8a55677c2"
dependencies:
- hyrule
- fast-vect
- foreign-object
deku:
git: "https://github.com/mikesol/purescript-deku.git"
subdir: deku
ref: "22d4756f831ac57c17286bae86a5799a0377239a"
dependencies:
- record
- bolson
deku-core:
git: "https://github.com/mikesol/purescript-deku.git"
subdir: deku-core
ref: "22d4756f831ac57c17286bae86a5799a0377239a"
dependencies:
- catenable-lists
- stringutils
- bolson
deku-dom:
git: "https://github.com/mikesol/purescript-deku.git"
subdir: deku-dom
ref: "22d4756f831ac57c17286bae86a5799a0377239a"
dependencies:
- bolson
- aff
- web-pointerevents
- web-touchevents
tidy:
repo: "https://github.com/natefaubion/purescript-tidy.git"
version: "v0.10.0"
dependencies:
- arrays
- dodo-printer
- foldable-traversable
- lists
- maybe
- ordered-collections
- partial
- prelude
- language-cst-parser
- strings
- tuples
tidy-codegen:
repo: "https://github.com/natefaubion/purescript-tidy-codegen"
version: "main"
dependencies:
- aff
- ansi
- arrays
- avar
- bifunctors
- console
- control
- dodo-printer
- effect
- either
- enums
- exceptions
- filterable
- foldable-traversable
- free
- identity
- integers
- language-cst-parser
- lazy
- lists
- maybe
- newtype
- node-buffer
- node-child-process
- node-fs-aff
- node-path
- node-process
- node-streams
- ordered-collections
- parallel
- partial
- posix-types
- prelude
- record
- safe-coerce
- st
- strings
- tidy
- transformers
- tuples
- type-equality
- unicode
which worked for me
Going through the deku docs, I got stuck trying to use deku events, as it doesn't compile. Here's the code, and below is the error message:
Here's the error:
Additional Context
0.93.18
0.15.12
registry: 45.1.0