-
Notifications
You must be signed in to change notification settings - Fork 79
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
ClojureScript namespaces missing from required deps in .cljs files loaded via :require-cljs
#718
Comments
Think we should check the impact on bundle size for things we're adding. @borkdude could you take a look at this in the coming days? |
@mk Sure! |
Exposed that explicitly now in the PR #723 Shall I continue with the other namespaces as separate PRs? |
@formsandlines I made a lot of progress incorporating most stuff, including spec. You can check it out in branch About the first two messages:
The third issue I don't know yet, perhaps this just happens because of the first two issues. |
@borkdude That is good to hear! I forgot that the version of formform on Clojars is quite outdated and may not work as well with ClojureScript - updated that now in the repo and quickly tested it on shadow-cljs to make sure it works. However, the errors I see after trying your new commit remain the same as the ones in your screenshot. Since this is not the place to fix issues with my lib, I can also post this on Clojurians Slack to discuss it there if you see no relevance to Clerk or sci here. I only ever used From the call-stack, it seems like this has something to do with my function specs, but I only defined these on API-functions and this is not one of them. Is there an issue with function specs in sci? Other than that, the function itself is very simple and I can’t see where metadata would be added to the var: https://github.com/formsandlines/formform/blob/0caa931ae42e6fd87b6917e88ceab49cb21174c8/src/formform/calc/core.cljc#L57 As for the spec-macros, I have seen that reagent.core got included in sci for Clerk, which also uses |
Apparently I'm handling Let me fix that tomorrow in SCI, then at least the first issue will disappear |
The
Once I fix that, I'll report back. |
Another version: |
Additional bundle size for cljs.spec:
On main, spec.alpha was already loaded thus contributed somewhat to the bundle size already:
|
Made a clean PR here now: commit: |
Awesome, thanks! It also worked in my test with other formform.calc functions. I guess this issue can be closed now. From my experiments, I still found some missing namespaces, but this is quite the hydra, so I just throw a list in here if you want to investigate (no need to do it right now or at all, if it doesn’t align with Clerks goals to support everything in cljs):
|
once the PR is merged I guess, that's up for @mk to decide, if that aligns with clerk's goal :) The original goal of |
Since the most recent version it is possible to load .cljs files from Clerk viewers using
:require-cljs true
. This works fine, but when I try to require a library in such a file (added in my deps.edn), several namespaces normally included in ClojureScript are reported missing: "Could not find source for CLJS namespace x"When testing it with a library of my own[1], the following namespaces are missing:
In our discussion on Clojurians Slack yesterday, @mk added
clojure.math
: 319c002 which worked fine when I tested it. Maybe the other namespaces can also be added to increase compatibility?Here is a test repo with my library as a dependency to reproduce the issue: https://github.com/formsandlines/clerk-cljs-test If all namespaces are included, the
test-viewer
in notebooks/index.clj using therender-test
function from src/render.cljs should display:I
without any errors.[1]: https://clojars.org/eu.formsandlines/formform (works both in clj and cljs) - I would like to render some visualizations I created as web components that need functions from that lib, so I hope to get it working there
The text was updated successfully, but these errors were encountered: