Fork me on GitHub
#re-frame
<
2022-05-20
>
dvingo01:05:45

I've been digging into the subscriptions sources (again) and I was curious (because they're so damn elegant) if they were invented/discovered by @mikethompson. Was there prior art, or did the design sort of fall out of the primitives reagent made available (reactions)?

Nundrum02:05:58

I'm very new to all this, so please forgive me. My console is full of "re-frame: Subscribe was called outside of a reactive context." I think this is coming from re-pressed because when I remove the related dispatch calls from my core namespace it goes away. Is there some trick to how the re-pressed config is dispatched? Or some way to suppress the warning in the console?

gadfly36102:05:27

re-pressed was written before that warning was introduced. I don't use clojurescript often anymore and I am unfamiliar with the warning. Internally re-pressed is trying to grab a value from app-db for use inside a callback. If there is a better way to do that than a subscription, then I am open to a PR.

lassemaatta03:05:32

My understanding is that it's not a good idea to use rf/subscribe outside a reactive context (in other words, ok = views, other subscriptions; bad = event handlers, js callbacks), as that may/will interfere with how stale subscriptions are detected and pruned.

👍 1
p-himik10:05:19

A better way to do it would be to pass db itself down to the effect handler.

andre08:05:27

hey re-framers, long time no see , next week new release of re-frisk, hot keys and app-db history

andre08:05:36

so if you want to find events in which value for a specific key in app-db was changed , you can do it now

andre08:05:26

hope you like it 🙂

andre08:05:25

also i know many asked for hidden UI and hotkeys, so now there is preload-hidden, which hide UI, and it can be opened with ctrl+H

thheller11:05:15

Recently a few users have reported StackOverflow issues when compiling builds with re-frame-10x. We https://github.com/google/closure-compiler/issues/3945 this down to being a problem related to excessive string concatenation in highlight.js language files. As far as I can tell none of these languages are relevant to what 10x is doing. Who do I need to talk to to get this tweaked so that only relevant languages are loaded? It will improve the build times for everyone and fix the problem as well.

superstructor07:05:01

Thanks for following this up @U05224H0W As a library, the existing

highlight.js :as highlight-js
Supports both shadow and cljsjs etc. If I do "highlight.js/lib/core" I think this will use shadow-specific package resolving, and thus will break cljsjs compatibility ? That's probably acceptable regardless, as maintaining compatibility is not a big priority. Is the above accurate ? Are there other options in terms of maintain compat ?

thheller08:05:39

if people use :target :bundle with regular cljs then the above will also work

thheller08:05:57

don't forget to include the languages you actually want and registering them though

thheller08:05:51

alternate option would be a dedicated cljsjs package just for this that I can override via https://github.com/thheller/shadow-cljsjs

thheller08:05:00

then :target :bundle won't work anymore though 😉

superstructor09:05:33

will do various releases of library then 10x etc ASAP

emaun17:05:59

What's the status of the fixes above? I'm in the process of updating dependencies, and the macroexpanding error is the only thing blocking me. Also, I have [superstructor/re-highlight "2.0.0"] in my project.clj file and "highlight.js": "^11.5.1" in my package.json - forgive me if this is a silly question, but do I need both of these?

p-himik17:05:40

> do I need both of these? Yes, because the former depends on the latter.

gratitude-thank-you 1
superstructor22:05:52

@U03F0727DV0 @U2FRKM4TW is correct that re-highlight depends on highlight.js, but re-highlight declares highlight.js as an NPM dependency for shadow-cljs builds only via https://github.com/superstructor/re-highlight/blob/master/src/deps.cljs So if you are depending on re-highlight then shadow-cljs will write it into your package.json if it doesn't find it there already. If you are depending on 10x, you shouldn't even need to depend on re-highlight because versions of 10x > 1.2.8 depend on a fixed version of re-highlight.

superstructor22:05:55

Hope that makes things clear.