flowthing 2020-11-30T08:13:57.387100Z

Is there a linter that catches cases such as dispatching a non-existent event or subscribing to a non-existent subscription? I guess it'd be fairly straightforward to build something on top of e.g., but I was just wondering whether something like that already exists.

jhacks 2020-12-01T15:43:36.398100Z

That macro looks like the answer to my issues with code navigation in emacs for events/subs. It would also enable using imenu, since it starts with def . Are there any drawbacks to using this macro instead of directly using reg-sub, for example?

p-himik 2020-11-30T08:15:59.387300Z

FWIW, I've never seen anything like that being mentioned. I'm not sure it would be that straightforward given that event/sub IDs can be anything and not just keywords. And you can dynamically create them, even if they're just keywords.

flowthing 2020-11-30T08:18:10.387500Z

Right, good point. I think it might be possible to catch most cases, but you're right that a static analysis type of approach wouldn't catch everything.

flowthing 2020-11-30T08:19:10.387700Z

It's just a very easy bug to make to forget to update the event names in dispatch calls when moving things around.

rutledgepaulv 2020-11-30T11:37:40.388100Z

If it's a problem you could def symbols for every reframe sub and event by convention (I'd put them all in one namespace) and get compile time assistance / potentially better refactoring support from your editor.

flowthing 2020-11-30T11:44:02.388300Z

Hmm, interesting idea, thanks. Might get a bit boilerplatey, but it might work. I'll consider it.

jmckitrick 2020-11-30T14:50:51.388500Z

Well, I thought perhaps it would be easier to deal with one format vs another on the js side. The transit format is great for over the wire, but other types might be better for JS side manipulation. Since I'm new to the transit types, I'm still figuring this out....

p-himik 2020-11-30T15:23:08.388700Z

Ah, right. Personally, I'm fine with the types that Transit supports. And when I'm not (like it can be with #inst), it's fairly easy to redefine the default read/write handlers to support custom types that you seem as more fit. You don't need to convert the data manually everywhere.


When you deref a non existing subscription it throws an error?

flowthing 2020-11-30T18:24:58.391700Z

It does, but you’ll have to open the console to see that. Of course, could maybe make it throw an error to make it more visible. :thinking_face:

Lu 2020-11-30T19:12:43.393400Z

In so many instances I’ve had nil subscriptions completely blank the page so it was hard for them to go unnoticed 😂