These are chat archives for jescalan/roots

20th
Mar 2017
Daniel Box
@dbox
Mar 20 2017 14:35
can js-pipeline reference node_modules directly?
Jeff Escalante
@jescalan
Mar 20 2017 14:36
as long as its in the files path, it should be able to
Daniel Box
@dbox
Mar 20 2017 14:53
  extensions: [
    js_pipeline
      files: ['node_modules/jquery/dist/jquery.js',
              'assets/js/vendor/jquery.waypoints.js',
              'assets/js/vendor/jquery.touchwipe.1.1.1.js',
              'assets/js/scripts/**']
      out: 'js/build.js'
      # minify: true
    css_pipeline
      files: "assets/css/**"
      # minify: true
  ]
this seem right?
somehow just skips it
was going to replace all the vendor folder ones with node_module references
Daniel Box
@dbox
Mar 20 2017 15:39
something to do with ignores or dumpdirs?
James Dinsdale
@molovo
Mar 20 2017 15:42
Yeah, node_modules will be ignored because it’s in ignores. Otherwise, the entire contents of node_modules will appear in public. You could get round it by using the roots-browserify plugin and requiring jQuery
Daniel Box
@dbox
Mar 20 2017 15:43
thanks @molovo ...
ignores: ['readme.md', '**/layout.*', '**/_*/*','.gitignore', 'ship.*conf’]
there’s my ignores ...
James Dinsdale
@molovo
Mar 20 2017 15:44
Hmm
Jeff Escalante
@jescalan
Mar 20 2017 15:44
node modules is kind of a hard ignore
i have this in core
basically once you are using node modules, you have surpassed the simple abilities of js pipeline haha
Daniel Box
@dbox
Mar 20 2017 15:45
gotcha...
seems like spike is the same
it wants you to manually put vendor stuff in /vendor
right?
James Dinsdale
@molovo
Mar 20 2017 15:45
You could create a symlink to the jquery module. Try this: ln -s ../../node_modules/jquery assets/js/jquery, then change your path in js_pipeline to assets/js/jquery/dist/jquery.js
Daniel Box
@dbox
Mar 20 2017 15:46
well
i CAN manually put it there
i just prefer to reference node_modules
Jeff Escalante
@jescalan
Mar 20 2017 15:46
with spike you require in your bundle
Daniel Box
@dbox
Mar 20 2017 15:46
for updates and whatnot
Jeff Escalante
@jescalan
Mar 20 2017 15:46
and it will work from node_modules without issue
Daniel Box
@dbox
Mar 20 2017 15:47
i need to update this site but its going to be a beast
Jeff Escalante
@jescalan
Mar 20 2017 15:47
haha yea :(
i wish i had a migration tool but this would take me like weeks of work
Daniel Box
@dbox
Mar 20 2017 15:47
seems unfeasible
Jeff Escalante
@jescalan
Mar 20 2017 15:47
spike solves all module bundling issues pretty cleanly though
this was one of the major motivations for the rewrite, needed tighter module bundling integration
James Dinsdale
@molovo
Mar 20 2017 15:48
With a symlink it would still be loading it from node_modules, but you’d point js_pipeline at assets. So if you had no node_modules folder, then assets/js/jquery will not really exist.
Daniel Box
@dbox
Mar 20 2017 15:48
yeah, great idea but I think its more confusing vs just adding the file
especially when others are touching code
James Dinsdale
@molovo
Mar 20 2017 15:49
Yeah, you can’t load from node_modules then
Daniel Box
@dbox
Mar 20 2017 15:49
:cry:
np
but i can with browserify right
James Dinsdale
@molovo
Mar 20 2017 15:49
Yeah, you can
Daniel Box
@dbox
Mar 20 2017 15:50
@jescalan spike-roots-tpl will solve a LOT of the conversion woes
Jeff Escalante
@jescalan
Mar 20 2017 15:50
ah yea this is true
i forgot about that
James Dinsdale
@molovo
Mar 20 2017 15:50
I should caveat that with: Provided jQuery supports being required. I haven’t used it for years
Jeff Escalante
@jescalan
Mar 20 2017 15:50
the only caveat is that you can't use spike-roots-tpl with a records plugin that also generates templates per-record
@molovo it does now :)
although i also havent used it recently
James Dinsdale
@molovo
Mar 20 2017 15:51
:D
Daniel Box
@dbox
Mar 20 2017 15:52
just tell me “just manually import vendor scripts until you switch to spike"
James Dinsdale
@molovo
Mar 20 2017 15:52
just manually import vendor scripts until you switch to spike
:D
Daniel Box
@dbox
Mar 20 2017 15:52
thnx
James Dinsdale
@molovo
Mar 20 2017 15:52
I should really get around to trying spike
Daniel Box
@dbox
Mar 20 2017 15:53
i’m waiting on spike@next before i switch anything
James Dinsdale
@molovo
Mar 20 2017 15:56
I’ll have to port (or create from scratch) my roots-image-pipeline plugin before I can fully switch. I don’t look forward to doing that
Jeff Escalante
@jescalan
Mar 20 2017 16:00
oh nice, this is a great plugin
Daniel Box
@dbox
Mar 20 2017 16:00
is there a webpack equivalent?
Jeff Escalante
@jescalan
Mar 20 2017 16:00
we were just talking about this the other day
with spike, i think it will end up as a pair of scripts
a reshape custom element for the picture element output
and a little plugin to run the resizing
there is some webpack stuff like this https://github.com/Levelmoney/resize-image-loader
nothing i've found that does it just the way we want it
which @molovo's plugin seems to do
Daniel Box
@dbox
Mar 20 2017 16:02
@molovo :trophy:
James Dinsdale
@molovo
Mar 20 2017 16:02
:D
Jeff Escalante
@jescalan
Mar 20 2017 16:02
we definitely will make this though
probably soon
this guy behind the scenes for the generation plugin, standard reshape plugin for the markup
Daniel Box
@dbox
Mar 20 2017 16:03
wonder if they will incoporate that new thing google just released
that supposedly makes jpegs 30% smaller
Jeff Escalante
@jescalan
Mar 20 2017 16:03
oh yeah, will be building this into the spike plugin
so it will serve webp if possible, if not, google compressed jpeg
Jeff Escalante
@jescalan
Mar 20 2017 16:03
yea
we will def ship it with this
James Dinsdale
@molovo
Mar 20 2017 16:03
roots-image-pipeline does need a rewrite anyway. It really breaks if you have a ton of images. That seems to be an upstream issue with gm. Whether I port it to spike or not, I am planning on replacing gm with sharp, so I’m definitely behind that.
Jeff Escalante
@jescalan
Mar 20 2017 16:04
my only struggle is when/how to run
i think its a little wasteful to run in development
Daniel Box
@dbox
Mar 20 2017 16:04
dang it
Jeff Escalante
@jescalan
Mar 20 2017 16:04
i guess probably production only is fine
Daniel Box
@dbox
Mar 20 2017 16:04
:two_men_holding_hands: :cloud:
Jeff Escalante
@jescalan
Mar 20 2017 16:04
with a standalone run option if you want to optimize in development
to be fair, it would be nice to ship less images into version control anyway
just check in the source image, have the other sizes compiled out only in production
Daniel Box
@dbox
Mar 20 2017 16:05
yeah its a repo size vs compile time trade off
James Dinsdale
@molovo
Mar 20 2017 16:05
That’s how I do it. With roots-image-pipeline, if resize and compress are both false, you just get an img tag pointing to the original image. So it’s all off in app.coffee and then enabled in app.production.coffee. Does spike support environments?
Jeff Escalante
@jescalan
Mar 20 2017 16:05
well if you only run it in production, you get both faster compile time and smaller repo size
yeah it does
exactly the same as roots
James Dinsdale
@molovo
Mar 20 2017 16:06
Sweet. Shouldn’t be too hard then
Jeff Escalante
@jescalan
Mar 20 2017 16:06
but it merges the app.js as a base into other environments
Daniel Box
@dbox
Mar 20 2017 16:06
but your dev files would be larger wouldn’t they
Jeff Escalante
@jescalan
Mar 20 2017 16:06
so slightly less repetition
yeah, but its local anyway
James Dinsdale
@molovo
Mar 20 2017 16:06
That’s a good idea
Jeff Escalante
@jescalan
Mar 20 2017 16:06
so its not really a big deal
you need the largest size somewhere regardless, this would just make it so that you only need the largest size checked in, rather than the largest and like 8 other slightly smaller versions, and webp copies of all of them haha
James Dinsdale
@molovo
Mar 20 2017 16:07
Agreed
Daniel Box
@dbox
Mar 20 2017 16:07
got it
Jeff Escalante
@jescalan
Mar 20 2017 16:07
this will be an awesome plugin when its out haha
Daniel Box
@dbox
Mar 20 2017 16:08
yeah
Jeff Escalante
@jescalan
Mar 20 2017 16:08
i have been doing it manually on the last 2 projects
Daniel Box
@dbox
Mar 20 2017 16:08
definitely a computer task
Jeff Escalante
@jescalan
Mar 20 2017 16:08
just bc they have had tight deadlines
Daniel Box
@dbox
Mar 20 2017 16:08
googe page speed is also currently my nemesis
although
i was poking around
and i decided to test one of google’s own marketing sites
on google page speed
and they got like a 12/22
or something
so
James Dinsdale
@molovo
Mar 20 2017 16:08
lol. Yeah, they all fail miserably
Jeff Escalante
@jescalan
Mar 20 2017 16:09
haha yeah, a lot of google's stuff is a mess
its hard to manage that much shit
Daniel Box
@dbox
Mar 20 2017 16:09
pretty hypocritical, especially when they BLOCK your side from adwords
if it goes lower than 50
Jeff Escalante
@jescalan
Mar 20 2017 16:09
i usually will run lighthouse and canary devtools with network and cpu throttle for this type of testing
yeah doubleclick ads are also slow as fuck
i have some ideas to speed them up
that i am going to pitch to google people
basically, render the html for the ads in a web worker, then pipe it onto the page
James Dinsdale
@molovo
Mar 20 2017 16:10
That’s a really good idea. Would make a massive difference
Jeff Escalante
@jescalan
Mar 20 2017 16:10
i dont really care bc they usually are just blocked, but i am making a site with ads rn and it makes me cringe so hard
seeing all the slowness from them
James Dinsdale
@molovo
Mar 20 2017 16:12
It’s mostly all the tracking scripts that come with them that add to the slowness though - and it’s very unlikely we’ll get rid of those any time soon
Makes me throw things when I build a speedy site for a client and then have to paste in tracking scripts for 37 different bullshit services
Daniel Box
@dbox
Mar 20 2017 16:12
the dark seedy underbelly of the ‘marketing stack'
Jeff Escalante
@jescalan
Mar 20 2017 16:13
yeah it is super annoying
i push clients really hard to eliminate them these days
Daniel Box
@dbox
Mar 20 2017 16:13
good luck!
Jeff Escalante
@jescalan
Mar 20 2017 16:13
the thing is, it's a footgun
you can put in all your ads and tracking scripts and marketing shit
James Dinsdale
@molovo
Mar 20 2017 16:14
I wish http://decknetwork.net would open themselves up to more publishers. Their ads are lovely
Jeff Escalante
@jescalan
Mar 20 2017 16:14
but it will slow down your site, then make people leave
and therefore you will lose money, in your attempts to make more money
Daniel Box
@dbox
Mar 20 2017 16:14
marketers want their google tag manager, hubspot and hotjars
Jeff Escalante
@jescalan
Mar 20 2017 16:14
this is usually the way i pitch it to the clients, and they are usually pretty receptive to this
Daniel Box
@dbox
Mar 20 2017 16:14
i dont see it going away
Jeff Escalante
@jescalan
Mar 20 2017 16:16
yeah, more ad networks that focus on not being garbage and rendering fast would be :ok_hand:
Covington Doan
@covingtondoan
Mar 20 2017 16:17
I'm working on a HubSpot site right now :cry:
Jeff Escalante
@jescalan
Mar 20 2017 16:17
i feel like marketing people are always looking for ways to make things generate more money that are not "build a higher quality product" and that shit drives me crazy
James Dinsdale
@molovo
Mar 20 2017 16:35
I’d be tempted to build my own ‘ethical ad provider', but that’s such a hard industry to gain traction in. Need the large publisher base to get advertisers, need a large advertiser base to get publishers. Real chicken and egg situation
Jeff Escalante
@jescalan
Mar 20 2017 16:36
yeah i have been considering this as well
Covington Doan
@covingtondoan
Mar 20 2017 16:36
Yeah, Marco Arment, the creator of Overcast recently rolled his own ads
Jeff Escalante
@jescalan
Mar 20 2017 16:36
or even just a tiny system that we can use for sites we produce
that produces good looking ads and has some sort of advertiser interface
that could be swapped in for google ads if the company is cool with it
if the site is popular, people will be interesting in placing ads there, even if its not through google, i thiiiink
James Dinsdale
@molovo
Mar 20 2017 16:38
I did play with an idea once for rendering ads server-side. Was a PHP library, you just echoed \Library::ad() and it pulled in a HTML template from the ad server, and cached it for an hour to keep it snappy. Then the HTML was rendered directly onto the page. Made for some really nice responsive ads, but I’d hate to try and launch that as a business so I never went any further with it
Jeff Escalante
@jescalan
Mar 20 2017 16:39
fair enough! cool experiment though
yeah the responsive thing is important too
James Dinsdale
@molovo
Mar 20 2017 16:40
Yeah, I might revisit it one day. Would need to build libraries in all the different languages to make it viable though, which is why so many people use front-end JS as it’s universal and far easier to support, if not as performant
Jeff Escalante
@jescalan
Mar 20 2017 18:14
the webworker approach could make it easier
Daniel Box
@dbox
Mar 20 2017 19:56

I'm working on a HubSpot site right now :cry:

hugs @covingtondoan