This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-06
Channels
- # beginners (49)
- # calva (12)
- # cider (5)
- # cljdoc (4)
- # clojure (51)
- # clojure-dev (1)
- # clojure-europe (16)
- # clojurescript (56)
- # conjure (2)
- # copenhagen-clojurians (1)
- # core-async (4)
- # data-science (4)
- # docker (1)
- # emacs (4)
- # gratitude (1)
- # malli (2)
- # meander (2)
- # missionary (7)
- # off-topic (21)
- # pedestal (3)
- # polylith (6)
- # shadow-cljs (28)
- # spacemacs (1)
- # sql (9)
- # transit (8)
require() of ES Module /home/ribelo/code/alzey/node_modules/node-fetch/src/index.js from /home/ribelo/code/alzey/build/alzey.js not supported.
this is the first time I have encountered such a problemyeah, it'll become more frequent as more node packages move over to ES. kinda annoying.
otherwise there is no "quick" solution, as moving to :target :esm
may have all sorts of other challenges 😉
So latest version of react navigation
(for react native) checks whether a component’s fn name
is capitalized.
The issue is that even if I capitalize the component, the namespace name is being appended.
e.g. Home
becomes myapp.Home
Can anyone think of a workaround for this?
Not sure if shadow-cljs or clojurescript handles this, and if proper avenue would be to find a solution in cljs or open up issue / fork library
for clarity, the problem is that if a component’s name is capitalized, device gets lots of warnings about improper naming
not sure how react-navigation is checking the names. functions don't have names usually.
I'm using my own wrapper so I have full control. They're checking via fn.name, which is read only, unfortunately. (I'm setting the fn.displayName appropriately)
fn.name
won't even exist in release
builds so I don't know what this check is supposed to do
it’s a built-in property https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
I may open an issue in react navigation to request they check the displayName
and fallback to the function name
I know it is a built-in property. Just saying that the closure compiler will optimize that name away. so turns function whatever()
to function ()
if the name is never directly used
since it can't see what react-navigation is using it most likely will optimize it away
checking whether a function name is capitalized sounds absolutely silly to me. can't you just turn off that check? whatever it is meant to do?
for context. in development this is an example error I see
Got a component with the name 'app$client$mobile$app$register_screen' for the screen 'Register'. React Components must start with an uppercase letter. If you're passing a regular function and not a component, pass it as children to 'Screen' instead. Otherwise capitalize your component's name.
oops, it got trimmed. fixed above. they use the check to ensure that a prop is indeed a component, as that is the convention used in js land. the outputted name is akin to the way cljs compiler outputs variables so I know that’s being done somewhere in build process. I was looking to see if there was any hacks to work around this, but i’m going to open issue w react navigation for a proper fix
yeah that seems like an annoying warning. can't think of anything to change this on the CLJS side