@atlaskit/react-ufo 5.4.6 → 5.4.7
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/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
7
8
|
function scheduleOnPaint(callback) {
|
|
8
9
|
var _globalThis$document;
|
|
10
|
+
// Check if we're in SSR environment
|
|
11
|
+
if ((0, _platformFeatureFlags.fg)('platform_ufo_ssr_render_profiler')) {
|
|
12
|
+
var _process;
|
|
13
|
+
var isSSR = typeof window === 'undefined' || Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__SERVER__) || typeof process !== 'undefined' && Boolean((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.REACT_SSR);
|
|
14
|
+
if (isSSR) {
|
|
15
|
+
// In SSR, execute callback immediately (no paint event exists)
|
|
16
|
+
callback();
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
9
20
|
if (((_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.visibilityState) !== 'visible') {
|
|
10
21
|
// last resort fallback
|
|
11
22
|
setTimeout(callback, 100);
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
function scheduleOnPaint(callback) {
|
|
2
3
|
var _globalThis$document;
|
|
4
|
+
// Check if we're in SSR environment
|
|
5
|
+
if (fg('platform_ufo_ssr_render_profiler')) {
|
|
6
|
+
var _process, _process$env;
|
|
7
|
+
const isSSR = typeof window === 'undefined' || Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__SERVER__) || typeof process !== 'undefined' && Boolean((_process = process) === null || _process === void 0 ? void 0 : (_process$env = _process.env) === null || _process$env === void 0 ? void 0 : _process$env.REACT_SSR);
|
|
8
|
+
if (isSSR) {
|
|
9
|
+
// In SSR, execute callback immediately (no paint event exists)
|
|
10
|
+
callback();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
3
14
|
if (((_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.visibilityState) !== 'visible') {
|
|
4
15
|
// last resort fallback
|
|
5
16
|
setTimeout(callback, 100);
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
function scheduleOnPaint(callback) {
|
|
2
3
|
var _globalThis$document;
|
|
4
|
+
// Check if we're in SSR environment
|
|
5
|
+
if (fg('platform_ufo_ssr_render_profiler')) {
|
|
6
|
+
var _process;
|
|
7
|
+
var isSSR = typeof window === 'undefined' || Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.__SERVER__) || typeof process !== 'undefined' && Boolean((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.REACT_SSR);
|
|
8
|
+
if (isSSR) {
|
|
9
|
+
// In SSR, execute callback immediately (no paint event exists)
|
|
10
|
+
callback();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
3
14
|
if (((_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.visibilityState) !== 'visible') {
|
|
4
15
|
// last resort fallback
|
|
5
16
|
setTimeout(callback, 100);
|