These are chat archives for opal/opal

23rd
Mar 2015
Kurtis Rainbolt-Greene
@krainboltgreene
Mar 23 2015 04:53
Would there be a way for opal to check gems for metadata in a gemspec to see if it's compatible with opal.rb?
That way gem owners can mark their gem as opal-compatible.
Elia Schito
@elia
Mar 23 2015 09:16
@adambeynon I think the back-to-sprockets branch is good (both for opal and opal-rails, which implies opal-rspec)
Adam Beynon
@adambeynon
Mar 23 2015 09:21
@elia nice one! So opal-rails overrides the script tag helper?
Elia Schito
@elia
Mar 23 2015 09:22
yep, but the code loading generation is delegated to Processor so it should be easy to use the code elsewhere (sinatra etc)
@adambeynon
Adam Beynon
@adambeynon
Mar 23 2015 09:23
@elia ah, thats good. Does it fix the sourcemaps issues, or shall I take a look at that?
Elia Schito
@elia
Mar 23 2015 09:23
They seem to be fixed, apprently having clear boundaries between files helps a lot
@adambeynon I guess we'll just wait for sprockets 4 to get them merged into a single map
right now was about to give a try to the sprockets 3 beta10 (quasi rc1)
Adam Beynon
@adambeynon
Mar 23 2015 09:25
@elia ahhh I see. Yeah, working closer with sprockets on that should make it a bit more robust. I figure they will be pouring lots of work into it for es6 and coffeescript support
Elia Schito
@elia
Mar 23 2015 09:25
@adambeynon yep, who needs to ewinvent the wheel after all :)
Adam Beynon
@adambeynon
Mar 23 2015 09:27
@elia ha, yeap
I can’t see where you override the script helper?
am I just being blind?
Elia Schito
@elia
Mar 23 2015 09:28
never opened a PR, and even called the branch WIP
Adam Beynon
@adambeynon
Mar 23 2015 09:28
ohhhhhh
right, makes sense
Elia Schito
@elia
Mar 23 2015 09:29
opal/opal-rails#43
@adambeynon opal/opal#773
Adam Beynon
@adambeynon
Mar 23 2015 09:36
@elia :metal: fantastic!
it all looks good to me, so merge it :+1:
@elia Im going to merge in the template variables pull request as well later, makes templating a lot more convenient
Elia Schito
@elia
Mar 23 2015 09:37
@adambeynon let's rock then! :)
Elia Schito
@elia
Mar 23 2015 09:43
@adambeynon both merged 🎉
Adam Beynon
@adambeynon
Mar 23 2015 09:53
@elia :clap: woop! Going to upgrade to this today I hope, was really missing the source maps
@elia Do you think 0.8 is close? there are some good changes since 0.7
Elia Schito
@elia
Mar 23 2015 09:54
I do
@adambeynon we'll have to do the usual round up for open issues first tho
especially those marked 0.8, probably pushing them to next release
Adam Beynon
@adambeynon
Mar 23 2015 09:55
@elia yeap. Just working on some last minute code here, but I will take a good look later today at what is open atm, and give the new sprockets stuff a thorough testing.
and opal-rspec, to ensure that still works ok
Elia Schito
@elia
Mar 23 2015 09:56
@adambeynon :+1:
Can Edremitoglu
@cantonic
Mar 23 2015 17:56
hmm… I just upgraded opal and opal-rails to the latest master version and now I keep getting Uncaught TypeError: Cannot set property '$$p' of undefined for a file which only contains a simple alert function
Elia Schito
@elia
Mar 23 2015 17:58
Try deleting tmp/cache/assets and restart the app (and spring)
Can Edremitoglu
@cantonic
Mar 23 2015 17:58
alright… turns out that I have to change Sprocket’s //= require statements in application.js.rb to Ruby's
@elia ok. let me revert the changes to application.js.rb and try your suggestion to make sure
Elia Schito
@elia
Mar 23 2015 17:59
please paste the broken code so that I know how to fix it in case someone else gets the error
Can Edremitoglu
@cantonic
Mar 23 2015 18:00
@elia the broken code is a simple alert “foo”
I know changed my application.js.rb back to application.js and used Sprocket’s require statements: broken
I will create a github issue explaining it further if you want
Adam Beynon
@adambeynon
Mar 23 2015 18:01
@cantonic If you comment out that line, does it then work?
do you define alert() ?
(might be a Native issue, for example)
Can Edremitoglu
@cantonic
Mar 23 2015 18:02
@adambeynon when commenting it out the error is gone, but the same errors happens for any kind of code.
I also get a WARNING: LoadError: cannot load such file -- application from runtime.js
now i am renaming application.js to application.js.rb
one sec
Adam Beynon
@adambeynon
Mar 23 2015 18:04
@cantonic are you running pow? or anything similar? After such big changes to Opal, I often need to clear the asset cache, as per @elia suggestion, but I also need to restart the server (touch tmp/restart.txt for pow)
Can Edremitoglu
@cantonic
Mar 23 2015 18:06
after renaming to application.js.rb the WARNING is gone, but Uncaught TypeError: Cannot set property '$$p' of undefined is still there (application.js.rb uses Sprocket’s //= require statements)
@adambeynon i don’t use pow and already cleared the assets directory
now i am changing Sprocket’s //= require methods to Ruby’s require methods in application.js.rb
works now
looks like it is now required to change application.js to application.js.rb and use ruby’s require methods instead of sprocket’s.
we should update the README accordingly if this is the way it works now
Adam Beynon
@adambeynon
Mar 23 2015 18:09
hmm, that is odd
@cantonic I was going to update an app to latest opal master this evening, so I will have a look to see if I run into the same issue
I don’t quite understand why its breaking for you - we have moved back to a more basic integration with sprockets - should have made the bridge smaller
anyway, I will have a look on my app this side
Can Edremitoglu
@cantonic
Mar 23 2015 18:13
@adambeynon thank you. if you are using Ruby’s require methods in your app, try to change them to the Sprocket’s //= require in order to reproduce my error
Adam Beynon
@adambeynon
Mar 23 2015 18:13
@cantonic will do :+1:
Elia Schito
@elia
Mar 23 2015 18:18
@cantonic does it change anything if you switch sprockets requires from //= to #= ?
Can Edremitoglu
@cantonic
Mar 23 2015 18:21
will try
Can Edremitoglu
@cantonic
Mar 23 2015 20:31
@elia same error with #=
Elia Schito
@elia
Mar 23 2015 20:31
good to know
Elia Schito
@elia
Mar 23 2015 22:41
@cantonic can you paste the contents? I can't reproduce…