reactor-feature-toggle 8.2.0 → 8.3.0

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.
package/README.md CHANGED
@@ -58,7 +58,10 @@ Also, multiple `FeatureToggleProvider` are allowed, which gives more flexibility
58
58
 
59
59
  ```javascript
60
60
  import React, { Component } from 'react';
61
- import { FeatureToggleProvider, FeatureToggle } from 'reactor-feature-toggle';
61
+ // `FeatureToggleProvider` and `useFeatureToggle()` is only available on client-side
62
+ import { FeatureToggleProvider } from 'reactor-feature-toggle/client';
63
+ // `FeatureToggle` is available on both client and server sides
64
+ import { FeatureToggle } from 'reactor-feature-toggle';
62
65
 
63
66
  const AppWrapper = () => {
64
67
  const featureToggleData = {
@@ -122,6 +125,7 @@ export default AppWrapper;
122
125
  ### Using `useFeatureToggle()`
123
126
 
124
127
  ```javascript
128
+ // Make sure your parent component is wrapped with `FeatureToggleProvider` component
125
129
  import { useFeatureToggle } from 'reactor-feature-toggle';
126
130
 
127
131
  function Dashboard() {
@@ -0,0 +1 @@
1
+ export * from './feature-toggle-provider';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ // More details about `use client` directive in https://react.dev/reference/rsc/use-client
3
+ 'use client';
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ __exportStar(require("./feature-toggle-provider"), exports);
20
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";AAAA,0FAA0F;AAC1F,YAAY,CAAC;;;;;;;;;;;;;;;;AAEb,4DAA0C"}
@@ -1,6 +1,4 @@
1
1
  "use strict";
2
- // More details about `use client` directive in https://react.dev/reference/rsc/use-client
3
- 'use client';
4
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
3
  if (k2 === undefined) k2 = k;
6
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -1 +1 @@
1
- {"version":3,"file":"feature-toggle-provider.js","sourceRoot":"","sources":["../../src/feature-toggle-provider.tsx"],"names":[],"mappings":";AAAA,0FAA0F;AAC1F,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCb,4CASC;AAhDD,6CAA6E;AAC7E,iEAA+E;AAY/E,IAAM,oBAAoB,GAAG,IAAA,qBAAa,EACxC,IAAI,CACL,CAAC;AAEK,IAAM,qBAAqB,GAAG,UAAC,EAGF;QAFlC,QAAQ,cAAA,EACR,oBAAoB,0BAAA;IAEpB,IAAA,eAAO,EAAC;QACN,IAAA,4BAAG,EAAC,oBAAoB,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC3B,IAAM,KAAK,GAAG,IAAA,eAAO,EACnB,cAAM,OAAA,CAAC;QACL,IAAI,+BAAA;QACJ,OAAO,EAAE,oBAAoB;KAC9B,CAAC,EAHI,CAGJ,EACF,CAAC,oBAAoB,CAAC,CACvB,CAAC;IAEF,OAAO,CACL,8BAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACxC,QAAQ,CACqB,CACjC,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,qBAAqB,yBAoBhC;AAEF,SAAgB,gBAAgB;IAC9B,IAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,oBAAoB,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
1
+ {"version":3,"file":"feature-toggle-provider.js","sourceRoot":"","sources":["../../src/feature-toggle-provider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,4CASC;AAhDD,6CAA6E;AAC7E,iEAA+E;AAY/E,IAAM,oBAAoB,GAAG,IAAA,qBAAa,EACxC,IAAI,CACL,CAAC;AAEK,IAAM,qBAAqB,GAAG,UAAC,EAGF;QAFlC,QAAQ,cAAA,EACR,oBAAoB,0BAAA;IAEpB,IAAA,eAAO,EAAC;QACN,IAAA,4BAAG,EAAC,oBAAoB,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC3B,IAAM,KAAK,GAAG,IAAA,eAAO,EACnB,cAAM,OAAA,CAAC;QACL,IAAI,+BAAA;QACJ,OAAO,EAAE,oBAAoB;KAC9B,CAAC,EAHI,CAGJ,EACF,CAAC,oBAAoB,CAAC,CACvB,CAAC;IAEF,OAAO,CACL,8BAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACxC,QAAQ,CACqB,CACjC,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,qBAAqB,yBAoBhC;AAEF,SAAgB,gBAAgB;IAC9B,IAAM,OAAO,GAAG,IAAA,kBAAU,EAAC,oBAAoB,CAAC,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './feature-toggle-provider';
@@ -0,0 +1,6 @@
1
+ // More details about `use client` directive in https://react.dev/reference/rsc/use-client
2
+ 'use client';
3
+ "use strict";
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ var tslib_1 = require("tslib");
6
+ tslib_1.__exportStar(require("./feature-toggle-provider"), exports);
@@ -1,5 +1,3 @@
1
- // More details about `use client` directive in https://react.dev/reference/rsc/use-client
2
- 'use client';
3
1
  "use strict";
4
2
  Object.defineProperty(exports, "__esModule", { value: true });
5
3
  exports.FeatureToggleProvider = void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reactor-feature-toggle",
3
- "version": "8.2.0",
3
+ "version": "8.3.0",
4
4
  "description": "Your module to handle with feature toggles in ReactJS applications easier",
5
5
  "author": "Will Mendes <willmendesneto@gmail.com> (http://github.com/willmendesneto)",
6
6
  "keywords": [
@@ -36,6 +36,11 @@
36
36
  "types": "./dist/cjs/index.d.ts",
37
37
  "import": "./dist/esm/index.js",
38
38
  "require": "./dist/cjs/index.js"
39
+ },
40
+ "./client": {
41
+ "types": "./dist/cjs/client.d.ts",
42
+ "import": "./dist/esm/client.js",
43
+ "require": "./dist/cjs/client.js"
39
44
  }
40
45
  },
41
46
  "scripts": {
@@ -115,9 +120,9 @@
115
120
  "vitest": "^4.0.15"
116
121
  },
117
122
  "peerDependencies": {
123
+ "feature-toggle-service": "^7.0.1",
118
124
  "react": ">=18.2.0",
119
- "react-dom": ">=18.2.0",
120
- "feature-toggle-service": "^7.0.1"
125
+ "react-dom": ">=18.2.0"
121
126
  },
122
127
  "bundlesize": [
123
128
  {