This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-19
Channels
- # announcements (1)
- # aws (9)
- # beginners (136)
- # boot (4)
- # cider (11)
- # clara (36)
- # clojure (337)
- # clojure-europe (5)
- # clojure-italy (3)
- # clojure-nl (2)
- # clojure-spec (9)
- # clojure-uk (112)
- # clojured (7)
- # clojurescript (93)
- # core-async (2)
- # cursive (30)
- # datomic (6)
- # duct (4)
- # emacs (2)
- # figwheel (1)
- # figwheel-main (7)
- # fulcro (153)
- # kaocha (1)
- # off-topic (12)
- # om-next (1)
- # pedestal (58)
- # planck (6)
- # re-frame (15)
- # reitit (11)
- # shadow-cljs (113)
- # spacemacs (1)
- # specter (3)
- # vim (8)
shadow$loader
should only be assigned once? do you see it reassigned again in the code somewhere?
I'm trying to get my modules working again under advances optimizations. it used to work, but doesn't anymore with shadow 2.8.2.
hmm I never used that form. can you quickly try (-> (loader/load "my-module") (.then callback))
?
I suspect that the execOnLoad
maybe was changed in the new closure lib (lots changed there)
I really don't get why it is reassigned for you. I can't find any second assign in my code
var shadow$loader = {"uris":{"demo":["/js/demo.js"],"extra":["/js/extra.js"]},"infos":{"demo":[],"extra":["demo"]}};
from the code I pasted above I don't understand how this can work. in the generated code I have, either the module info will wipe out the shadow.loader namespace or the other way around
if the shadow.loader code gets evaluated first, you might be lucky and the definitions are in the runtime by the time the module info wipes out the namespace
;var $shadow$loader$ml$$ = new $goog$module$ModuleLoader$$;
$shadow$loader$ml$$.$sourceUrlInjection_$ = !0;
var $shadow$loader$mm$$;
!$module$contents$goog$loader$activeModuleManager_moduleManager$$ && $module$contents$goog$loader$activeModuleManager_getDefault$$ && ($module$contents$goog$loader$activeModuleManager_moduleManager$$ = $module$contents$goog$loader$activeModuleManager_getDefault$$());
$shadow$loader$mm$$ = $module$contents$goog$loader$activeModuleManager_moduleManager$$;
$shadow$loader$mm$$.$loader_$ = $shadow$loader$ml$$;
which I think comes from this line https://github.com/thheller/shadow-cljs/blob/01a0b4810047c719ae528f5ff2bdd26b0dcfe4fd/src/main/shadow/loader.js#L1
var $goog$module$ModuleLoader$EventType$EVALUATE_CODE$$ = new $goog$events$EventId$$("evaluateCode$0"), $goog$module$ModuleLoader$EventType$REQUEST_SUCCESS$$ = new $goog$events$EventId$$("requestSuccess$1"), $goog$module$ModuleLoader$EventType$REQUEST_ERROR$$ = new $goog$events$EventId$$("requestError$2");
function $goog$module$ModuleLoader$EvaluateCodeEvent$$() {
$goog$events$Event$$.call(this, $goog$module$ModuleLoader$EventType$EVALUATE_CODE$$);
}
$goog$inherits$$($goog$module$ModuleLoader$EvaluateCodeEvent$$, $goog$events$Event$$);
function $goog$module$ModuleLoader$RequestSuccessEvent$$() {
$goog$events$Event$$.call(this, $goog$module$ModuleLoader$EventType$REQUEST_SUCCESS$$);
}
$goog$inherits$$($goog$module$ModuleLoader$RequestSuccessEvent$$, $goog$events$Event$$);
function $goog$module$ModuleLoader$RequestErrorEvent$$($moduleIds$jscomp$9$$, $opt_error$jscomp$4$$) {
$goog$events$Event$$.call(this, $goog$module$ModuleLoader$EventType$REQUEST_ERROR$$);
this.error = $opt_error$jscomp$4$$ || null;
}
$goog$inherits$$($goog$module$ModuleLoader$RequestErrorEvent$$, $goog$events$Event$$);
function $goog$module$ModuleLoader$LoadStatus$$() {
this.$responseTexts$ = this.$requestUris$ = null;
this.$loadRequested$ = !1;
this.$errorFn$ = this.$successFn$ = null;
}
;var $shadow$loader$ml$$ = new $goog$module$ModuleLoader$$;
$shadow$loader$ml$$.$sourceUrlInjection_$ = !0;
var $shadow$loader$mm$$;
!$module$contents$goog$loader$activeModuleManager_moduleManager$$ && $module$contents$goog$loader$activeModuleManager_getDefault$$ && ($module$contents$goog$loader$activeModuleManager_moduleManager$$ = $module$contents$goog$loader$activeModuleManager_getDefault$$());
$shadow$loader$mm$$ = $module$contents$goog$loader$activeModuleManager_moduleManager$$;
$shadow$loader$mm$$.$loader_$ = $shadow$loader$ml$$;
$goog$global$$.shadow$loader && function() {
$shadow$loader$mm$$.$setAllModuleInfo$($goog$global$$.shadow$loader.infos);
var $uris$jscomp$6$$ = $goog$global$$.shadow$loader.uris;
$shadow$loader$mm$$.$setModuleUris$ ? $shadow$loader$mm$$.$setModuleUris$($uris$jscomp$6$$) : ($goog$object$getKeys$$($uris$jscomp$6$$).forEach(function($key$jscomp$115$$) {
var $trusted_uris$$ = [];
$uris$jscomp$6$$[$key$jscomp$115$$].forEach(function($uris$jscomp$6$$) {
var $key$jscomp$115$$ = new $goog$html$TrustedResourceUrl$$;
$key$jscomp$115$$.$privateDoNotAccessOrElseTrustedResourceUrlWrappedValue_$ = $uris$jscomp$6$$;
$trusted_uris$$.push($key$jscomp$115$$);
});
$uris$jscomp$6$$[$key$jscomp$115$$] = $trusted_uris$$;
}), $shadow$loader$mm$$.$setModuleTrustedUris$($uris$jscomp$6$$));
}();
I'm just experience the case that the shadow.loader namespace gets emitted AFTER the module info. in your case it seems to be the other way around
what do you mean? do you not have var shadow$loader = ...
assignment at the very top of the file?
var shadow$provide = {};
if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) {
Math.imul = function (a, b) {
var ah = (a >>> 16) & 0xffff;
var al = a & 0xffff;
var bh = (b >>> 16) & 0xffff;
var bl = b & 0xffff;
// the shift by 0 fixes the sign on the high part
// the final |0 converts the unsigned value into a signed value
return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
}
}
var shadow$loader = {"uris":{"demo":["/js/demo.js"],"extra":["/js/extra.js"]},"infos":{"demo":[],"extra":["demo"]}};
yes, I have that. but in the same file the shadow.loader code is emitted after this module info declaration
the code that translates the shadow$loader
into the actual runtime data is coming way later
ie if you grep your compiled code for shadow$loader =
that should only find ONE occurence
but, let's clarify this also. shadow$loader is getting assigned 2 things. the module info and the shadow.loader namespace, right?
so this file: https://github.com/thheller/shadow-cljs/blob/01a0b4810047c719ae528f5ff2bdd26b0dcfe4fd/src/main/shadow/loader.js
Hi @thheller I am trying to add a ~/.b42
into the classpath in shadow-cljs.edn :source-paths
but i think it doesnt resolve ~
as home directory.
Hi, I’m getting [:did-not-find <name-of-ns>]
errors for namespaces that do exist. What does this error indicate?
@metacritical yes it doesn't resolve source paths at all. I wouldn't expect that to work in any java setup?
@jlmr that happens in your (in-ns 'foo.bar)
without having done (require 'foo.bar)
first
@thheller Thanks!
So, I'm getting this reference error when importing this js lib, and I see that is seems to be looking for an underscored version of the library. is that relevant to the problem?
ReferenceError: module$node_modules$aws_appsync$lib$index is not defined
seems to have sorted itself out, actually... I think it must have been outside the compile path for that build
@thheller I noticed something a bit weird, I have in my project my own cljsjs files for some libs that we do override impl, I noticed if I put a .js
file in the cljsjs
ns and try to require it, shadow can't find it, but moving to a different folder cljsjs-mine
for example makes it work, seems like its doing special threatment for cljsjs, is that expected?
otherwise it would start inspecting all the files in cljsjs
which would include all the foreign libs
I'm probably removing the classpath indexing soon though since its not really all that useful
cool, thanks for the clarification