2

Opal is generating source maps. I can enable JavaScript source maps in chrome, set breakpoints it even stops in debugger. But it is still not of much practical use.

  1. I cannot investigate local variables. Even if I try to evaluate the same in chrome's console, they all appear as Nil.
  2. I would like to be able to switch between the ruby sources and the generated Javascript (which is not that hard to understand).

up to now I was most successful by searching significant identifiers in the generated Javascript and not using source maps at all.

Any hints are welcome.

Bernhard
  • 686
  • 8
  • 20

1 Answers1

0

Sourcemaps now work in Opal 0.8.0 using Opal Server

# config.ru
require 'bundler'
Bundler.require

#Opal::Processor.inline_operators_enabled = true
run Opal::Server.new { |s|

s.append_path 'public'
s.append_path 'src'

Opal.use_gem "vector2d"

Opal.paths.each { |p| s.append_path(p) }


#s.use_gem 'vector2d'

# s.debug = true
s.source_map = true

s.main = 'application'

s.index_path = 'index_opal.html.erb'

}

Bernhard
  • 686
  • 8
  • 20