These are chat archives for japgolly/scalacss

20th
Mar 2015
Otto Chrons
@ochrons
Mar 20 2015 05:55
seems like Best Practice to me! :)
David Barri
@japgolly
Mar 20 2015 06:09
Otto Chrons
@ochrons
Mar 20 2015 06:31
nice class names ¢ð{text-align... :)
Justin du Coeur, AKA Mark Waks
@jducoeur
Mar 20 2015 12:00
PlatformJs (and the updater) looks pretty useful in its own right -- might be worth extracting that out into its own mini-library somewhere down the line...
Otto Chrons
@ochrons
Mar 20 2015 12:46
automatic packaging of such libs would be really nice
create a facade, and "link" the original JS
Justin du Coeur, AKA Mark Waks
@jducoeur
Mar 20 2015 12:48
Well, it's fairly easy if the JS has a webjar. It's more of a pain if not, though...
Otto Chrons
@ochrons
Mar 20 2015 12:48
but you need to separately use jsDependencies in your app, in addition to importing the Scala.js lib
so it's not just a single dependency as it should be
Justin du Coeur, AKA Mark Waks
@jducoeur
Mar 20 2015 12:50
Is that avoidable? I mean, you only need the jsDependencies if other JS depends on this one, right? And if that's the case, then order of the JS matters enormously. Indeed, is there a way to deal with JS-order dependency in this approach?
Otto Chrons
@ochrons
Mar 20 2015 12:51
um, you need jsDependency if you want to include the JS file in your app conveniently, instead of adding N+1 <script> tags
ideally you would just have "org.mydomain" %%% "platform-js" % "0.688" dependency and it would just work
so that the original platform.js file ends up in your web app as part of other jsDeps
right now you need to include the .js part separately, from a webjar, bundle in the app, use CDN etc
Justin du Coeur, AKA Mark Waks
@jducoeur
Mar 20 2015 12:55
That doesn't seem right. I mean, if you use the scala-js-jquery library, you don't have to declare a jsDependency line for jquery.js -- it's automatically pulled in as part of the library declaration. And then the other jsDependencies can just depend on jquery.js
Otto Chrons
@ochrons
Mar 20 2015 12:56
oh really, I hadn't looked it in detail
but do you get jquery.js on your web page automatically too?
Justin du Coeur, AKA Mark Waks
@jducoeur
Mar 20 2015 12:56
I'm pretty sure. I mean, this was my Build.scala until I moved away from scala-js-jquery a couple of weeks ago -- note the lack of a jsDependency for jquery.js.
And yeah -- I believe the jsDependencies get pulled in from the libraries.
Otto Chrons
@ochrons
Mar 20 2015 12:58
ok, that's cool then :)
so you just need to invoke the packageJSDeps
Justin du Coeur, AKA Mark Waks
@jducoeur
Mar 20 2015 12:58
I'll know for sure soon, when I pull my own jQuery facade out and refactor to use it.
Otto Chrons
@ochrons
Mar 20 2015 12:58
and it will know to include all the JS files bundled in facade libs
Justin du Coeur, AKA Mark Waks
@jducoeur
Mar 20 2015 12:58
As far as I know, yes.
Otto Chrons
@ochrons
Mar 20 2015 12:59
ok, I didn't know that was exposed by the lib somehow
Justin du Coeur, AKA Mark Waks
@jducoeur
Mar 20 2015 12:59
Yeah, I think it's part of how jsDependencies works under the hood.