Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entities macro breaks when subscriptions are moved to separate namespace #120

Open
JBetz opened this issue Mar 9, 2019 · 3 comments
Open

Comments

@JBetz
Copy link

JBetz commented Mar 9, 2019

I tried creating a separate module for all my subscription definitions, and all of the subscriptions broke that were using the entities macro. The compiler spit out some undeclared variable warnings, but other than that, there was nothing useful for me to debug it. Replacing usages of entities with entity at least got rid of those warnings, but it took moving everything back into the same module for the usages entities to work again.

The subscriptions are nothing fancy either, so I have no idea what the issue was. Here's an example:

(defsub :notes
  [?eids <- (acc/by-fact-id :e) :from [:note/creation-date]]
  [(<- ?notes (entities ?eids))]
  =>
  {:notes ?notes})
@alex-dixon
Copy link
Contributor

Really sorry about that! The entities macro was hard to implement. It does some weird stuff, namely splitting the rule it occurs in into two rules. That said there were some var resolution issues having to do with CLJS namespace resolution issues in Clara that were fixed as of 0.18.0 (I think). #111 and #112 talk about very similar issues if not the same you have. Looks like I may have fixed some of it in the latest master but the yet unmerged PR #116 that upgrades Clara to 0.18.0 may fix it fully.

I hope this helps until I can take a closer look.

@JBetz
Copy link
Author

JBetz commented Mar 9, 2019

Okay, good to know. I'll just keep things in the same module for now.

Is there anything blocking #116, or does it just need QA?

@alex-dixon
Copy link
Contributor

Just ran the todomvc example with it. More QA would be good (especially with rules split across namespaces). Nothing's blocking it other than nervousness on my part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants