Git Product home page Git Product logo

Comments (9)

bhb avatar bhb commented on August 24, 2024

@arichiardi Ah, yes, I bet you're right. Thanks for reporting this!

from expound.

bhb avatar bhb commented on August 24, 2024

@arichiardi As a temporary workaround, can you use the normal s/def from spec and then use expound/defmsg to add a message?

https://bhb.github.io/expound/expound.alpha.html#var-defmsg

from expound.

arichiardi avatar arichiardi commented on August 24, 2024

Yep doing that now thank you 😉

from expound.

bhb avatar bhb commented on August 24, 2024

@arichiardi What tools are you using to compile the CLJS? I'm not able to reproduce this error, but I suspect it's because my test runner is loading a lot of stuff, so perhaps a more isolated environment would reveal the issue.

from expound.

bhb avatar bhb commented on August 24, 2024

@arichiardi Ah, nevermind, I was able to repro using cljs.main

from expound.

arichiardi avatar arichiardi commented on August 24, 2024

Oh cool yeah, I did not have too much time for this small PR - you know lazy devs just sometimes settle for the workaround 😄 - but I was planning to give it a go as well

from expound.

bhb avatar bhb commented on August 24, 2024

Update: I worked on this for awhile without a satisfactory resolution. The issue is that it's hard to determine if we want to use cljs.spec.alpha or clojure.spec.alpha.

If you are executing Clojure code, that could mean you want to use clojure.spec.alpha OR it could mean you're doing the macro-expansion phase when using CLJS, and really want to expand to cljs.spec.alpha.

I considered doing a hack where I try to guess whether or not we want cljs, but that seems like it will create more headaches. I could also create new namespaces, one specifically for CLJ and another for CLJS, each of which have their own version of the def macro.

A related issue is that def doesn't really work like the normal def, because it doesn't make sense to attach a message to a symbol, only to a keyword e.g. :my-app/my-spec #101

Because of all this, I'm going to pause on this for now. I'm inclined to just remove the def macro for the beta and only support defmsg, which is marginally more code for the user, but a lot simpler. I'll think more about this 😄

from expound.

arichiardi avatar arichiardi commented on August 24, 2024

Thanks @bhb for the analysis and TBH that does not bother me too much so given the complicated hack this feature would resolve in I am quite happy that I am not using it 😄

I have got the feeling that breakage would be easy with future ClojureScript versions.

from expound.

arichiardi avatar arichiardi commented on August 24, 2024

👍

from expound.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.