@atlaskit/navigation-system 2.18.0 → 2.19.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlassian/navigation-system
2
2
 
3
+ ## 2.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`c506727d66d32`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c506727d66d32) -
8
+ Cleans up the `platform_fix_component_state_update_for_suspense` feature gate. There is now
9
+ improved ref handling for Suspense.
10
+
3
11
  ## 2.18.0
4
12
 
5
13
  ### Minor Changes
@@ -89,10 +89,11 @@ function TopNavStart(_ref3) {
89
89
  sideNavToggleButton = _ref3.sideNavToggleButton;
90
90
  var ref = (0, _react.useContext)(_topNavStartContext.TopNavStartAttachRef);
91
91
  var elementRef = (0, _react.useRef)(null);
92
+
93
+ // FIXME: unsafe pattern with Suspense, should use callback ref / store in state
94
+ // Should handle the underlying HTMLElement changing without a remount
92
95
  (0, _react.useEffect)(function () {
93
- if ((0, _platformFeatureFlags.fg)('platform_fix_component_state_update_for_suspense')) {
94
- ref(elementRef.current);
95
- }
96
+ ref(elementRef.current);
96
97
  }, [elementRef, ref]);
97
98
 
98
99
  // This needs the real `defaultCollapsed` state or will not SSR properly
@@ -123,7 +124,7 @@ function TopNavStart(_ref3) {
123
124
  });
124
125
  var TopNavStartInner = (0, _platformFeatureFlags.fg)('navx-full-height-sidebar') ? TopNavStartInnerFHS : TopNavStartInnerOld;
125
126
  return /*#__PURE__*/_react.default.createElement(TopNavStartInner, {
126
- ref: (0, _platformFeatureFlags.fg)('platform_fix_component_state_update_for_suspense') ? elementRef : ref,
127
+ ref: elementRef,
127
128
  testId: testId
128
129
  }, !(0, _platformFeatureFlags.fg)('navx-full-height-sidebar') && /*#__PURE__*/_react.default.createElement(_toggleButtonProvider.SideNavToggleButtonSlotProvider, {
129
130
  key: sideNavToggleButtonKey
@@ -84,10 +84,11 @@ export function TopNavStart({
84
84
  }) {
85
85
  const ref = useContext(TopNavStartAttachRef);
86
86
  const elementRef = useRef(null);
87
+
88
+ // FIXME: unsafe pattern with Suspense, should use callback ref / store in state
89
+ // Should handle the underlying HTMLElement changing without a remount
87
90
  useEffect(() => {
88
- if (fg('platform_fix_component_state_update_for_suspense')) {
89
- ref(elementRef.current);
90
- }
91
+ ref(elementRef.current);
91
92
  }, [elementRef, ref]);
92
93
 
93
94
  // This needs the real `defaultCollapsed` state or will not SSR properly
@@ -116,7 +117,7 @@ export function TopNavStart({
116
117
  });
117
118
  const TopNavStartInner = fg('navx-full-height-sidebar') ? TopNavStartInnerFHS : TopNavStartInnerOld;
118
119
  return /*#__PURE__*/React.createElement(TopNavStartInner, {
119
- ref: fg('platform_fix_component_state_update_for_suspense') ? elementRef : ref,
120
+ ref: elementRef,
120
121
  testId: testId
121
122
  }, !fg('navx-full-height-sidebar') && /*#__PURE__*/React.createElement(SideNavToggleButtonSlotProvider, {
122
123
  key: sideNavToggleButtonKey
@@ -81,10 +81,11 @@ export function TopNavStart(_ref3) {
81
81
  sideNavToggleButton = _ref3.sideNavToggleButton;
82
82
  var ref = useContext(TopNavStartAttachRef);
83
83
  var elementRef = useRef(null);
84
+
85
+ // FIXME: unsafe pattern with Suspense, should use callback ref / store in state
86
+ // Should handle the underlying HTMLElement changing without a remount
84
87
  useEffect(function () {
85
- if (fg('platform_fix_component_state_update_for_suspense')) {
86
- ref(elementRef.current);
87
- }
88
+ ref(elementRef.current);
88
89
  }, [elementRef, ref]);
89
90
 
90
91
  // This needs the real `defaultCollapsed` state or will not SSR properly
@@ -115,7 +116,7 @@ export function TopNavStart(_ref3) {
115
116
  });
116
117
  var TopNavStartInner = fg('navx-full-height-sidebar') ? TopNavStartInnerFHS : TopNavStartInnerOld;
117
118
  return /*#__PURE__*/React.createElement(TopNavStartInner, {
118
- ref: fg('platform_fix_component_state_update_for_suspense') ? elementRef : ref,
119
+ ref: elementRef,
119
120
  testId: testId
120
121
  }, !fg('navx-full-height-sidebar') && /*#__PURE__*/React.createElement(SideNavToggleButtonSlotProvider, {
121
122
  key: sideNavToggleButtonKey
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/navigation-system",
3
- "version": "2.18.0",
3
+ "version": "2.19.0",
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",
@@ -72,7 +72,7 @@
72
72
  "@atlaskit/css": "^0.14.0",
73
73
  "@atlaskit/ds-lib": "^5.1.0",
74
74
  "@atlaskit/icon": "^28.5.0",
75
- "@atlaskit/layering": "^3.0.0",
75
+ "@atlaskit/layering": "^3.1.0",
76
76
  "@atlaskit/logo": "^19.9.0",
77
77
  "@atlaskit/platform-feature-flags": "^1.1.0",
78
78
  "@atlaskit/popup": "^4.4.0",
@@ -156,9 +156,6 @@
156
156
  "platform-team25-app-icon-tiles": {
157
157
  "type": "boolean"
158
158
  },
159
- "platform_fix_component_state_update_for_suspense": {
160
- "type": "boolean"
161
- },
162
159
  "jiv-20710-fix-nav-rerender": {
163
160
  "type": "boolean"
164
161
  },