@microsoft/load-themed-styles
Advanced tools
Comparing version 1.5.2 to 1.6.0
@@ -5,2 +5,14 @@ { | ||
{ | ||
"version": "1.6.0", | ||
"tag": "@microsoft/load-themed-styles_v1.6.0", | ||
"date": "Tue, 08 Aug 2017 23:10:36 GMT", | ||
"comments": { | ||
"minor": [ | ||
{ | ||
"comment": "Add option to the loadStyles funciton to load a style in async mode without setting the global execution mode to async." | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"version": "1.5.2", | ||
@@ -7,0 +19,0 @@ "tag": "@microsoft/load-themed-styles_v1.5.2", |
# Change Log - @microsoft/load-themed-styles | ||
This log was last generated on Tue, 01 Aug 2017 01:03:49 GMT and should not be manually modified. | ||
This log was last generated on Tue, 08 Aug 2017 23:10:36 GMT and should not be manually modified. | ||
## 1.6.0 | ||
Tue, 08 Aug 2017 23:10:36 GMT | ||
### Minor changes | ||
- Add option to the loadStyles funciton to load a style in async mode without setting the global execution mode to async. | ||
## 1.5.2 | ||
@@ -6,0 +13,0 @@ Tue, 01 Aug 2017 01:03:49 GMT |
@@ -22,4 +22,5 @@ export interface IThemingInstruction { | ||
* @param {string | ThemableArray} styles Themable style text to register. | ||
* @param {boolean} loadAsync When true, always load styles in async mode, irrespective of current sync mode. | ||
*/ | ||
export declare function loadStyles(styles: string | ThemableArray): void; | ||
export declare function loadStyles(styles: string | ThemableArray, loadAsync?: boolean): void; | ||
/** | ||
@@ -26,0 +27,0 @@ * Allows for customizable loadStyles logic. e.g. for server side rendering application |
@@ -63,4 +63,6 @@ /** | ||
* @param {string | ThemableArray} styles Themable style text to register. | ||
* @param {boolean} loadAsync When true, always load styles in async mode, irrespective of current sync mode. | ||
*/ | ||
function loadStyles(styles) { | ||
function loadStyles(styles, loadAsync) { | ||
if (loadAsync === void 0) { loadAsync = false; } | ||
measure(function () { | ||
@@ -72,3 +74,3 @@ var styleParts = Array.isArray(styles) ? styles : splitStyles(styles); | ||
var _a = _themeState.runState, mode = _a.mode, buffer = _a.buffer, flushTimer = _a.flushTimer; | ||
if (mode === 1 /* async */) { | ||
if (loadAsync || mode === 1 /* async */) { | ||
buffer.push(styleParts); | ||
@@ -75,0 +77,0 @@ if (!flushTimer) { |
@@ -22,4 +22,5 @@ export interface IThemingInstruction { | ||
* @param {string | ThemableArray} styles Themable style text to register. | ||
* @param {boolean} loadAsync When true, always load styles in async mode, irrespective of current sync mode. | ||
*/ | ||
export declare function loadStyles(styles: string | ThemableArray): void; | ||
export declare function loadStyles(styles: string | ThemableArray, loadAsync?: boolean): void; | ||
/** | ||
@@ -26,0 +27,0 @@ * Allows for customizable loadStyles logic. e.g. for server side rendering application |
@@ -62,4 +62,6 @@ "use strict"; | ||
* @param {string | ThemableArray} styles Themable style text to register. | ||
* @param {boolean} loadAsync When true, always load styles in async mode, irrespective of current sync mode. | ||
*/ | ||
function loadStyles(styles) { | ||
function loadStyles(styles, loadAsync) { | ||
if (loadAsync === void 0) { loadAsync = false; } | ||
measure(function () { | ||
@@ -71,3 +73,3 @@ var styleParts = Array.isArray(styles) ? styles : splitStyles(styles); | ||
var _a = _themeState.runState, mode = _a.mode, buffer = _a.buffer, flushTimer = _a.flushTimer; | ||
if (mode === 1 /* async */) { | ||
if (loadAsync || mode === 1 /* async */) { | ||
buffer.push(styleParts); | ||
@@ -74,0 +76,0 @@ if (!flushTimer) { |
@@ -7,9 +7,9 @@ { | ||
"libraries/load-themed-styles/.vscode/tasks.json": "3567ff9ad0c5fefaa86e6986603360f58e88fcbf", | ||
"libraries/load-themed-styles/CHANGELOG.json": "a5e3921e59802856ca401ce440ba5ead913780aa", | ||
"libraries/load-themed-styles/CHANGELOG.md": "c058fc846832e6c62c409366a2e847a6f9de5083", | ||
"libraries/load-themed-styles/CHANGELOG.json": "11eb598de5902c4866bab3c91ba2768759c7251d", | ||
"libraries/load-themed-styles/CHANGELOG.md": "a6b54ea531b2fe30c13b86b93157690765dddf29", | ||
"libraries/load-themed-styles/LICENSE": "0f3d654b877f682af760618b147fb6795728d9ba", | ||
"libraries/load-themed-styles/README.md": "ed0c394a7bffb55cac4c73330131b839683202f0", | ||
"libraries/load-themed-styles/gulpfile.js": "cb93beb5e7c4302a65ec8f1d98009ade6aa3bb3e", | ||
"libraries/load-themed-styles/package.json": "af312e0253f4134af4f4652d3102fca8a3c1d279", | ||
"libraries/load-themed-styles/src/index.ts": "a60831db1992ebece88519aa2df82ca874bc1582", | ||
"libraries/load-themed-styles/package.json": "e93b805995548cb144b1373a1898bc803fb245e9", | ||
"libraries/load-themed-styles/src/index.ts": "128212f5f40e21047b8cde3d5914855cdd91f44f", | ||
"libraries/load-themed-styles/src/tests/index.test.ts": "e574538d6c6bcbcc6fad30332a8a9742f5c3e81e", | ||
@@ -24,7 +24,8 @@ "libraries/load-themed-styles/tsconfig.json": "f684b3ac2d0042eba5d74e319d8f5117f7927665", | ||
"README.md": "9f80ff74e335c27097427311a011a82043727ba3", | ||
"common/changes/@microsoft/load-themed-styles/msilver-theme-slot-warning-debug-only_2017-07-28-23-44.json": "f500b4f131e7bd023ed514ea8d89080f4fc5a11d", | ||
"common/changes/@microsoft/load-themed-styles/loadStyles-async-mode_2017-08-08-21-24.json": "eb276be1a91d974e8831ad7365256e20dc134e4b", | ||
"common/changes/@microsoft/loader-load-themed-styles/ianc-adding-async-option-to-lts-loader_2017-08-08-22-32.json": "a51875ef14047dd4f177e12737cfb8b91c9269da", | ||
"common/config/rush/.npmrc": "f6a02f2d9a7ba7a7d59198f0a4eb89cc481c01a6", | ||
"common/config/rush/browser-approved-packages.json": "607bec405725280ea6adbfe4c738dfb5016b6d8c", | ||
"common/config/rush/nonbrowser-approved-packages.json": "def0b9ddd6d8bbbba6c26990d60d65e7b5f18104", | ||
"common/config/rush/npm-shrinkwrap.json": "d46daeab5a4309a735922604ff54286123dbe264", | ||
"common/config/rush/npm-shrinkwrap.json": "ee73a97f0b6eb3938fa69d998f8bff5a541eec58", | ||
"common/reviews/api/api-extractor.api.ts": "94a9224231be9976687277e310dcb13cd03e2bec", | ||
@@ -38,10 +39,11 @@ "common/reviews/api/decorators.api.ts": "da3142830231162beb36d87461e23c42c25eed83", | ||
"common/reviews/api/gulp-core-build-webpack.api.ts": "1835af88186f27d36e2543ba7e20f7fece8ac249", | ||
"common/reviews/api/gulp-core-build.api.ts": "dbb0036c603c31dced78277b4aebf8ace1baa0a8", | ||
"common/reviews/api/gulp-core-build.api.ts": "af240f278326170a6c0f07e1b83c74457407819b", | ||
"common/reviews/api/loader-load-themed-styles.api.ts": "335b0d5dd0187fefa0f25891b1aeb4d1f9e1c157", | ||
"common/reviews/api/node-core-library.api.ts": "083ac6fc738c8a01b8225d5212f207765e65514e", | ||
"common/reviews/api/node-library-build.api.ts": "cf9006707c6b17e991a3caf004d061b80f472840", | ||
"common/reviews/api/node-library-build.api.ts": "3ede19fc22a9c9c4b88447850bf687cd40cf70cf", | ||
"common/reviews/api/package-deps-hash.api.ts": "848fd5d74ef5920b51288ba15c890e953299f4ae", | ||
"common/reviews/api/rush-lib.api.ts": "ea5144cec02fc5fc8ff95e906ae754a36679ee73", | ||
"common/reviews/api/set-webpack-public-path-plugin.api.ts": "5aeb7af3cc752d3df7064c03e187cee305b1b4cd", | ||
"common/reviews/api/set-webpack-public-path-plugin.api.ts": "4c8969e0561d9bb10cb1021a7e49f1c0c0efbaa9", | ||
"common/reviews/api/test-web-library-build.api.ts": "daa3ac892a9d22a6844be649d84a739be0c16210", | ||
"common/reviews/api/web-library-build.api.ts": "b7771970d65564fa7df99c59fb8aaecfe9d07573", | ||
"common/reviews/api/web-library-build.api.ts": "b794883b1e16de9d4628a18416bc4a6da5aa218d", | ||
"common/scripts/InstallRushOnlyIfNeeded.js": "67ff1de8ea7156ae1e49c3b123820ea7d852efa5", | ||
@@ -48,0 +50,0 @@ "common/wiki-images/api-extractor-title.png": "2a13a21caa560dec94d07aec6758b112739dc0c0", |
{ | ||
"name": "@microsoft/load-themed-styles", | ||
"version": "1.5.2", | ||
"version": "1.6.0", | ||
"description": "Loads themed styles.", | ||
@@ -24,4 +24,4 @@ "license": "MIT", | ||
"gulp": "~3.9.1", | ||
"@microsoft/node-library-build": "~3.2.2" | ||
"@microsoft/node-library-build": "~3.2.3" | ||
} | ||
} |
@@ -134,4 +134,5 @@ /** | ||
* @param {string | ThemableArray} styles Themable style text to register. | ||
* @param {boolean} loadAsync When true, always load styles in async mode, irrespective of current sync mode. | ||
*/ | ||
export function loadStyles(styles: string | ThemableArray): void { | ||
export function loadStyles(styles: string | ThemableArray, loadAsync: boolean = false): void { | ||
measure(() => { | ||
@@ -147,3 +148,3 @@ const styleParts: ThemableArray = Array.isArray(styles) ? styles : splitStyles(styles); | ||
} = _themeState.runState; | ||
if (mode === Mode.async) { | ||
if (loadAsync || mode === Mode.async) { | ||
buffer.push(styleParts); | ||
@@ -150,0 +151,0 @@ if (!flushTimer) { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121440
1543