You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+41-9
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Hyperloop JS
1
+
# Ruby Hyperloop
2
2
3
3
### Hyperloop.js
4
4
@@ -57,17 +57,39 @@ See all the installation options on http://ruby-hyperloop.io/
57
57
58
58
## How to use
59
59
60
+
### Hyperloop Components, Operations, Stores, and Router
61
+
60
62
The simplest way to install is with NPM.
61
63
62
64
```
63
-
npm install hyperloop-js --save
65
+
npm install ruby-hyperloop --save
64
66
```
65
67
66
-
TODO: requires and how they work....
68
+
Then include the libraries in your Webpack script:
69
+
70
+
```javascript
71
+
// following needed before hyperloop-js
72
+
ReactDOM =require('react-dom');
73
+
React =require('react');
74
+
createReactClass =require('create-react-class');
75
+
76
+
// following needed before hyper-router (if you are using ReactRouter)
77
+
ReactRouter =require('react-router');
78
+
ReactRouterDOM =require('react-router-dom');
79
+
History=require('history');
67
80
68
-
### Hyperloop-JS
81
+
// Jquery and Opal
82
+
$ =require("jquery");
83
+
require('ruby-hyperloop/opal');
84
+
85
+
// Hyperloop Components, Stores and Operations
86
+
require('ruby-hyperloop/hyperloop');
87
+
88
+
// Hyper-router if you are using ReactRouter
89
+
require('ruby-hyperloop/hyper-router');
90
+
```
69
91
70
-
Add the following to your HTML page:
92
+
If you are not using NPM/Webpack then you will need to bring in Hyperloop-JS in your HTML page:
71
93
72
94
```html
73
95
<head>
@@ -87,13 +109,21 @@ Add the following to your HTML page:
87
109
</head>
88
110
```
89
111
90
-
That is all you need for Hyperloop Components, Stores, Operations and Router client-side. If you have a back-end building Hyperloop code you are good to go.
112
+
**That is all you need for Hyperloop Components, Stores, Operations and Router client-side. If you have a back-end building Hyperloop code you are good to go!**
91
113
92
-
If you want to do in browser compiling then follow the next step.
114
+
### Hyperloop Compiler
93
115
94
-
### Hyperloop-compiler
116
+
If you do not have a back-end and you want to compile your Hyperloop code in your browser then follow this step.
95
117
96
-
Complete the Hyperloop-JS step above then add the following to your HTML page:
118
+
#### Setup
119
+
120
+
After completing the steps above, add the following to your Webpack script:
121
+
122
+
```javascript
123
+
require('ruby-hyperloop/hyperloop-compiler');
124
+
```
125
+
126
+
Or add the following to your HTML page:
97
127
98
128
```html
99
129
<head>
@@ -102,6 +132,8 @@ Complete the Hyperloop-JS step above then add the following to your HTML page:
102
132
</head>
103
133
```
104
134
135
+
#### Usage
136
+
105
137
Specify your ruby code inside script tags or link to your ruby code using the src attribute `<script type="text/ruby" src=.../>`
0 commit comments