om

Please ask the channel first, not @dnolen directly!
baptiste-from-paris 2017-10-16T10:13:29.000017Z

hello friends, I’ve been struggling a lot to advance compile my om.next application that perfectly works in dev

baptiste-from-paris 2017-10-16T10:14:19.000195Z

I am using googlemap externs from cljsjs, if someone has had same issues I would be glad to hear that

wilkerlucio 2017-10-16T13:45:13.000105Z

@baptiste-from-paris are you using fulcro?

baptiste-from-paris 2017-10-16T13:45:37.000146Z

nop, om-next + compassus + pushy

baptiste-from-paris 2017-10-16T13:45:44.000045Z

and bidi

wilkerlucio 2017-10-16T13:45:58.000148Z

humm, I'm asking because I saw some problems related to the enviroment when compiling fulcro on advanced

baptiste-from-paris 2017-10-16T13:46:02.000511Z

it makes me crazy ^^

wilkerlucio 2017-10-16T13:46:03.000096Z

but might apply for you as well

baptiste-from-paris 2017-10-16T13:46:08.000117Z

tell me

wilkerlucio 2017-10-16T13:46:24.000420Z

you can try compiling and forcing the dev environment to be left out

wilkerlucio 2017-10-16T13:46:30.000404Z

I'm trying to remember the command

wilkerlucio 2017-10-16T13:46:40.000169Z

but I guess it's something with "-dev"

wilkerlucio 2017-10-16T13:48:35.000787Z

@baptiste-from-paris try: lein with-profile -dev cljsbuild once prod

wilkerlucio 2017-10-16T13:48:41.000445Z

(replace prod with your production env compilation name, and replace dev as well if you use a different name)

baptiste-from-paris 2017-10-16T13:51:21.000505Z

and that’s suppose to build the minified js with my prod profile

baptiste-from-paris 2017-10-16T13:51:26.000490Z

dev ?

baptiste-from-paris 2017-10-16T13:51:50.000245Z

@wilkerlucio

wilkerlucio 2017-10-16T13:52:26.000322Z

let's not confuse profile with build ids, hehe

baptiste-from-paris 2017-10-16T13:52:34.000022Z

ohhhh lol

wilkerlucio 2017-10-16T13:52:37.000451Z

you want to build the build id prod, removing the dev profile

baptiste-from-paris 2017-10-16T13:52:46.000679Z

ok

wilkerlucio 2017-10-16T13:53:18.000477Z

it's about some dependencies, I don't remember which, but there are some dev dependencies that can break your adv compilation

wilkerlucio 2017-10-16T13:53:36.000504Z

I remember @tony.kay had to deal with this, I just can't remember which dependencies were the troublesome

baptiste-from-paris 2017-10-16T13:54:07.000074Z

it’s working

baptiste-from-paris 2017-10-16T13:54:42.000504Z

I can’t believe I spent 5 hours yersterday with this 😢

baptiste-from-paris 2017-10-16T13:54:45.000199Z

thanks a lot

wilkerlucio 2017-10-16T13:54:54.000423Z

nice, glad to hear 🙂

baptiste-from-paris 2017-10-16T13:55:10.000475Z

crazy

wilkerlucio 2017-10-16T13:55:11.000415Z

sorry about the time spent, but that's how we learn 🙂

baptiste-from-paris 2017-10-16T13:55:50.000147Z

it’s okay, it’s really not easy to debug advanced code

baptiste-from-paris 2017-10-16T14:18:11.000356Z

@wilkerlucio do you know if compiler imports automarically deps.cljs from cljsjs when you add it to your dependencies ?

wilkerlucio 2017-10-16T14:37:42.000549Z

@baptiste-from-paris yes it does

baptiste-from-paris 2017-10-16T14:51:32.000132Z

ok 🙂

minhnh 2017-10-16T16:10:15.000188Z

I try out cljs with react material-ui https://github.com/madvas/cljs-react-material-ui-example

class Login extends Component {
  static muiName = 'FlatButton';

  render() {
    return (
      <FlatButton {...this.props} label="Login" />
    );
  }
}
How can we convert static muiName = 'FlatButton' to om.next defui ?

sundarj 2017-10-16T16:13:22.000050Z

(defui Login ,,,)
(set! (.-muiName Login) "Flatbutton")

sundarj 2017-10-16T16:13:34.000624Z

@minhnh

minhnh 2017-10-16T16:17:25.000410Z

thank @sundarj, but it doesn’t work 😞

sundarj 2017-10-16T16:18:06.000586Z

the set! does not work?

sundarj 2017-10-16T16:18:23.000236Z

that is all the static syntax in js should do, i think

sundarj 2017-10-16T16:19:42.000086Z

class Foo { static foo = 2 } is equivalent to class Foo {}; Foo.foo = 2 i believe

minhnh 2017-10-16T16:22:32.000294Z

maybe, you’re right! I think the macro defui didn’t create js class Login. So, the static syntax doesn’t work

sundarj 2017-10-16T16:25:45.000458Z

ah

tony.kay 2017-10-16T20:10:24.000361Z

@wilkerlucio turns out it was not a dependency problem

tony.kay 2017-10-16T20:12:41.000061Z

Here is the problem: Om Next has a compiler hack in it. As-in: it actually patches the compiler to work differently. If you have something like tools namespace refresh in any of your source files (e.g. set-refresh-dirs!), then the Clojure environment may reload the compiler (and undo the compiler hack) before doing the compile. This results in code that fails adv optimization. So, the solution is to use a non-development profile that does not have any files from say user where such things are done.

tony.kay 2017-10-16T20:13:45.000451Z

I have hope that something will change in the internals of Om Next that will obviate the need for it having a compiler hack, since such a thing is quite fragile. But, for the time being it is best to at least know it is there.

tony.kay 2017-10-16T20:14:25.000043Z

See https://github.com/omcljs/om/issues/880

👍 2