react_webpack_rails 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -0
- data/js/src/integrations/react-router.js +7 -7
- data/js/src/integrations-manager.js +8 -2
- data/js/src/version.js +1 -1
- data/js/test/integrations-manager.spec.js +6 -2
- data/lib/react_webpack_rails/version.rb +1 -1
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63660480d9bc4607d4ed78cf2f51224cabf6ffbb
|
4
|
+
data.tar.gz: 7a2c1e3d02812e344fee8d76a851de4d51f1df90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d341a43a62f93cfdcadfbb15e3ea6a871c9e6bd616d906f7518b5b9dc77553fb429fa72f53f358ca5e83bd1e4576c6d78e19b156a5f363eda815ee3abc973d26
|
7
|
+
data.tar.gz: b6f51b56c5962acb48aeaffb74fdc156cf98c876b48b0f717d49c41eca405e54f8d21cf045febebe6767c520c7e8bf9522f2c3fb497d09207bee93a18785f57f
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.3.1
|
2
|
+
* show depreciation warning only when integrations/react-router is used
|
3
|
+
* throw an error when integration is missing
|
4
|
+
|
1
5
|
## 0.3.0
|
2
6
|
* move integration with react-router to external plugin: https://github.com/netguru/rwr-react_router
|
3
7
|
* add redux integration by external plugin: https://github.com/netguru/rwr-redux
|
data/README.md
CHANGED
@@ -18,6 +18,7 @@ See [0.3-stable](https://github.com/netguru/react_webpack_rails/tree/0.3-stable)
|
|
18
18
|
### Plugins:
|
19
19
|
* [rwr-alt](https://github.com/netguru/rwr-alt) plugin that makes it possible to populate and share Alt stores between react component located in different parts of rails views.
|
20
20
|
* [rwr-redux](https://github.com/netguru/rwr-redux) allows to use redux state containers in a rails views.
|
21
|
+
* [rwr-react_router](https://github.com/netguru/rwr-react_router) react-router integration.
|
21
22
|
|
22
23
|
## Installation
|
23
24
|
|
@@ -2,13 +2,13 @@ import ReactDOM from 'react-dom';
|
|
2
2
|
|
3
3
|
function deprecationWarning() {
|
4
4
|
if (typeof console !== 'undefined' && console.warn) {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
const msg = [
|
6
|
+
'Deprecation warning - since v0.3.0: current integration with react-router was extracted and moved to external plugin.',
|
7
|
+
'Use https://github.com/netguru/rwr-react_router instead.',
|
8
|
+
];
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
console.warn(msg.join('\n'));
|
11
|
+
}
|
12
12
|
}
|
13
13
|
|
14
14
|
class ReactRouterIntegration {
|
@@ -18,10 +18,10 @@ class ReactRouterIntegration {
|
|
18
18
|
this.registerRouter = this.registerRouter.bind(this);
|
19
19
|
this.getRouter = this.getRouter.bind(this);
|
20
20
|
this.renderRouter = this.renderRouter.bind(this);
|
21
|
-
deprecationWarning();
|
22
21
|
}
|
23
22
|
|
24
23
|
registerRouter(name, route) {
|
24
|
+
deprecationWarning();
|
25
25
|
this.routers[name] = route;
|
26
26
|
}
|
27
27
|
|
@@ -10,8 +10,14 @@ class IntegrationsManager {
|
|
10
10
|
}
|
11
11
|
|
12
12
|
get(name) {
|
13
|
-
|
14
|
-
|
13
|
+
const integration = this.integrations[name];
|
14
|
+
if (integration === undefined) {
|
15
|
+
throw new Error(
|
16
|
+
`Missing '${name}' integration, register appropriate integration in react/index.js`
|
17
|
+
);
|
18
|
+
}
|
19
|
+
|
20
|
+
return integration;
|
15
21
|
}
|
16
22
|
|
17
23
|
register(name, integration) {
|
data/js/src/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default '0.3.
|
1
|
+
export default '0.3.1';
|
@@ -23,8 +23,12 @@ describe('IntegrationsManager', function () {
|
|
23
23
|
);
|
24
24
|
});
|
25
25
|
|
26
|
-
it('
|
27
|
-
|
26
|
+
it('throws an error if name is invalid', function () {
|
27
|
+
const errorMsg = (
|
28
|
+
"Missing 'invalidName' integration, register appropriate integration in react/index.js"
|
29
|
+
);
|
30
|
+
|
31
|
+
expect(() => subject.get('invalidName')).toThrow(errorMsg);
|
28
32
|
});
|
29
33
|
});
|
30
34
|
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: react_webpack_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafał Gawlik
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-03-
|
12
|
+
date: 2016-03-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|