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
npm dependency is culled out when I run lein dev #128
Comments
Please put NPM dependencies in
For reasons not yet explained @thheller appears to recommend managing transitive dependencies as library authors with We could do better at documenting this and the reasoning behind it, for which I will create a new issue. On a related note @thheller, this issue was raised as part of a conversation on Clojurians Slack where you recommended not using |
I have added some much needed documentation on this: |
I thought I had made my stance on The thing that bothers me the most about
Regarding npm dependencies: There should be ONE source of truth for npm dependencies which should be The reason Library publishing is not a topic handled by shadow-cljs currently so the publishing aspects of Overall I find this "stuff everything into
A good chunk of CLJS devs are coming from the JS world these days. They are more familiar with npm/yarn than I completely understand if the template wants to be targetted towards people that actually prefer |
One other usability issue I just realized that could be considered a bug. On startup |
We felt a little wedged between two worlds. @thheller we understand that you have a After sleeping on it, we've made some changes. We've changed practically everything except the location of Our greatest concern at the moment is to completely eradicate the support overhead that you get from this @thheller As you are doing a wonderful job on If these changes continue to not work and cause pain, we will look at more drastic changes. But we think this achieves a good balance and has got a good chance of solving the issues 100%. On the other hand, as Clojure devs with complex commercial projects, We've added much more aggressive commenting to
Thanks for pointing this out, it wasn't ideal. So now, we don't touch More details of further changes are on the |
I have never advocated for moving away from I will however continue recommending to move away from My goal with I'm tired of pretending that CLJS is exactly like CLJ. It isn't. My workflow is completely different for CLJS than it is for CLJ. That is why there are different tools. I absolutely understand if people with a CLJ-centric workflow want to stay in that and rather not leave. Just saying that you might be missing out by doing so. Let me give you another example of a workflow that I'm accustomed to that becomes several times slower when using In my workflow I start I then start whatever I need to when I need to. I do so from the UI but the command line is fine too.
Phew done. I don't know about you but I did these exact same steps last week on a fresh project. Amount of times I had to wait for stuff to actually start doing stuff? Once, the server startup. Everything else used the server. With IMHO, YMMV. |
How do you do :compiler-options {:closure-defines {my-app.core/some-def ~some-dynamic-var}} in This is a core issue, if we can't use build code (e.g. If there is a way to address this, then please share it because I'd genuinely be happy with a more cohesive ecosystem where |
I've released re-frame-template v1.0.34 with the changes as although we havn't reached an understanding on I look forward to your feedback on the above example of dynamically closure defines @thheller There are other examples, but for ease of discussion lets do one at a time. |
Well, first of all I'd ask for the nature of the closure-defines you are setting this way. Too often I see people turning what should be runtime configuration into compile time constants. I'm not saying there aren't any use-cases just typically fewer than people make it out to be. Anyways my recommended version would be to use --config-merge. From the command line you might do
For more complex things I recommend using
You can go further with the CLJ API but typically |
Thanks @thheller config merge and the CLJ API appears to be a good way forward. If |
Recommending it is unlikely but I'll probably stop trying to convince people to move away from it. ;) I'd rather not get into a debate over why people shouldn't be putting |
Using config merge and probably the CLJ API are the right way forward 👍 In this way |
I have been thinking about adding an additional config layer. In teams it is not uncommon that different people have different preferences so I want individual devs to be able to override certain settings based on their preferred environment. Not sure how that would align with One question yesterday was about disabling devtools for a So
would become
Which would also never start the nrepl server which is something the You could then generated a |
Thanks @thheller If I understand correctly the only significant difference between this proposed additional layer and I've reviewed a lot of our configs for potential use cases and this additional layer would come in useful as one of the use cases for Either way, I'll make |
Okay, so we made a series of changes about six weeks ago with the goal of eradicating the support issues for Thomas arising from beginner use of this template. And I've been monitoring So, at that level, I think we can say we have succeeded. We now have to find time to go the next step and use the |
@thheller Have looked into this again. To do it in a way that solves current use cases would need an API such as your proposed profiles that worked at the entire config level, not just the build level only ala Looked through code on |
I have not thought about it any further. I don't know what is needed, we only talked about build-level options so far. |
@thheller Re your earlier comment you mentioned thinking about a The key difference here What I need is a way to merge into the entire It doesn't necessarily need to be from another file. It could just take a string of EDN like Thoughts ? |
No thoughts until I get an actual problem statement. What do you want to merge? I need exact descriptions since not every attribute in The |
As of v2.0.0 released today we have entirely replaced Leiningen with a pure shadow-cljs build. So now,
Closing as this should resolve this and all related issues. |
I am trying to add quil to my new project, but every time I lein dev it seems to remove p5 from my node_modules folder and package.json before trying to compile and telling me
The required JS dependency "p5" is not available, it was required by "cljsjs/p5.cljs".
It is easy to repeat:
lein new re-frame myproject
npm i p5
and check that it did indeed install p5 in the node_modules folderlein dev
and watch the p5 folder get removed and then it throws the above errorI tried manually adding
"p5": "1.0.0"
to the package.json but that didn't seem to do anything and it was removed after trying to compile.EDIT: I did a little more digging and found this lein-shadow example:
https://gitlab.com/nikperic/lein-shadow/-/blob/master/examples/lein-shadow-example/project.clj
Following their example I added
:npm-deps [[p5 "1.0.0"]]
to my project.clj and it still seems to cull it out.The text was updated successfully, but these errors were encountered: