Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 7597201

Browse files
committed
Remove sprockets-es6 from dependency
1 parent a094955 commit 7597201

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed

Gemfile.lock

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ PATH
44
react.rb (0.2.1)
55
opal (~> 0.6.0)
66
opal-activesupport (~> 0)
7-
sprockets-es6 (~> 0)
7+
react-jsx (~> 0.8.0)
8+
sprockets (>= 2.2.3, < 3.0.0)
89
therubyracer (~> 0)
910

1011
GEM
1112
remote: https://rubygems.org/
1213
specs:
13-
babel-source (4.7.16)
14-
babel-transpiler (0.6.0)
15-
babel-source (>= 4.0, < 5)
16-
execjs (~> 2.0)
17-
execjs (2.4.0)
14+
execjs (2.5.2)
15+
hike (1.2.3)
1816
json (1.8.2)
1917
libv8 (3.16.14.7)
18+
multi_json (1.11.0)
2019
opal (0.6.3)
2120
source_map
2221
sprockets
@@ -30,6 +29,10 @@ GEM
3029
rack-protection (1.5.3)
3130
rack
3231
rake (10.4.2)
32+
react-jsx (0.8.0)
33+
execjs (>= 2.0.2)
34+
json (>= 1.8.0)
35+
react-source (>= 0.4.1)
3336
react-source (0.12.2)
3437
ref (1.0.5)
3538
sinatra (1.4.6)
@@ -38,15 +41,15 @@ GEM
3841
tilt (>= 1.3, < 3)
3942
source_map (3.0.1)
4043
json
41-
sprockets (3.0.0.beta.10)
44+
sprockets (2.12.3)
45+
hike (~> 1.2)
46+
multi_json (~> 1.0)
4247
rack (~> 1.0)
43-
sprockets-es6 (0.6.0)
44-
babel-transpiler
45-
sprockets (~> 3.0.0.beta)
46-
therubyracer (0.12.1)
48+
tilt (~> 1.1, != 1.3.0)
49+
therubyracer (0.12.2)
4750
libv8 (~> 3.16.14.0)
4851
ref
49-
tilt (2.0.1)
52+
tilt (1.4.1)
5053

5154
PLATFORMS
5255
ruby
@@ -55,6 +58,6 @@ DEPENDENCIES
5558
opal-jquery (~> 0)
5659
opal-rspec (~> 0.3.0.beta3)
5760
rake (~> 10)
58-
react-source (~> 0.12)
61+
react-source (~> 0.12.0)
5962
react.rb!
6063
sinatra (~> 1)

lib/react/ext/jsx_support.rb

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
1-
require "execjs"
1+
require 'react/jsx'
2+
require 'tilt'
23
require "sprockets"
3-
require "sprockets/es6"
44

5-
module ExecJS
6-
class Runtime
7-
alias_method :orig_compile, :compile
8-
def compile(source)
9-
context = orig_compile("var console = {error: function(){}, log: function(){}, warn: function(){}, info: function(){}};" + source)
10-
context
5+
module React
6+
module JSX
7+
8+
class Template < Tilt::Template
9+
self.default_mime_type = 'application/javascript'
10+
11+
def prepare
12+
end
13+
14+
def evaluate(scope, locals, &block)
15+
@output ||= React::JSX.compile(data)
16+
end
1117
end
1218
end
1319
end
1420

15-
Sprockets.register_mime_type 'text/jsx', extensions: ['.jsx']
16-
Sprockets.register_transformer 'text/jsx', 'application/javascript', Sprockets::ES6.new('whitelist' => ['react'])
21+
Sprockets.register_engine '.jsx', React::JSX::Template

react.rb.gemspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ Gem::Specification.new do |s|
1818

1919
s.add_runtime_dependency 'opal', '~> 0.6.0'
2020
s.add_runtime_dependency 'opal-activesupport', '~> 0'
21-
s.add_runtime_dependency 'sprockets-es6', '~> 0'
2221
s.add_runtime_dependency 'therubyracer', '~> 0'
23-
s.add_development_dependency 'react-source', '~> 0.12'
22+
s.add_runtime_dependency 'react-jsx', '~> 0.8.0'
23+
s.add_runtime_dependency 'sprockets', '>= 2.2.3', '< 3.0.0'
24+
s.add_development_dependency 'react-source', '~> 0.12.0'
2425
s.add_development_dependency 'opal-rspec', '~> 0.3.0.beta3'
2526
s.add_development_dependency 'sinatra', '~> 1'
2627
s.add_development_dependency 'opal-jquery', '~> 0'

0 commit comments

Comments
 (0)