Skip to content

Commit c9940e2

Browse files
Adding jsdom
1 parent c0e2efa commit c9940e2

File tree

1,042 files changed

+118829
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,042 files changed

+118829
-3
lines changed

.project

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>react-rails</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>com.aptana.ide.core.unifiedBuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.radrails.rails.core.railsnature</nature>
16+
<nature>com.aptana.ruby.core.rubynature</nature>
17+
</natures>
18+
</projectDescription>

README.rdoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
== README
2+
3+
This README would normally document whatever steps are necessary to get the
4+
application up and running.
5+
6+
Things you may want to cover:
7+
8+
* Ruby version
9+
10+
* System dependencies
11+
12+
* Configuration
13+
14+
* Database creation
15+
16+
* Database initialization
17+
18+
* How to run the test suite
19+
20+
* Services (job queues, cache servers, search engines, etc.)
21+
22+
* Deployment instructions
23+
24+
* ...
25+
26+
27+
Please feel free to use a different markup language if you do not plan to run
28+
<tt>rake doc:app</tt>.

lib/react/renderer.rb

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
require 'connection_pool'
22

3-
module React
3+
#module ModuleImport
4+
# def self.import(path)
5+
# self.send(:remove_const, "Import") if self.const_defined?('Import')
6+
# imported_module = self.const_set "Import", Module.new
7+
8+
# code = File.read(path)
9+
# imported_module.module_eval(code)
10+
11+
# unless imported_module.const_defined?('EXPORTS')
12+
# raise "File at #{path} doesn't export anything, use EXPORTS"
13+
# end
14+
15+
# return imported_module::EXPORTS
16+
# end
17+
#end
18+
19+
module React
420
class Renderer
521

622
class PrerenderError < RuntimeError
@@ -27,11 +43,20 @@ def self.render(component, args={})
2743
end
2844
end
2945

46+
#def self.setup_window
47+
#var jsdom = require("jsdom");
48+
#res = ModuleImport.import('./node_modules/jsdom/lib/jsdom.js')
49+
#end
50+
3051
def self.setup_combined_js
52+
#setup_window
53+
#abort ENV.inspect
3154
<<-CODE
55+
var jsdom = require('jsdom');
56+
3257
var global = global || this;
3358
var self = self || this;
34-
var window = window || this;
59+
var window = self || this;
3560
var navigator = navigator || this;
3661
3762
var console = global.console || {};
@@ -64,7 +89,7 @@ def self.react_props(args={})
6489
end
6590

6691
def context
67-
@context ||= ExecJS.compile(self.class.combined_js)
92+
@context ||= ExecJS.compile_async(self.class.combined_js)
6893
end
6994

7095
def render(component, args={})

node_modules/jsdom/Changelog.md

Lines changed: 575 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/jsdom/LICENSE.txt

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)