This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-27
Channels
- # announcements (1)
- # babashka (2)
- # beginners (64)
- # cider (1)
- # cljs-dev (49)
- # cljsrn (2)
- # clojure (49)
- # clojure-europe (3)
- # clojure-norway (1)
- # clojure-spec (7)
- # clojurescript (116)
- # conjure (3)
- # cursive (4)
- # datomic (1)
- # emacs (2)
- # fulcro (15)
- # graalvm (10)
- # kaocha (1)
- # leiningen (4)
- # meander (1)
- # music (1)
- # off-topic (7)
- # re-frame (37)
- # reagent (3)
- # releases (1)
- # rewrite-clj (6)
- # sci (4)
- # shadow-cljs (16)
- # sql (8)
- # tools-deps (16)
- # xtdb (5)
@thheller so is it possible at all? at least to switch the default connect-to context? and in any case, which context does the shadow nREPL connect to by default? bg or content?
@kenny there is :compiler-options {:source-map-comment false}
but I'm not sure its supported for all targets.
Thanks! Afaict, this isn't documented. Would be great to have it under https://shadow-cljs.github.io/docs/UsersGuide.html#compiler-options.
For those following along, I can confirm this does work as expected for the :browser
target.
@donyorm looks fine but http servers aren't really related to any build. consider using the newer :dev-http
. https://shadow-cljs.github.io/docs/UsersGuide.html#dev-http
Hello all - I'm trying to use the React UI components from the most recent version of the AWS Amplify framework in a CLJS project. I'm currently running into an issue that I think is related to the CLJS compilation, but I'm new to all of this and definitely out of my depth at this point.
If I try to import the AmplifyAuthenticator
component using ["@aws-amplify/ui-react" :refer (AmplifyAuthenticator)]
, I see the following in the shadow-cljs server console during the first build (which does go on to complete successfully):
[2020-06-27 12:53:18.268 - INFO] :shadow.build.npm/js-invalid-requires - {:resource-name "node_modules/@aws-amplify/ui-components/dist/cjs/index-b93ab635.js", :requires [{:line 1615, :column 73}]}
If I try to render an AmplifyAuthenticator
component in my application I see the following in the console:
Uncaught TypeError: Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
If it helps: I think the new Amplify framework wraps Web Components and my suspicion is that I'm either doing something wrong in the way that I'm importing or compiling that's causing a polyfill to go missing, or doing something wrong in the way that I'm creating or passing children to the new version of the component. There are examples online using a prior version of the framework with CLJS and I was able to put together a minimal reproduction where the legacy Authenticator
component from aws-amplify-react
renders and swapping it for AmplifyAuthenticator
from @aws-amplify/ui-react
fails.
https://github.com/casselc/amplify-reproducer
https://github.com/casselc/amplify-reproducer/compare/works-legacy-aws-amplify-react
Would appreciate any pointers in the right direction, thanks!@chuck.cassel guess it requires ES6 classes. set :compiler-options {:output-feature-set :es6}
Thanks, I'd played around with that in my actual app before I got around to putting together the example but I still had some errors and concluded I didn't know what I was doing ๐. I just tried it again with the example in the repo and with :es6
it still doesn't render, but does give this error instead:
index-b93ab635.js:1606 Module not provided: ./amplify-authenticator.cjs.entry.js
index-b93ab635.js:1334 Uncaught (in promise) TypeError: Cannot read property 'isProxied' of undefined
at eval (index-b93ab635.js:1334)
at Generator.next (<anonymous>)
at b (app.js:34)
bumping up to :es8
for generators gives:
index-b93ab635.js:1606 Module not provided: ./amplify-authenticator.cjs.entry.js
index-b93ab635.js:1334 Uncaught (in promise) TypeError: Cannot read property 'isProxied' of undefined
at initializeComponent (index-b93ab635.js:1334)
Is this something where I need an extern? I've tried messing around with the various :infer-externs
options without success.:es7
gives the same as :es6
, :es8
and :es-next
both give
index-b93ab635.js:1606 Module not provided: ./amplify-authenticator.cjs.entry.js
index-b93ab635.js:1334 Uncaught (in promise) TypeError: Cannot read property 'isProxied' of undefined
at initializeComponent (index-b93ab635.js:1334)
no other errors in the browser, and only the js-invalid-requires message in the shadow-cljs server output.If I wanted to test bringing it in via CDN, what would the :js-options {:resolve {"@aws-amplify/ui-react" { ... }}
need to look like to pull in individual components? Not sure I understand what's going on well enough to translate the react globals example in the user guide.