shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
andre 2021-04-20T08:56:10.345300Z

hi, does anyone know how to enable js/performance for :target :node-test ?

thheller 2021-04-20T08:57:59.345900Z

no such thing in node. it is a module there. see https://nodejs.org/api/perf_hooks.html

andre 2021-04-20T08:58:55.346300Z

how can i use this module ?

thheller 2021-04-20T08:59:17.346800Z

as you use any other module (:require ["perf_hooks" :refer (performance)]) or so

andre 2021-04-20T08:59:56.347200Z

oh ok thanks

thheller 2021-04-20T09:00:00.347400Z

or require that somewhere else and make it a global so js/performance works

thheller 2021-04-20T09:00:22.347600Z

I think the API is the same

andre 2021-04-20T09:02:06.347900Z

many thanks!

ghaskins 2021-04-20T15:37:14.348300Z

Hi all, does anyone have experience with the “@date-io/date-fns” npm package?

ghaskins 2021-04-20T15:37:43.348800Z

im struggling with the import, trying everything I know but they are all returning nil

ghaskins 2021-04-20T15:38:00.349Z

e.g.

(require '["@date-io/date-fns" :as DateFnsUtils])
=> nil
DateFnsUtils
=> nil

ghaskins 2021-04-20T15:39:34.349900Z

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

ghaskins 2021-04-20T15:39:44.350100Z

but this one is stubborn

thheller 2021-04-20T15:42:24.350900Z

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

thheller 2021-04-20T15:42:36.351300Z

might just be an error during load or something? did you check the console?

ghaskins 2021-04-20T15:43:13.351500Z

let me try that

ghaskins 2021-04-20T15:46:52.351900Z

nothing on the console, node returns

ghaskins 2021-04-20T15:46:53.352200Z

> var x = require("@date-io/date-fns")
undefined
> x
[Function: DateFnsUtils]

ghaskins 2021-04-20T15:52:53.352500Z

im basically trying to follow this: https://material-ui-pickers.dev/getting-started/installation

thheller 2021-04-20T15:53:14.353200Z

> (require '["@date-io/date-fns" :as DateFnsUtils])
nil
cljs.user=> DateFnsUtils
#object[Function]
cljs.user=>

thheller 2021-04-20T15:53:20.353500Z

seems to work fine for me?

ghaskins 2021-04-20T15:53:21.353600Z

unfortunately all 4 options are part of the same @date-io package so I suffer the same fate with all

ghaskins 2021-04-20T15:53:29.353800Z

interesting

ghaskins 2021-04-20T15:53:37.354100Z

i wonder why its not working here

ghaskins 2021-04-20T15:53:57.354600Z

what version of @date-io did you use?

ghaskins 2021-04-20T15:54:22.354800Z

im using “@date-io/date-fns” “1.3.13"

ghaskins 2021-04-20T15:54:56.355500Z

(the material/picker said it was dependent on v1.x so maybe they updated in v2

thheller 2021-04-20T15:55:49.355700Z

it installed these for me

"@date-io/date-fns": "^2.10.8",
    "date-fns": "^2.21.1",

ghaskins 2021-04-20T15:56:07.356200Z

ok, ill see if I can level set with v2

Aron 2021-04-20T16:00:10.356500Z

date-fns v2 > v1

ghaskins 2021-04-20T16:00:45.357200Z

yes, the dep I am using explictly states to use @1.x

Aron 2021-04-20T16:00:53.357400Z

every function should be independently requirable

ghaskins 2021-04-20T16:00:53.357500Z

but, thanks

ghaskins 2021-04-20T16:01:39.358Z

it might just be too old

Aron 2021-04-20T16:03:07.359500Z

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.

ghaskins 2021-04-20T16:03:26.359700Z

I know, its confounding

ghaskins 2021-04-20T16:03:31.359900Z

ill keep plugging