Fork me on GitHub
#hoplon
<
2017-06-13
>
thedavidmeister00:06:31

this might not be right, but my understanding is that hoplon does compiling per-page

thedavidmeister00:06:57

so yeah, it's faster to have some kind of dynamic routing under one page than lots of pages all compiling

thedavidmeister00:06:40

as yet, i do not know what impact this has on SEO, if any, maybe @alandipert or @micha could give more details on that?

flyboarder00:06:02

@mudphone @thedavidmeister if you look at the boot-hoplon task, once there are hl files detected, it goes through and compiles those to cljs then parses the cljs files, depending on your project size this can take a while

flyboarder00:06:39

for this reason I am converting all my libraries to cljs to speed up build times

flyboarder00:06:07

and I use .hl for the page macro

thedavidmeister01:06:02

@flyboarder is it any faster/slower to use .cljs instead of .hl files for a given page?

thedavidmeister01:06:03

e.g. (ns ^{:hoplon/page "index.html"} pages.index ...)

flyboarder01:06:21

Yeah using a cljs file will always be faster

flyboarder01:06:11

Else you always need an extra build task which will take time

flyboarder01:06:11

I find if I use .hl for the index page only and cljs for everything else I get a decent build time, then factoring components into smaller libraries cuts down on app level code which requires rebuilding

flyboarder01:06:33

I am often running 4 builds at a time of multiple components

thedavidmeister01:06:23

i do only have one .hl atm

thedavidmeister01:06:43

if i move things into something on clojars, will that speed up my build times too?

flyboarder03:06:47

moving things to separate projects limits the number of files/folder tracked

flyboarder03:06:59

but that seems unnecessary

thedavidmeister03:06:28

ah ok, i didn't now whether clojure still needed to compile dependencies

thedavidmeister03:06:36

i assumed it would need to

tjscollins06:06:54

Does anyone know if there is a way to get hoplon to play nice with an existing instance of jQuery? I have a site using clojurescript, and I was considering incorporating hoplon in order to add a new planned feature, but requiring hoplon in any namespace seems to clobber the existing jQuery and plugins that the site already uses. Is there anyway to get hoplon to use the pre-existing instance of jQuery rather than requiring its own?

dm306:06:22

@tjscollins you probably need to exclude the jQuery dependency when including hoplon

dm306:06:39

:dependencies '[[hoplon VERSION] :exclusions [cljsjs/jquery]]

mudphone06:06:39

@thedavidmeister @flyboarder thank you, I have much to think about now.

tjscollins07:06:18

@dm3 That doesn't seem to do it. It's weird. Simply having

(ns theme.test
    (:require [hoplon.core :as h]))
Breaks the existing jQuery plugins. Looking through hoplon.core, it never actually pulls in another instance of jQuery that I can find. Looking in Dev Tools, only the the jQuery I have listed in :foreign-libs ever gets loaded. But still it gets broken by hoplon. I have no idea why.

dm307:06:46

how broken?

tjscollins07:06:06

@dm3 I'm using a jQuery plugin to create a carousel. It works without hoplon loaded, and with hoplon loaded I get a nonresponsive mess. Basic jquery stuff seems to work, but the plugin is totally broken (plugin is slick, if that matters)

dm307:06:08

yeah, but where does it start to break in javascript? Hoplon doesn’t go and modify jQuery internals, so if you’re sure that you have the right jQuery version on the page - you should be good

tjscollins07:06:47

@dm3 I'm not sure what you mean. Every looks right, except the carousel plugin. I just tried a few other parts of the site and that seems to be the only thing breaking.

dm307:06:17

are there any js errors?

tjscollins07:06:36

The plugin must be making some global assumption that hoplon breaks...but I have no idea what.

dm307:06:02

yeah, so if it works without the hoplon dependency

dm307:06:24

I’d try to 1. diff the loaded JS tree with/without Hoplon on the page with breakage

dm307:06:48

2. step through plugin initialization in JS to see if there’s anything obvious

alandipert14:06:54

@mudphone re: hoplon speed, in hoplon 7.0.0 there was a big improvement

alandipert14:06:24

or rather, 7.0.1 is the one you want

mudphone00:06:28

alandipert: Ah okay, that jives with what I’m seeing. I bumped from 6.0.0-alpha17 to 7.0.1 and got a big improvement.

mudphone00:06:50

I also consolidated my .hl files, but it went from 10 minutes to 1 minute.

mudphone00:06:15

That’s from a cold boot (not a reload).