<adambeynon_>
also, I think I want to get .erb to the Builder handler for Opal::ERB files. So, to get “normal/current” era behaviour we would need some special extension
<adambeynon_>
more and more I see people using .erb for templates client side
<adambeynon_>
really, server side erb handling is only useful for spec runners and the like now
<elia>
adambeynon_, don't follow, maybe I lack experience with opal erb templates
<elia>
*I don't follow
<elia>
> more and more I see people using .erb for templates client side
<elia>
you mean parsed by opal-parser in the browser?
<adambeynon_>
elia: sorry, no. If you want to precompile an ERB template on the server, you can `require` it, but you must use the `.opalerb` extensions because sprockets handles `.erb` templates as a real erb file, i.e. it runs the erb file, then spits out the result as a javascript file
Zackio has quit [Remote host closed the connection]
<adambeynon_>
I want Builder to use .erb extensions instead of .opalerb
<elia>
adambeynon_, so you mean stealing erbs from sprockets and allow people to share entire app/views dir with opal?
<adambeynon_>
elia: yes, exactly. but it wont break anything with sprockets as it will only effect required made inside Opal::Builder
<adambeynon_>
requires*
Zackio has joined #opal
<adambeynon_>
elia: btw, do you use .rb files or .opal files ?
<elia>
.js.rb
<elia>
or .rb
<elia>
but the js helps when searching for files
<adambeynon_>
elia: yeah, same. I tend to have an opal version of every rails controller.. gets very annyoing when using fuzzy searching files :(
<elia>
also .js.rb is the speockets convetion
<elia>
I'd like to have .opal deprecated along with opalerb :P
<adambeynon_>
elia: 0.7 seems a good time then ^_^
<adambeynon_>
elia: thinking back, is that rails issue still relevant where .rb files inside assets/ were sometimes being loaded by rails
<elia>
adambeynon_, ok, so let's keep it for now as deprecated / arcane extension
<elia>
rails issue, not sure, I think I put some hack in the engine to freeze stuff at initialize time and preventing it to add assets to eager loading
<elia>
didn't see issues about it in a while I think, so it probably works well enough
CoderPuppy has joined #opal
meh`_ has joined #opal
cpup has quit [Ping timeout: 256 seconds]
meh` has quit [Ping timeout: 258 seconds]
<adambeynon_>
elia: so, sprockets 2.x doesnt actually use a store, rails has to specify one for it to use
<adambeynon_>
should Builder use an in-memory cache if one isnt specified in sprockets?
<adambeynon_>
otherwise we are recompiling every asset on page reload
<adambeynon_>
a file cache doesnt seem a good default option as we would be littering the working dir
<elia>
adambeynon_, in memory seems good to me, Hash.new?
<adambeynon_>
elia: yes, I think that should do the job
<elia>
adambeynon_, unrelated, I was thinking about exporting "rake dist" somewhere after successful travis builds
<elia>
I'm not sure where to put the "artifacts" tho
<adambeynon_>
elia: for use as the “latest” cdn downloads?
<elia>
yep
<elia>
I started to use autodeploy to heroku after successful travis builds in a project recently and it's awesome
meh`_ has quit [Quit: I don't want to live on this planet anymore.]
meh` has joined #opal
<adambeynon_>
elia: yeah, that would be really nice to have
GitHub128 has joined #opal
<GitHub128>
[opal] adambeynon pushed 3 new commits to cache_store: http://git.io/t8J6bA
<GitHub128>
opal/cache_store cd76262 Adam Beynon: CacheStore relies on sprockets
<GitHub128>
opal/cache_store 2edac24 Adam Beynon: Add default memory based cache store
<GitHub128>
opal/cache_store 5b6bb80 Adam Beynon: Placeholder asset#fresh? for checking cached status
GitHub128 has left #opal [#opal]
travis-ci has joined #opal
<travis-ci>
opal/opal#2153 (cache_store - 5b6bb80 : Adam Beynon): The build passed.
<adambeynon_>
elia: I overlooked something obvious which has put me on a bit of a roadblock
<adambeynon_>
I forgot that the Builder is re-created on every page reload
<elia>
yep
<adambeynon_>
so even though it is caching, the cache is deleted between page loads
<elia>
would be enough to pass the cache at builder creation?
<adambeynon_>
elia: yeap, but we still need a way to store the cache between builder instances (and of course, there might be more than 1 sprockets instance per process)
<elia>
coud even default to def Opal.cache; @cache ||= {}; end
f-3r has joined #opal
<adambeynon_>
elia: I cant work out if a shared cache between sprockets instances is a bad thing or not….. otherwise, the Sprockets::Environment object is maintained between pages (its the middleware component), we could be sneaky and shove some `opal_cache` method on there….
<adambeynon_>
Opal.cache would otherwise be maintained between the whole lifecycle of the process
<adambeynon_>
and never cleanup
<elia>
adambeynon_, I don't think it should be bound to sprockets in the builder
<adambeynon_>
elia: agreed, the linking could be done inside Opal::Processor, where it creates the builder
<elia>
+1 for adding #opal_cache to Sprockets
<elia>
indeed
GitHub63 has joined #opal
<GitHub63>
[opal] adambeynon pushed 2 new commits to cache_store: http://git.io/LhC6zg
<GitHub63>
opal/cache_store 955e335 Adam Beynon: Fix sprockets based cache
<GitHub63>
opal/cache_store 1558aed Adam Beynon: Fix opal-repl
GitHub63 has left #opal [#opal]
travis-ci has joined #opal
<travis-ci>
opal/opal#2157 (cache_store - 1558aed : Adam Beynon): The build passed.