Fork me on GitHub
#shadow-cljs
<
2017-11-16
>
mhuebert14:11:50

building a bootstrap build:

[:doc-bootstrap] Build failure:
FileNotFoundException: ...project/js/compiled/bootstrap/js/cljs.core.js.map (No such file or directory)
	java.io.FileOutputStream.open0 (FileOutputStream.java:-2)
	java.io.FileOutputStream.open (FileOutputStream.java:270)
	java.io.FileOutputStream.<init> (FileOutputStream.java:213)
	 (io.clj:230)
	 (io.clj:230)
it works if i manually create the js/compiled/bootstrap/js/ directory

Jon15:11:21

same last night.. almost forgot it

thheller17:11:50

I refactored the shadow-cljs code related to interop with the closure compiler a bit today

thheller17:11:17

that means it is now more flexible when it comes to choosing which :js-provider to use

thheller17:11:11

the goal is to use Closure for all projects .js sources while using :shadow for node_modules

thheller17:11:21

so everything in the project runs through :advanced. I think that should be ok given that you control the .js and could fix :advanced issues if required

thheller17:11:42

so far it is looking promising

thheller17:11:30

I wanted to do this for a while but https://groups.google.com/d/msg/clojurescript/PTWne6hLAxI/UXgMDCNuDAAJ prompted me to work on it

thheller17:11:25

is anyone here jumping through hoops to work with ES6+ code you wrote yourself? ie. not on npm?

thheller17:11:06

basic gist is that

thheller17:11:08

src/integrated/core.cljs

(ns integrated.core
  "Start here."
  (:require ["./lib" :as lib]))

(defn init! []
  (lib/debugMessage "Narf"))

thheller17:11:23

src/integrated/lib.js

var debugMessage = (x = "any old string") => {
  console.log(`Printing ${x} from cljs!`);
};

export { debugMessage };

thheller17:11:19

now works, the lib.js can even use any cljs code via import

thheller17:11:43

or going a bit more extreme

thheller17:11:54

import core from "goog:cljs.core";

import { createElement } from "react";

import { bar } from "./more-es6";

var foo = (x = "any old string") => {
  console.log(`Printing ${x} from cljs!`);
  console.log(core.assoc(null, 1, 2));
  console.log(createElement("h1", null, x));
  return bar(x);
};

export { foo };

thheller17:11:19

full JS interop one step closer

thheller17:11:07

on the surface it works just like before so hopefully it doesn’t break anything

thheller18:11:08

would anyone here object to this new default behaviour? ie. running YOUR es6 code through :advanced?

thheller18:11:11

only issue is that @dnolen said CLJS is never going to support relative requires, so no support for (:require ["./lib" :as lib]) in core 😞

mhuebert23:11:35

I like the new automatic HTTP server options for the different builds

thheller23:11:05

new options?