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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7b168e4c9e7963d9286b677dfda26cb75faf04f
4
- data.tar.gz: e7c801d0011fc8a2a4ae35dbf1b35af41b4ab4de
3
+ metadata.gz: 63660480d9bc4607d4ed78cf2f51224cabf6ffbb
4
+ data.tar.gz: 7a2c1e3d02812e344fee8d76a851de4d51f1df90
5
5
  SHA512:
6
- metadata.gz: d89a10bb7c891f157a382fbb6c6865043ff142db3094ee6cea4ca714c990ca2af203d2ed62252677891d64683fa1ac3f57ad7644ada1eb37019a7817b21a023f
7
- data.tar.gz: 711c3ce95858e08945893afc8e13d5068cbef85bcf13b08fa65ad63da40b2f10e488c96f1b0ca5a0ebaff0a2e839b72fb210250f7f90b20be13ea3690ec9d216
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
- 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
- ]
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
- console.warn(msg.join('\n'));
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
- // handle missing one here;
14
- return this.integrations[name];
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.0';
1
+ export default '0.3.1';
@@ -23,8 +23,12 @@ describe('IntegrationsManager', function () {
23
23
  );
24
24
  });
25
25
 
26
- it('returns undefined if name is invalid', function () {
27
- expect(subject.get('invalidName')).toBe(undefined);
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
 
@@ -1,3 +1,3 @@
1
1
  module ReactWebpackRails
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-webpack-rails",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Js part of react_webpack_rails - webpack based React & Rails integration.",
5
5
  "main": "js/lib/index.js",
6
6
  "files": [
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.0
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-23 00:00:00.000000000 Z
12
+ date: 2016-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler