This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-16
Channels
- # aws-lambda (10)
- # beginners (52)
- # boot (42)
- # cider (2)
- # cljs-dev (8)
- # cljsjs (4)
- # cljsrn (10)
- # clojars (3)
- # clojure (48)
- # clojure-conj (4)
- # clojure-dev (19)
- # clojure-italy (7)
- # clojure-norway (4)
- # clojure-russia (44)
- # clojure-spec (70)
- # clojure-uk (34)
- # clojurescript (39)
- # cursive (35)
- # data-science (11)
- # datomic (7)
- # emacs (6)
- # fulcro (2)
- # hoplon (12)
- # jobs (1)
- # juxt (18)
- # lein-figwheel (2)
- # leiningen (4)
- # luminus (9)
- # off-topic (29)
- # om (46)
- # onyx (131)
- # other-languages (24)
- # parinfer (84)
- # pedestal (10)
- # portkey (45)
- # protorepl (1)
- # re-frame (15)
- # reagent (43)
- # ring-swagger (41)
- # schema (6)
- # shadow-cljs (293)
- # slack-help (2)
- # specter (42)
Getting some errors when with doing multiple :release
builds at the same time. Does not happen if I release builds individually: https://gist.github.com/mhuebert/66fe536fa2f6c96b5e09d33deb6b8617
attempting to use google’s material-components-web
, getting errors like:
Oct 16, 2017 4:51:23 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: node_modules/@material/animation/index.js:143: ERROR - Parse error. '}' expected
export {transformStyleProperties, getCorrectEventName, getCorrectPropertyName};
^
Oct 16, 2017 4:51:23 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: node_modules/@material/base/component.js:19: ERROR - Parse error. '}' expected
import MDCFoundation from './foundation';
^
@mhuebert the release
errors: is it possible you are building the same build twice? shadow-cljs release browser browser
?
@thheller there are some overlapping namespaces, but different builds. it’s the :live
, :bootstrap
and :trusted
builds here: https://github.com/mhuebert/maria/blob/master/editor/shadow-cljs.edn#L36
shouldn’t need the checkouts, they are just there to facilitate reloading during dev
however i was working on updating deps earlier today and it is possible there are omissions. i think i do indeed have too many independent projects
The required namespace "pack.prosemirror-markdown" is not available, it was required by "re_view_prosemirror/markdown.cljs".
but that should not be a requirement, just an unhappy race condition. threads again. 😉
is there not an error if you run shadow-cljs server separately, and then shadow-cljs watch?
the server
is in a bit of a weird state at the moment. there are several command that act as the server themselves if none is running
is doc/shadow-repl.md
intended to explain how to set up a repl? it seems to go in a lot of paths
shadow-cljs clj-repl
[1:0]~shadow.user=> (shadow/release :live)
[:live] Compiling ...
CompilerException java.lang.RuntimeException: Unable to resolve symbol: help in this context, compiling:(null:1:1)
this switches the current REPL to CLJS, so every eval after that should happen in CLJS
the UI does not properly detect this so you might need to switch manually in Cursive clj/cljs
maybe this particular package is better handled directly with Google Closure as it is a google thing
IIRC in shadow there is an option for that, it would then process all deps through closure?
ie. if you use material-ui
you get ES3 which was transformed by babel and includes some of the babel-runtime
if I use closure to rewrite that you have the babel
runtime from some package and the closure
runtime for others
in the short term, is there a way for me to expose my rollup’d pack of material-components-web in a way that would let me require things like how cljsjs/global-exports work?
{"material-components-web" {:target :npm :require "material-components-web/dist/material-components-web.js"}}
:js-options
do not flow through upstream though, do they? so then whatever consumes re-view-material
also has to.. i’m not sure, copy over a JS file somewhere?
I really don’t want to support cljsjs
style packages because the chance of conflicts is so damn high
also - minor thing - getting the server to emit the URL would avoid some confusion others had trying to get maria running for dev
HTTP server for build :browser available at:
HTTP server for build :bootstrap-host available at:
it might not work at all [email protected]
its only 50% of the implementation I had planned initially but this should work, tested with "@material/animation"
and it compiles
oh doh, require('@material/checkbox/dist/mdc.checkbox');
they do ship commonjs as well
material-components-web
is designed primarily as a low-level framework which requires ‘adapters’ to actually use, so i have a lot of ugly code which requires these namespaces and then maps them to react components appropriately
last i checked, which was not recently, material-ui did not use the latest version of material-components-web and was also very very heavy
whereas material-components-web
is actually maintained/developed by google and intended to be a production quality reference implementation
material-ui also did this inline-styles thing which was simultaneously slow and difficult to integrate with a project. however again i haven’t looked at it in months 🙂.
I haven’t used either myself. just thought it was weird to use a web-components lib with react
they did a bunch of the hard css/js stuff, and then you have to write an ‘adapter’ that maps it to whatever, can be web components or can be react
when i wrote re-view-material
, material-components-web
was at version 0.14 vs today 0.22, i don’t think they did the cjs dist back then
_createClass(MDCCheckboxFoundation, [{
key: 'init',
value: function init() {
this.adapter_.addClass(_constants.cssClasses.UPGRADED);
this.adapter_.registerChangeHandler(this.changeHandler_);
this.installPropertyChangeHooks_();
}
}, {
key: 'destroy',
value: function destroy() {
this.adapter_.deregisterChangeHandler(this.changeHandler_);
this.uninstallPropertyChangeHooks_();
}
/** @return {boolean} */
}
may have spoken too soon. this is really a tangle of stuff that has JS deps and I have to sort some out before i know if there are any real externs issues
i’ve thought about that before, if one could detect any access of globals that aren’t part of your build
yeah starting to believe its better to properly use :infer-externs and rely on that instead
all externs issues should be pretty easy to track down using shadow-cljs release build --pseudo-names
so i am building the http://re-view.io website, which contains examples of all the re-view-material components as well as re-view-prosemirror. i had forgotten that re-view-prosemirror also has a deps.clj foreign-lib that i have to include separately as a script tag
custom. but this is just another lib that was written in the old style (webpack of a .js file) before we could require stuff from node_modules
ah right. this thing https://github.com/braintripping/re-view/blob/master/re_view_prosemirror/src/js/pm.js
Is it possible to have different dependencies in different build. In fact I create two application : node + js. And some sources are common to both.
Electron, in fact...
@ivanpierre put it all in one source-path, the build config will determine what goes into a build
Yes, That's what I do. But I had some conflicts with reagent and node.
I did ,)
Well, perhaps a bug from mine... Il grab a little more... If it doesn't work I'll give you precise behaviour.... 😉
would need to split that into a separate namespace that is only included for the web stuff
@thheller yeah I did a lot of those actually. but they were all based on the idea that my module wrote all of this stuff to a couple global objects, pm
and pmMarkdown
@thheller i just got
failed to start service
{:id :dev-http}
ExceptionInfo: failed to start service
clojure.core/ex-info (core.clj:4725)
clojure.core/ex-info (core.clj:4725)
shadow.runtime.services/start-many/fn--194 (services.clj:135)
...
Caused by:
BindException: Address already in use
from trying to run watch
after an independent server
well it would still be better to use the fully qualified thing but who wants to type annotate other people’s code
shadow-cljs compile browser
shadow-cljs - config: /Users/zilence/code/shadow-cljs/shadow-cljs.edn version: 2.0.18
shadow-cljs - connected to server
if it didn’t connect the target/shadow-cljs
files may been deleted after starting the server
if website
requires prosemirror
, which has {:npm-deps {...}}
in deps.cljs
, should shadow-cljs npm-deps
inside the website
project have the effect of installing those npm modules?
well, re-view-prosemirror
may not be the best example at the moment as it is in transition
Ok : /Users/ivan/.m2/repository/cljsjs/create-react-class/15.6.0-1/create-react-class-15.6.0-1.jar deps.cljs refers to file not in jar: cljsjs/create-react-class/production/create-react-class.min.inc.js {:tag :shadow.build.classpath/deps-cljs, :source-path #object[java.io.File 0x5da7cee2 "/Users/ivan/.m2/repository/cljsjs/create-react-class/15.6.0-1/create-react-class-15.6.0-1.jar"], :name "cljsjs/create-react-class/production/create-react-class.min.inc.js"} ExceptionInfo: /Users/ivan/.m2/repository/cljsjs/create-react-class/15.6.0-1/create-react-class-15.6.0-1.jar deps.cljs refers to file not in jar: cljsjs/create-react-class/production/create-react-class.min.inc.js problem with create-react-class. it search the jar in production and in .m2 there is only common and developement... But it's the last release. I'll go and see.
Thanks
@mhuebert one thing missing for the npm-deps
things is support for yarn
, its currently just calling npm install --save thing@version
is there a way to add an annotation for a function call? eg. (.serialize this)
where serialize
shouldn’t be rewritten
@mhuebert btw I cannot guarantee that CLJS will accept the plain ^js
tag, so that might not actually work with anything but shadow-cljs
plain ^js
has always been allowed, just not in combination with :infer-externs
I think
weird Closure error only in :advanced -
-> Closure - Optimizing ...
IllegalStateException: [GETPROP 14 [length: 31] [source_file: re_view_prosemirror.core.js], EXPR_RESULT 14 [length: 66] [source_file: re_view_prosemirror.core.js]]
com.google.common.base.Preconditions.checkState (Preconditions.java:721)
com.google.javascript.rhino.Node.replaceChild (Node.java:852)
com.google.javascript.jscomp.AggressiveInlineAliases.inlineGlobalAliasIfPossible (AggressiveInlineAliases.java:309)
com.google.javascript.jscomp.AggressiveInlineAliases.inlineAliases (AggressiveInlineAliases.java:162)
com.google.javascript.jscomp.AggressiveInlineAliases.process (AggressiveInlineAliases.java:111)
com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process (PhaseOptimizer.java:304)
com.google.javascript.jscomp.PhaseOptimizer.process (PhaseOptimizer.java:230)
com.google.javascript.jscomp.Compiler.performOptimizations (Compiler.java:2457)
com.google.javascript.jscomp.Compiler$3.call (Compiler.java:834)
com.google.javascript.jscomp.Compiler$3.call (Compiler.java:830)
com.google.javascript.jscomp.CompilerExecutor.runInCompilerThread (CompilerExecutor.java:128)
com.google.javascript.jscomp.Compiler.runInCompilerThread (Compiler.java:862)
com.google.javascript.jscomp.Compiler.stage2Passes (Compiler.java:829)
com.google.javascript.jscomp.Compiler.compileModules (Compiler.java:778)
sun.reflect.NativeMethodAccessorImpl.invoke0 (NativeMethodAccessorImpl.java:-2)
sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke (Method.java:497)
clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:93)
clojure.lang.Reflector.invokeInstanceMethod (Reflector.java:28)
shadow.build.closure/compile-js-modules (closure.clj:874)
shadow.build.closure/compile-js-modules (closure.clj:865)
shadow.build.closure/optimize/fn--24464 (closure.clj:1138)
shadow.build.closure/optimize (closure.clj:1124)
shadow.build.closure/optimize (closure.clj:1115)
shadow.build/optimize (build.clj:288)
shadow.build/optimize (build.clj:280)
shadow.cljs.devtools.api/release* (api.clj:197)
shadow.cljs.devtools.api/release* (api.clj:183)
shadow.cljs.devtools.cli/do-build-command (cli.clj:29)
shadow.cljs.devtools.cli/do-build-command (cli.clj:25)
shadow.cljs.devtools.cli/do-build-commands/fn--30494/fn--30495 (cli.clj:66)
clojure.core/binding-conveyor-fn/fn--5297 (core.clj:2027)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:617)
java.lang.Thread.run (Thread.java:745)
this is the file. but i don’t see a line number in the error? https://github.com/braintripping/re-view/blob/master/re_view_prosemirror/src/re_view_prosemirror/core.cljs
previously I did all the messy JS object reading here, so that my other code wouldn’t have to do all kinds of (.-someProp js/pmMarkdown)
junk
i will be able to rewrite a lot of stuff in a nicer now that i can require directly from node_modules
re_view_prosemirror.core.keymap = re_view_prosemirror.core.keymap;
re_view_prosemirror.core.commands = re_view_prosemirror.core.commands;
re_view_prosemirror.core.model = re_view_prosemirror.core.model;
re_view_prosemirror.core.history = re_view_prosemirror.core.history;
anyway i can get rid of those and change the references to use the node_modules stuff directly.