This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-23
Channels
- # aws-lambda (1)
- # bangalore-clj (3)
- # beginners (80)
- # boot (8)
- # clojars (1)
- # clojure (200)
- # clojure-dev (37)
- # clojure-greece (26)
- # clojure-italy (11)
- # clojure-norway (3)
- # clojure-russia (14)
- # clojure-spec (21)
- # clojure-uk (30)
- # clojurescript (50)
- # core-logic (10)
- # core-matrix (1)
- # cursive (15)
- # data-science (21)
- # datomic (45)
- # devcards (2)
- # emacs (4)
- # fulcro (12)
- # garden (2)
- # jobs (5)
- # juxt (1)
- # lambdaisland (1)
- # leiningen (4)
- # luminus (20)
- # lumo (26)
- # off-topic (33)
- # onyx (27)
- # parinfer (1)
- # pedestal (3)
- # perun (5)
- # re-frame (20)
- # reagent (27)
- # ring (1)
- # ring-swagger (21)
- # shadow-cljs (259)
- # spacemacs (14)
- # yada (3)
Being a JavaScript developer I see this issue in a different angle. I don't use Java. So using Clojars is like "using two package managers", since I've been using npm for so long.
Lumo is moving away from JVM. And it sounds more natural to use npm as the package manager, just like all other compiled-to-js languages, despite that npm is far from perfect.
seriously though: if there was a shadow-cljs publish
command. would you care where it ended up?
“it is easier to deploy to npm” is not a valid argument to use it since 99% of the time you just want to USE the dependency not deploy it
another purpose of use phrasing npm is because I'm so familiar with npm, I can browse node_modules/
and manage it with yarn
. I can hardly do anything when I'm not familiar with jar.
@thheller when a shadow server connects to the browser, is there a way for the browser’s code to ask the server questions like “what build am i” or issue commands like “build release”? (ie. building blocks for a UI)
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/client/env.cljs
but none of that should be used if you want to build an actual UI, ie. the UI should not become part of the build
a benefit of something injected into a build is that you could show warnings/build status directly there, in the window that you’re looking at while developing
errors in the editor… is there a standard way to communicate stuff like that to an editor? (ie. something that would work with Cursive and emacs?)
> Language server support cannot be combined with existing IDE tooling; it’s an either/or proposition. If IntelliJ used the language server for Java, it would lose 95% of its feature set for Java development.
well, when developing for the browser, warnings/errors there will show up at essentially the same speed as if it was connected to the editor, if you have a side-by-side view on your screen
need to bug colin so I can send special nrepl messages the UI understands … but he is busy 🙂
Last night I was surprised to find that my parsing lib runs ~8x faster with :simple optimisations than in dev
Anything to do with perf tweaking/debugging might be another user case for watching release builds
the issue with watch for release is that running it on every file change is too slow
all the ^boolean
type hints seem to have zero effect, in any kind of optimization mode
with you get if(demo.browser.thing){
its only really needed in cases where closure is supposed to kill dead code
for my parse lib, using sequential keyword-identical?
comparisons vs. (contains? #{…} the-kw) results in a 2x overall speedup
just realized i was mistakenly using keyword-identical?
with strings. still had correct result, but slightly faster i think to use identical?
bootstrap js and :simple
no, then you’d lose the ability to load individuals namespaces
but, this is in a really tight loop and i am not sure one can go faster than successive identical comparisons
well, this is interesting. when the parsing lib and sample text are loaded by themselves, the :simple optimization mode makes a much smaller difference, maybe 20%
but when the exact same test is loaded as part of Maria’s live
build, then it slows down 10x when not in :simple
i don’t fully yet understand either. so the live
build is :optimizations :simple, nothing fancy. It does load the bootstrap
build but I am not using the compiler to perform this test
i’m trying to reproduce and can’t yet. i thought maybe it had something to do with loading it in an iframe, but that doesn’t seem to be the case
how do you guys feel about the shadow-cljs - config: /Users/zilence/code/shadow-cljs/shadow-cljs.edn version: 2.0.35
line?
echo :foo | shadow-cljs clj-eval --stdin
shadow-cljs - config: /Users/zilence/code/shadow-cljs/shadow-cljs.edn version: 2.0.35
:foo
node packages/shadow-cljs/cli/runner.js clj-eval "(shadow/release :thing) (something-after-release)"
wanted something that lets me string together a few things … like calling rsync after release 😉
thought I can abuse the :npm-module
stuff I have already but that doesn’t quite work
------ WARNING #1 --------------------------------------------------------------
File: cljs.core$macros.js:2
namespace "clojure.walk" is required in module cljs.compiler.js but provided in module clojure.walk.js. Is module cljs.compiler.js missing a dependency on module clojure.walk.js?
--------------------------------------------------------------------------------
Closure compilation failed with 6 errors
--- cljs.js.js:2
namespace "cljs.core$macros" cannot be provided twice
absolutely no idea! 🙂. but that’s a console log after reloading, only difference commenting out that part in devtools
so this little trick they do:
var createScriptFunction = function(args, body) {
var prevDash = window._,
script = document.createElement('script'),
sibling = document.scripts[0];
script.text = 'var _ = function(' + args + ') {' + body + '\n}';
sibling.parentNode.insertBefore(script, sibling).parentNode.removeChild(script);
var result = window._;
window._ = prevDash;
return result;
};
maybe i should do this with all of the eval’d code from the bootstrapped compiler?function scriptEval(code) {
var node = document.createElement("script");
node.appendChild(document.createTextNode(code));
document.body.append(node);
document.body.removeChild(node);
}
did quick benchmark myself. 6.5sec without async require, 6.5 sec with async require + script, still waiting for eval
😛
i mean shadow-cljs server
— does that need to be restarted after adding this js code
i have just got into a weird state where the same benchmark code is now running at the midpoint of slow and fast and nothing i do seems to change it.
and i don’t understand the logic. they don’t prevent dynamically supplied code from being optimized, they just make it awkward?
Don't put try/catch inside computationally intensive functions.
You could try { test() } catch
oh, this page is more recent: https://github.com/petkaantonov/bluebird/wiki/Optimization-killers
Functions that contain a try-catch statement (Optimized in V8 commit 9aac80f / V8 5.3 / node 7.x)