cljs-dev 2024-09-27

I'm surprised no one has asked before, anyone have issues w/ being able to write Error instead of js/Error like we do for Math and String?

➕ 1

to me, writing js/ isn't a problem

➕ 1

I sometimes write:

#?(:cljs (def Exception js/Error))
in test code, so I don't have to use reader conditionals when I write (catch Exception e)

I'm not thinking just of people who care about CLJC style stuff - it just seems a little inconsistent since Error is available in every JS environment

Should every standard JS global be available without js/? To me it would have been fine if none of them were so I wouldn’t have to think about it

The choice was already made - you don't need to qualify natives in many cases, Error is an outlier. So I'm not so interested in opinions about the past - but consistency moving forward

part of the thinking here also - providing more pathways to eliminate js/

sure. maybe it's a co-incidence that Math and String globally also work in the JVM, so this wasn't part of the original reason to do so? it makes sense to include Error then. But where do you stop, do you also include Boolean, Promise, etc?

There's probably a dozen other things. Note that not all the java.lang.* are exposed as unqualified classes in JVM Clojure, it's a specific selection

ECMA-262 is my opinion, the web stuff - no way

why that one, because that is the lowest common denominator google closure supports?

because that's what CLJS originally targeted, and most decisions made align w/ that - only really minor tweaks over the years mostly around iterables / symbols

but also means CLJS can run in older JS environments

@fogus PR in progress here, still need to do the CLJS test / CI bit https://github.com/clojure/core.unify/pull/5 - will generate when I get everything working - probably next week

👍 1

@alexmiller do you see a problem w/ forking Google Closure Library into a Clojure repo? We build it custom anyway and since it's not going to see any Google updates, we might want to just manage it ourselves?

👀 2

ok, yeah I don't have permissions to do this myself

Alex Miller (Clojure team) 2024-10-02T14:19:37.612809Z

can you point me at the repo you want to fork?

I'm happy to hear that you're interested in this David. I've been concerned about those libraries being essentially defunct, on top of already being frustrated that ClojureScript had no say in how some of the features operated. For instance, I opened an issue on one bug (and had an unsubmitted patch for it), but it was closed in preparation for archiving the project.

Have you set something up around this yet? Also, would you rather leave it as-is, or would you like to see it ported over to ClojureScript?

Was just going to fork it this week, and I think we can continue development on it like any Clojure project

Sorry, I think I was unclear… would you rather keep it developed entirely in JS, or are you OK if parts of it were slowly converted to ClojureScript?

Alex Miller (Clojure team) 2024-10-01T22:05:04.209209Z

David, if you have any issues forking into clojure org, let me know and I can assist

Alex Miller (Clojure team) 2024-09-27T13:48:01.218829Z

Seems reasonable

👍🏽 1