Fork me on GitHub
#hyperfiddle
<
2019-01-02
>
Dustin Getz13:01:17

@alexandrkozyrev lines 3 and 6 define ratoms but it recreates them each time vega-renderer is called

Dustin Getz13:01:34

It also recreates the reagent class each time, and probably mounts it over each time

Dustin Getz13:01:56

Define the reagent class at the namespace level with def (so it is static) and lift the ratoms also to def level

Dustin Getz13:01:39

vegaspec can be a prop

alexandrkozyrev13:01:15

I call vega-rederer several times in vega-dashboard so it probably should recreate a class instance each time with different ednspec and vegaspec

Dustin Getz13:01:00

Can it be the same class, reused, but constructed with different parameters/props?

alexandrkozyrev13:01:59

quite possible, to be clear - I just copy/pasted best examples I’ve found, it wasn’t mindful design

Dustin Getz13:01:19

Oh ok, do you want me to show you? Its easy

alexandrkozyrev13:01:45

it’d be awesome

Dustin Getz13:01:39

(reagent.core/argv this) is a new fn for you, it gets the render props

alexandrkozyrev14:01:15

add/return uuid id (otherwise vega override all specs in the same :div) - works like magic

Dustin Getz14:01:40

random-uuid is going to be different each time it renders

Dustin Getz15:01:07

Which one of you is slifin on hacker news by the way?

Dustin Getz17:01:04

Hello, thanks for the kind words! looking

Dustin Getz17:01:35

Are you logged in?

Adrian Smith17:01:01

not on this machine

Dustin Getz17:01:40

Does it look like this?

Adrian Smith17:01:41

seems fine on my laptop, wierd

Dustin Getz17:01:05

Is there a ajvascript error or anything? What OS and browser

Adrian Smith17:01:09

the end point appears to think about it for about 13 seconds

Dustin Getz17:01:48

We are looking into it, I assume it is still stuck?

Adrian Smith17:01:14

but yeah you deserve the kind words, it's crazy the amount of fuss there is in the front end world when there's been nothing conceptually new for years but here you've got a system here that is truly revolutionary, meteorJS on steroids doesn't even begin to cover what hyperfiddle is capable of, pushing graphs around the stack whilst everyone else is wasting their time trying to get SQL into slot based objects

Adrian Smith17:01:46

yeah can still replicate, on the desktop

khardenstine17:01:18

were you logged in before and playing around?

khardenstine17:01:26

and then you logged out?

Adrian Smith17:01:19

not sure, may have checked the website and been logged in before christmas on the desktop don't think I would have ever explicitly logged out

khardenstine17:01:02

if you dont mind running a chrome console command, could you send me what this returns: localStorage.getItem('{"~#\'":"~:STATE"}')

Adrian Smith17:01:16

localStorage.getItem('{"~#\'":"~:STATE"}')
"{"~:hyperfiddle.runtime/auto-transact":{"~rdatomic:},"~:hyperfiddle.runtime/global-basis":{"~:domain":{"~rdatomic:},"~:ide":{"~rdatomic:},"~:user":{"~rdatomic:}},"~:hyperfiddle.runtime/user-id":null,"~:version":4,"~:stage":{"~rdatomic: \n (pull ?e [:dustingetz.reg/email\n           ; :dustingetz.reg/name\n           ; :dustingetz.reg/birthdate\n           :dustingetz.reg/age\n           ; {:dustingetz.reg/gender [:db/ident]}\n           ; {:dustingetz.reg/shirt-size [:db/ident]}\n           :db/id])\n :where \n [?e :dustingetz.reg/email]\n #_#_[?e :dustingetz.reg/age ?age] [(> ?age 30)]]"],["~:db/add","-1508590361","~:dustingetz.reg/gender","~:dustingetz.gender/male"],["~:db/add","-1508590361","~:dustingetz.reg/shirt-size","~:dustingetz.shirt-size/mens-medium"],["~:db/add","-1508590361","~:dustingetz.reg/birthdate","~t2018-11-01T00:00:00.000Z"],["~:db/add",17592186046195,"~:fiddle/query","[:find \n (pull ?e [:dustingetz.reg/email\n           :dustingetz.reg/name\n           :dustingetz.reg/birthdate\n           :dustingetz.reg/age\n           {:dustingetz.reg/gender [:db/ident]}\n           {:dustingetz.reg/shirt-size [:db/ident]}\n           :db/id])\n :where \n [?e :dustingetz.reg/email]]"]]},"~:last-modified":1546450263325}"

Adrian Smith17:01:40

ah discovered it has to be something to do with client state or extensions because it works in incoginto mode, and safari

Adrian Smith17:01:56

that said I should have the same extensions on the laptop

Adrian Smith17:01:35

empty cache and hard reload doesn't appear to help, is there any other state I can clear?

khardenstine17:01:54

yea i think the problem is your local storage

khardenstine17:01:10

I hate telling people to do this, but try running localStorage.clear() in your console

Adrian Smith17:01:47

yep the login screen shows now

khardenstine17:01:10

Ok sorry about that, thats an oversight with our demo environment when people log out

Dustin Getz17:01:47

Does this happen when the user token expires

khardenstine17:01:58

yea old local storage persists (it included new entities in this case), and those fail security

Dustin Getz21:01:11

@sfyire thanks for reporting this, this was a ticking time bomb 🙂

Dustin Getz22:01:09

All, we are resetting localStorage to fix the bug Adrian reported. Transact your staging areas! (You should be doing this every day anyway, but tonight you will lose any unsaved work)