launchdarkly-react-client-sdk
Advanced tools
Comparing version 2.23.2 to 2.23.3
@@ -5,2 +5,6 @@ # Change log | ||
## [2.23.2] - 2021-10-06 | ||
### Changed: | ||
- Improved `withLDProvider` so that prop types can be provided (thanks, [dsifford](https://github.com/launchdarkly/react-client-sdk/pull/97)!) | ||
## [2.23.1] - 2021-09-03 | ||
@@ -7,0 +11,0 @@ ### Fixed: |
import React from 'react'; | ||
import { ProviderConfig } from './types'; | ||
import { AsyncProviderConfig } from './types'; | ||
/** | ||
@@ -16,2 +16,7 @@ * This is an async function which initializes LaunchDarkly's JS SDK (`launchdarkly-js-client-sdk`) | ||
* `asyncWithLDProvider` accepts a config object which is used to initialize `launchdarkly-js-client-sdk`. | ||
* | ||
* `asyncWithLDProvider` does not support the `deferInitialization` config option because `asyncWithLDProvider` needs | ||
* to be initialized at the entry point prior to render to ensure your flags and the ldClient are ready at the beginning | ||
* of your app. | ||
* | ||
* It returns a provider which is a React FunctionComponent which: | ||
@@ -23,2 +28,2 @@ * - saves all flags and the ldClient instance in the context API | ||
*/ | ||
export default function asyncWithLDProvider(config: ProviderConfig): Promise<React.FunctionComponent<{}>>; | ||
export default function asyncWithLDProvider(config: AsyncProviderConfig): Promise<React.FunctionComponent<{}>>; |
@@ -13,2 +13,21 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -50,9 +69,2 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -80,2 +92,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
* `asyncWithLDProvider` accepts a config object which is used to initialize `launchdarkly-js-client-sdk`. | ||
* | ||
* `asyncWithLDProvider` does not support the `deferInitialization` config option because `asyncWithLDProvider` needs | ||
* to be initialized at the entry point prior to render to ensure your flags and the ldClient are ready at the beginning | ||
* of your app. | ||
* | ||
* It returns a provider which is a React FunctionComponent which: | ||
@@ -82,0 +99,0 @@ * - saves all flags and the ldClient instance in the context API |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Consumer = exports.Provider = void 0; | ||
var react_1 = require("react"); | ||
@@ -4,0 +5,0 @@ /** |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.camelCaseKeys = exports.asyncWithLDProvider = exports.useLDClient = exports.useFlags = exports.withLDConsumer = exports.withLDProvider = exports.LDProvider = void 0; | ||
var provider_1 = __importDefault(require("./provider")); | ||
@@ -20,3 +21,3 @@ exports.LDProvider = provider_1.default; | ||
var utils_1 = require("./utils"); | ||
exports.camelCaseKeys = utils_1.camelCaseKeys; | ||
Object.defineProperty(exports, "camelCaseKeys", { enumerable: true, get: function () { return utils_1.camelCaseKeys; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -26,2 +26,21 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -63,9 +82,2 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
}; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -72,0 +84,0 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; |
@@ -69,2 +69,10 @@ import { LDClient, LDFlagSet, LDOptions, LDUser } from 'launchdarkly-js-client-sdk'; | ||
} | ||
export declare type AsyncProviderConfig = Omit<ProviderConfig, 'deferInitialization'> & { | ||
/** | ||
* @deprecated - `asyncWithLDProvider` does not support the `deferInitialization` config option because | ||
* `asyncWithLDProvider` needs to be initialized at the app entry point prior to render to ensure flags and the | ||
* ldClient are ready at the beginning of the app. | ||
*/ | ||
deferInitialization?: boolean; | ||
}; | ||
/** | ||
@@ -71,0 +79,0 @@ * The return type of withLDProvider HOC. Exported for testing purposes only. |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.defaultReactOptions = void 0; | ||
/** | ||
@@ -4,0 +5,0 @@ * Contains default values for the `reactOptions` object. |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fetchFlags = exports.getFlattenedFlagsFromChangeset = exports.camelCaseKeys = void 0; | ||
var lodash_camelcase_1 = __importDefault(require("lodash.camelcase")); | ||
@@ -8,0 +9,0 @@ var types_1 = require("./types"); |
@@ -13,7 +13,19 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
@@ -20,0 +32,0 @@ }; |
@@ -26,7 +26,19 @@ "use strict"; | ||
}; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
@@ -38,2 +50,3 @@ }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.withLDProvider = void 0; | ||
var React = __importStar(require("react")); | ||
@@ -40,0 +53,0 @@ var types_1 = require("./types"); |
{ | ||
"name": "launchdarkly-react-client-sdk", | ||
"version": "2.23.2", | ||
"version": "2.23.3", | ||
"description": "LaunchDarkly SDK for React", | ||
@@ -17,2 +17,8 @@ "author": "LaunchDarkly <team@launchdarkly.com>", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
"lib", | ||
"src", | ||
"!**/*.test.*", | ||
"!**/__snapshots__" | ||
], | ||
"scripts": { | ||
@@ -60,3 +66,3 @@ "test": "jest", | ||
"tslint-plugin-prettier": "^2.0.1", | ||
"typescript": "~3.8.3" | ||
"typescript": "^3.8.3" | ||
}, | ||
@@ -63,0 +69,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
107776
48
1616