Clojurians
#cljs-dev
<
2017-06-10
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

rohit07:06:40

@mfikes: if you give me a couple of days, I can polish up my work on this and share it with you. My status on this and what's left: I have gotten cljs and self_host tests running in Travis CI. I need to fix the runner such that on failure, the script exists with a non-zero exit code.

dnolen12:06:57

self host tests pass but I wasn’t particularly rigorous, would be nice to have people try it out

dnolen12:06:26

it’s basically var but it won’t throw at compile time, should be useful in lazy loading situations

thheller13:06:02

@dnolen just glanced over it but won’t that fail if the namespace the resolve is referring to isn’t compiled yet?

dnolen13:06:18

for better integration with Closure Modules I’m thinking about adding a new ns cljs.loader, you could require it to get access to a shared module loader - anybody have problems with the name?

thheller13:06:58

wrote it in JS because I wanted to be able to create a “minimal” loader

thheller13:06:12

but it seems the minimum size to get a standalone loader is 16kb gzip’d

thheller13:06:27

the goog stuff pulls in quite a lot of deps

thheller13:06:52

wouldn’t matter much if the loader included CLJS on top of it

thheller13:06:58

["goog/disposable/idisposable.js", "goog/disposable/disposable.js",
   "goog/debug/error.js", "goog/dom/nodetype.js",
   "goog/string/string.js", "goog/asserts/asserts.js",
   "goog/array/array.js", "goog/promise/thenable.js",
   "goog/async/freelist.js", "goog/async/workqueue.js",
   "goog/debug/entrypointregistry.js", "goog/dom/htmlelement.js",
   "goog/dom/tagname.js", "goog/functions/functions.js",
   "goog/labs/useragent/util.js", "goog/object/object.js",
   "goog/labs/useragent/browser.js", "goog/labs/useragent/engine.js",
   "goog/async/nexttick.js", "goog/async/run.js",
   "goog/promise/resolver.js", "goog/promise/promise.js",
   "goog/mochikit/async/deferred.js",
   "goog/labs/useragent/platform.js", "goog/reflect/reflect.js",
   "goog/useragent/useragent.js", "goog/debug/debug.js",
   "goog/debug/logrecord.js", "goog/debug/logbuffer.js",
   "goog/debug/logger.js", "goog/math/math.js", "goog/iter/iter.js",
   "goog/log/log.js", "goog/structs/map.js",
   "goog/structs/simplepool.js", "goog/debug/tracer.js",
   "goog/module/module.js", "goog/module/basemodule.js",
   "goog/module/moduleloadcallback.js", "goog/module/moduleinfo.js",
   "goog/module/abstractmoduleloader.js",
   "goog/module/modulemanager.js", "goog/events/browserfeature.js",
   "goog/events/eventid.js", "goog/events/event.js",
   "goog/events/eventtype.js", "goog/events/browserevent.js",
   "goog/events/listenable.js", "goog/events/listener.js",
   "goog/events/listenermap.js", "goog/events/events.js",
   "goog/events/eventtarget.js", "goog/timer/timer.js",
   "goog/events/eventhandler.js", "goog/net/bulkloaderhelper.js",
   "goog/net/eventtype.js", "goog/json/json.js",
   "goog/net/errorcode.js", "goog/net/httpstatus.js",
   "goog/net/xhrlike.js", "goog/net/xmlhttpfactory.js",
   "goog/net/wrapperxmlhttpfactory.js", "goog/net/xmlhttp.js",
   "goog/structs/structs.js", "goog/uri/utils.js", "goog/net/xhrio.js",
   "goog/net/bulkloader.js", "goog/dom/browserfeature.js",
   "goog/dom/tags.js", "goog/string/typedstring.js",
   "goog/string/const.js", "goog/html/safescript.js",
   "goog/html/safestyle.js", "goog/html/safestylesheet.js",
   "goog/fs/url.js", "goog/i18n/bidi.js",
   "goog/html/trustedresourceurl.js", "goog/html/safeurl.js",
   "goog/html/safehtml.js", "goog/dom/safe.js",
   "goog/html/uncheckedconversions.js", "goog/math/coordinate.js",
   "goog/math/size.js", "goog/dom/dom.js",
   "goog/html/legacyconversions.js", "goog/net/jsloader.js",
   "goog/useragent/product.js", "goog/module/moduleloader.js",
   "shadow/loader.js", "shadow/module/append/loader.js"]

thheller13:06:12

maybe we can create a more lightweight cljs.loader at some point :stuck_out_tongue:

dnolen13:06:34

so to make this a bit cleaner I’m going to add two compiler constants cljs.loader/MODULE_INFOS and cljs.loader/MODULE_GRAPH

thheller13:06:55

I don’t think its a good idea to compile these in

dnolen13:06:12

unless you come up with a good reason, I don’t see why not

thheller13:06:18

if you want to use caching they change the content of the JS

thheller13:06:27

so each update anywhere breaks the cache

dnolen13:06:32

I’m not really worried about that, it’s trivial to work around

dnolen13:06:06

we can make it so that cljs.loader is marked with a hash of those two values

dnolen13:06:12

same as the other things that trigger recompiles

thheller13:06:24

dunno, I think its a better approach to inject the loader config from outside

thheller13:06:32

so the loader can be cached forever basically

thheller13:06:41

but you can still use it to get updates

dnolen13:06:53

doesn’t seem important to me

dnolen13:06:56

it’s a trivial namespace

thheller13:06:06

I’m aware … I wrote one … just telling you what I noticed when implementing it

dnolen13:06:29

yep I saw :slightly_smiling_face: and I don’t want to come up with a way to inject the config

dnolen13:06:41

taking off in an airplane, bbiab :slightly_smiling_face:

thheller13:06:10

the way I currently inject the config is by appending shadow.loader.setup(...); to the module that contains the loader. works ok but as I said it may change the signature of the loader file and any potential cache.

thheller13:06:48

working with constants should be just about the same amount of code though so no reason for the function call

jvtrigueros17:06:37

Following the instructions on [Patches][1], I created a branch from master and ran ./script/build, which worked wonderfully. I added the new dependency to a minimal example, to confirm that it all went accordingly. Additionally, I ran ./script/bootstrap && ./script/test, but my question is, is that enough verification on my end to warrant submitting a patch on JIRA? I don't want to waste people's time. [1] https://clojurescript.org/community/patches

mfikes17:06:38

@jvtrigueros You can also run script/test-self-parity to run the compiler’s unit tests in self-hosted mode

jvtrigueros17:06:04

I also, see that V8, Nashorn, and Spidermonkey tests were skipped because these were not found in the PATH. I reckon those are important. I'm running the compiler build in a Docker container as I'm on Windows and there wasn't a clear way to build the compiler that way.

mfikes17:06:55

@jvtrigueros Also ensure you have taken care of the CA before submitting patches in JIRA (https://clojurescript.org/community/contributing)

jvtrigueros17:06:49

Thanks @mfikes! Already submitted the CA. I'll go ahead and install what I need to run the tests necessary.