@atlaskit/navigation-system 7.1.1 → 7.1.2
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
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 7.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5aec10fd5955e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5aec10fd5955e) -
|
|
8
|
+
Wrap useEffect->set-state call in startTransition, to avoid potential hydration rework.
|
|
9
|
+
|
|
3
10
|
## 7.1.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -357,12 +357,23 @@ function SideNavInternal(_ref) {
|
|
|
357
357
|
|
|
358
358
|
// Sync the visibility in context (provided in `<Root>`) with the local `defaultCollapsed` prop provided to `SideNav`
|
|
359
359
|
// after SSR hydration. This should only run once, after the initial render on the client.
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
360
|
+
if ((0, _platformFeatureFlags.fg)('navx-4418-fix-effect-state-updates-in-gsn')) {
|
|
361
|
+
(0, _react.startTransition)(function () {
|
|
362
|
+
setSideNavState({
|
|
363
|
+
desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
|
|
364
|
+
mobile: 'collapsed',
|
|
365
|
+
flyout: 'closed',
|
|
366
|
+
lastTrigger: null
|
|
367
|
+
});
|
|
368
|
+
});
|
|
369
|
+
} else {
|
|
370
|
+
setSideNavState({
|
|
371
|
+
desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
|
|
372
|
+
mobile: 'collapsed',
|
|
373
|
+
flyout: 'closed',
|
|
374
|
+
lastTrigger: null
|
|
375
|
+
});
|
|
376
|
+
}
|
|
366
377
|
}, [initialDefaultCollapsed, setSideNavState, sideNavState]);
|
|
367
378
|
var handleExpand = (0, _react.useCallback)(function (_ref2) {
|
|
368
379
|
var screen = _ref2.screen,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./side-nav.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import React, { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
5
|
+
import React, { startTransition, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
import { bind } from 'bind-event-listener';
|
|
7
7
|
import { flushSync } from 'react-dom';
|
|
8
8
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -338,12 +338,23 @@ function SideNavInternal({
|
|
|
338
338
|
|
|
339
339
|
// Sync the visibility in context (provided in `<Root>`) with the local `defaultCollapsed` prop provided to `SideNav`
|
|
340
340
|
// after SSR hydration. This should only run once, after the initial render on the client.
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
341
|
+
if (fg('navx-4418-fix-effect-state-updates-in-gsn')) {
|
|
342
|
+
startTransition(() => {
|
|
343
|
+
setSideNavState({
|
|
344
|
+
desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
|
|
345
|
+
mobile: 'collapsed',
|
|
346
|
+
flyout: 'closed',
|
|
347
|
+
lastTrigger: null
|
|
348
|
+
});
|
|
349
|
+
});
|
|
350
|
+
} else {
|
|
351
|
+
setSideNavState({
|
|
352
|
+
desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
|
|
353
|
+
mobile: 'collapsed',
|
|
354
|
+
flyout: 'closed',
|
|
355
|
+
lastTrigger: null
|
|
356
|
+
});
|
|
357
|
+
}
|
|
347
358
|
}, [initialDefaultCollapsed, setSideNavState, sideNavState]);
|
|
348
359
|
const handleExpand = useCallback(({
|
|
349
360
|
screen,
|
|
@@ -6,7 +6,7 @@ import "./side-nav.compiled.css";
|
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
-
import React, { useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
+
import React, { startTransition, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
10
10
|
import { bind } from 'bind-event-listener';
|
|
11
11
|
import { flushSync } from 'react-dom';
|
|
12
12
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
@@ -347,12 +347,23 @@ function SideNavInternal(_ref) {
|
|
|
347
347
|
|
|
348
348
|
// Sync the visibility in context (provided in `<Root>`) with the local `defaultCollapsed` prop provided to `SideNav`
|
|
349
349
|
// after SSR hydration. This should only run once, after the initial render on the client.
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
350
|
+
if (fg('navx-4418-fix-effect-state-updates-in-gsn')) {
|
|
351
|
+
startTransition(function () {
|
|
352
|
+
setSideNavState({
|
|
353
|
+
desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
|
|
354
|
+
mobile: 'collapsed',
|
|
355
|
+
flyout: 'closed',
|
|
356
|
+
lastTrigger: null
|
|
357
|
+
});
|
|
358
|
+
});
|
|
359
|
+
} else {
|
|
360
|
+
setSideNavState({
|
|
361
|
+
desktop: initialDefaultCollapsed ? 'collapsed' : 'expanded',
|
|
362
|
+
mobile: 'collapsed',
|
|
363
|
+
flyout: 'closed',
|
|
364
|
+
lastTrigger: null
|
|
365
|
+
});
|
|
366
|
+
}
|
|
356
367
|
}, [initialDefaultCollapsed, setSideNavState, sideNavState]);
|
|
357
368
|
var handleExpand = useCallback(function (_ref2) {
|
|
358
369
|
var screen = _ref2.screen,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.2",
|
|
4
4
|
"description": "The latest navigation system for Atlassian apps.",
|
|
5
5
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
6
6
|
"author": "Atlassian Pty Ltd",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"@atlaskit/page-layout": "^4.2.0",
|
|
110
110
|
"@atlaskit/popper": "^7.1.0",
|
|
111
111
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
112
|
-
"@atlaskit/select": "^21.
|
|
112
|
+
"@atlaskit/select": "^21.9.0",
|
|
113
113
|
"@atlaskit/skeleton": "^2.1.0",
|
|
114
114
|
"@atlaskit/textfield": "^8.2.0",
|
|
115
115
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
@@ -174,6 +174,9 @@
|
|
|
174
174
|
},
|
|
175
175
|
"platform_dst_nav4_flyout_menu_slots_close_button": {
|
|
176
176
|
"type": "boolean"
|
|
177
|
+
},
|
|
178
|
+
"navx-4418-fix-effect-state-updates-in-gsn": {
|
|
179
|
+
"type": "boolean"
|
|
177
180
|
}
|
|
178
181
|
},
|
|
179
182
|
"homepage": "https://atlassian.design/components/navigation-system"
|