om 2017-10-16

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

@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

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 ^^

but might apply for you as well

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

tell me

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

I'm trying to remember the command

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

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

(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 ?

let's not confuse profile with build ids, hehe

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

ohhhh lol

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

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

ok

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

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

nice, glad to hear 🙂

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

crazy

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 ?

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

ok 🙂

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 ?

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

thank @sundarj, but it doesn’t work 😞

the set! does not work?

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

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

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

@joe.lane has joined the channel

@wilkerlucio turns out it was not a dependency problem

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.

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.