hi, does anyone know how to enable js/performance
for :target :node-test
?
no such thing in node. it is a module there. see https://nodejs.org/api/perf_hooks.html
how can i use this module ?
as you use any other module (:require ["perf_hooks" :refer (performance)])
or so
oh ok thanks
or require that somewhere else and make it a global so js/performance
works
I think the API is the same
many thanks!
Hi all, does anyone have experience with the “@date-io/date-fns” npm package?
im struggling with the import, trying everything I know but they are all returning nil
e.g.
(require '["@date-io/date-fns" :as DateFnsUtils])
=> nil
DateFnsUtils
=> nil
Im not always clear when various options are eligible to try, but I can typically get it to work by following https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
but this one is stubborn
I don't know that library. might help to try node
and the var x = require("@date-io/date-fns")
x
just to see what that would be
might just be an error during load or something? did you check the console?
let me try that
nothing on the console, node returns
> var x = require("@date-io/date-fns")
undefined
> x
[Function: DateFnsUtils]
im basically trying to follow this: https://material-ui-pickers.dev/getting-started/installation
> (require '["@date-io/date-fns" :as DateFnsUtils])
nil
cljs.user=> DateFnsUtils
#object[Function]
cljs.user=>
seems to work fine for me?
unfortunately all 4 options are part of the same @date-io package so I suffer the same fate with all
interesting
i wonder why its not working here
what version of @date-io did you use?
im using “@date-io/date-fns” “1.3.13"
(the material/picker said it was dependent on v1.x so maybe they updated in v2
it installed these for me
"@date-io/date-fns": "^2.10.8",
"date-fns": "^2.21.1",
ok, ill see if I can level set with v2
date-fns v2 > v1
yes, the dep I am using explictly states to use @1.x
every function should be independently requirable
but, thanks
it might just be too old
I see, I am not sure why it wouldn't work, but I remember having some issues similar to yours. Sadly I don't remember how I resolved it, I might've just looked for a different dependency at the time. Imho there should be no reason why the old one wouldn't work.
I know, its confounding
ill keep plugging