Skip to content

Commit 1dbd860

Browse files
committed
Updates dependencies & replaces FAST React w/ Lit
1 parent 2ec8e6c commit 1dbd860

File tree

12 files changed

+187
-174
lines changed

12 files changed

+187
-174
lines changed

ThirdPartyNotices.txt

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ GitLens
33
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
44
This project incorporates components from the projects listed below.
55

6-
1. @microsoft/fast-element version 1.12.0 (https://github.com/Microsoft/fast)
7-
2. @microsoft/fast-react-wrapper version 0.3.19 (https://github.com/Microsoft/fast)
6+
1. @lit/react version 1.0.0 (https://github.com/lit/lit)
7+
2. @microsoft/fast-element version 1.12.0 (https://github.com/Microsoft/fast)
88
3. @octokit/graphql version 7.0.2 (https://github.com/octokit/graphql.js)
99
4. @octokit/request version 8.1.4 (https://github.com/octokit/request.js)
1010
5. @opentelemetry/api version 1.6.0 (https://github.com/open-telemetry/opentelemetry-js)
@@ -16,7 +16,7 @@ This project incorporates components from the projects listed below.
1616
11. billboard.js version 3.9.4 (https://github.com/naver/billboard.js)
1717
12. https-proxy-agent version 5.0.1 (https://github.com/TooTallNate/node-https-proxy-agent)
1818
13. iconv-lite version 0.6.3 (https://github.com/ashtuchkin/iconv-lite)
19-
14. lit version 2.8.0 (https://github.com/lit/lit)
19+
14. lit version 3.0.0 (https://github.com/lit/lit)
2020
15. microsoft/vscode (https://github.com/microsoft/vscode)
2121
16. node-fetch version 2.7.0 (https://github.com/bitinn/node-fetch)
2222
17. os-browserify version 0.3.0 (https://github.com/CoderPuppy/os-browserify)
@@ -27,6 +27,39 @@ This project incorporates components from the projects listed below.
2727
22. sindresorhus/string-width (https://github.com/sindresorhus/string-width)
2828
23. sortablejs version 1.15.0 (https://github.com/SortableJS/Sortable)
2929

30+
%% @lit/react NOTICES AND INFORMATION BEGIN HERE
31+
=========================================
32+
BSD 3-Clause License
33+
34+
Copyright (c) 2017 Google LLC. All rights reserved.
35+
36+
Redistribution and use in source and binary forms, with or without
37+
modification, are permitted provided that the following conditions are met:
38+
39+
1. Redistributions of source code must retain the above copyright notice, this
40+
list of conditions and the following disclaimer.
41+
42+
2. Redistributions in binary form must reproduce the above copyright notice,
43+
this list of conditions and the following disclaimer in the documentation
44+
and/or other materials provided with the distribution.
45+
46+
3. Neither the name of the copyright holder nor the names of its
47+
contributors may be used to endorse or promote products derived from
48+
this software without specific prior written permission.
49+
50+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
51+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
53+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
54+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
56+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
57+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
58+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
59+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
60+
=========================================
61+
END OF @lit/react NOTICES AND INFORMATION
62+
3063
%% @microsoft/fast-element NOTICES AND INFORMATION BEGIN HERE
3164
=========================================
3265
# FAST Element
@@ -94,44 +127,6 @@ Looking for a quick guide on building components? Check out [our Cheat Sheet](.
94127
=========================================
95128
END OF @microsoft/fast-element NOTICES AND INFORMATION
96129

97-
%% @microsoft/fast-react-wrapper NOTICES AND INFORMATION BEGIN HERE
98-
=========================================
99-
# FAST React Wrapper
100-
101-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
102-
[![npm version](https://badge.fury.io/js/%40microsoft%2Ffast-react-wrapper.svg)](https://badge.fury.io/js/%40microsoft%2Ffast-react-wrapper)
103-
104-
The `fast-react-wrapper` package contains a utility that enables automatically wrapping Web Components in a React component for ease of integration into React projects.
105-
106-
## Installation
107-
108-
### From NPM
109-
110-
To install the `fast-react-wrapper` library, use either `npm` or `yarn` as follows:
111-
112-
```shell
113-
npm install --save @microsoft/fast-react-wrapper
114-
```
115-
116-
```shell
117-
yarn add @microsoft/fast-react-wrapper
118-
```
119-
120-
Within your JavaScript or TypeScript code, you can then and use the wrapper like this:
121-
122-
```ts
123-
import React from 'react';
124-
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
125-
126-
const { wrap } = provideReactWrapper(React);
127-
128-
const MyComponent = wrap(MyComponent);
129-
```
130-
131-
For additional wrapper settings and more information on integrating with Design Systems, see [our integration docs](https://fast.design/docs/integrations/react).
132-
=========================================
133-
END OF @microsoft/fast-react-wrapper NOTICES AND INFORMATION
134-
135130
%% @octokit/graphql NOTICES AND INFORMATION BEGIN HERE
136131
=========================================
137132
The MIT License

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14845,8 +14845,8 @@
1484514845
"dependencies": {
1484614846
"@gitkraken/gitkraken-components": "10.1.30",
1484714847
"@gitkraken/shared-web-components": "0.1.1-rc.15",
14848+
"@lit/react": "1.0.0",
1484814849
"@microsoft/fast-element": "1.12.0",
14849-
"@microsoft/fast-react-wrapper": "0.3.19",
1485014850
"@octokit/graphql": "7.0.2",
1485114851
"@octokit/request": "8.1.4",
1485214852
"@opentelemetry/api": "1.6.0",
@@ -14869,14 +14869,14 @@
1486914869
"devDependencies": {
1487014870
"@types/mocha": "10.0.1",
1487114871
"@types/node": "16.11.47",
14872-
"@types/react": "17.0.67",
14872+
"@types/react": "17.0.68",
1487314873
"@types/react-dom": "17.0.21",
1487414874
"@types/sortablejs": "1.15.3",
1487514875
"@types/vscode": "1.80.0",
1487614876
"@typescript-eslint/eslint-plugin": "6.7.5",
1487714877
"@typescript-eslint/parser": "6.7.5",
1487814878
"@vscode/test-electron": "2.3.5",
14879-
"@vscode/test-web": "0.0.46",
14879+
"@vscode/test-web": "0.0.47",
1488014880
"@vscode/vsce": "2.21.1",
1488114881
"circular-dependency-plugin": "5.2.2",
1488214882
"clean-webpack-plugin": "4.0.0",
@@ -14903,12 +14903,12 @@
1490314903
"html-loader": "4.2.0",
1490414904
"html-webpack-plugin": "5.5.3",
1490514905
"image-minimizer-webpack-plugin": "3.8.3",
14906-
"license-checker-rseidelsohn": "4.2.8",
14906+
"license-checker-rseidelsohn": "4.2.10",
1490714907
"lz-string": "1.5.0",
1490814908
"mini-css-extract-plugin": "2.7.6",
1490914909
"mocha": "10.2.0",
1491014910
"prettier": "3.0.3",
14911-
"sass": "1.69.1",
14911+
"sass": "1.69.3",
1491214912
"sass-loader": "13.3.2",
1491314913
"schema-utils": "4.2.0",
1491414914
"sharp": "0.32.6",
@@ -14917,7 +14917,7 @@
1491714917
"ts-loader": "9.5.0",
1491814918
"tsc-alias": "1.8.8",
1491914919
"typescript": "5.3.0-beta",
14920-
"webpack": "5.88.2",
14920+
"webpack": "5.89.0",
1492114921
"webpack-bundle-analyzer": "4.9.1",
1492214922
"webpack-cli": "5.1.4",
1492314923
"webpack-node-externals": "3.0.0",

src/webviews/apps/plus/graph/GraphWrapper.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,8 @@ export function GraphWrapper({
12311231
errorMessage={searchResultsError?.error ?? ''}
12321232
resultsHidden={searchResultsHidden}
12331233
resultsLoaded={searchResults != null}
1234-
onChange={e => handleSearchInput(e as CustomEvent<SearchQuery>)}
1235-
onNavigate={e => handleSearchNavigation(e as CustomEvent<SearchNavigationEventDetail>)}
1234+
onChange={e => handleSearchInput(e)}
1235+
onNavigate={e => handleSearchNavigation(e)}
12361236
onOpenInView={() => handleSearchOpenInView()}
12371237
/>
12381238
<span>
@@ -1369,7 +1369,7 @@ export function GraphWrapper({
13691369
markers={minimapData?.markers}
13701370
searchResults={minimapSearchResults}
13711371
visibleDays={visibleDays}
1372-
onSelected={e => handleOnMinimapDaySelected(e as CustomEvent<GraphMinimapDaySelectedEventDetail>)}
1372+
onSelected={e => handleOnMinimapDaySelected(e)}
13731373
></GraphMinimap>
13741374
)}
13751375
<main id="main" className="graph-app__main" aria-hidden={!allowed}>
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import type { EventName } from '@lit/react';
12
import { reactWrapper } from '../../../shared/components/helpers/react-wrapper';
3+
import type { GraphMinimapDaySelectedEventDetail } from './minimap';
24
import { GraphMinimap as graphMinimapComponent } from './minimap';
35

46
export const GraphMinimap = reactWrapper(graphMinimapComponent, {
7+
tagName: 'graph-minimap',
58
events: {
6-
onSelected: 'selected',
9+
onSelected: 'selected' as EventName<CustomEvent<GraphMinimapDaySelectedEventDetail>>,
710
},
811
});
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
1+
/* eslint-disable @typescript-eslint/ban-types */
2+
import type { EventName, Options } from '@lit/react';
3+
import { createComponent } from '@lit/react';
24
import React from 'react';
35

4-
const { wrap } = provideReactWrapper(React);
6+
type Constructor<T> = new () => T;
7+
type EventNames = Record<string, EventName | string>;
8+
type Opts<I extends HTMLElement, E extends EventNames = {}> = Omit<Options<I, E>, 'elementClass' | 'react'>;
59

6-
export { wrap as reactWrapper };
10+
export function reactWrapper<I extends HTMLElement, E extends EventNames = {}>(
11+
elementClass: Constructor<I>,
12+
options: Opts<I, E>,
13+
) {
14+
return createComponent<I, E>({
15+
...options,
16+
elementClass: elementClass,
17+
react: React,
18+
});
19+
}

src/webviews/apps/shared/components/menu/react.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
MenuList as MenuListComponent,
77
} from './index';
88

9-
export const MenuDivider = reactWrapper(MenuDividerComponent);
10-
export const MenuItem = reactWrapper(MenuItemComponent);
11-
export const MenuLabel = reactWrapper(MenuLabelComponent);
12-
export const MenuList = reactWrapper(MenuListComponent);
9+
export const MenuDivider = reactWrapper(MenuDividerComponent, { tagName: 'menu-divider' });
10+
export const MenuItem = reactWrapper(MenuItemComponent, { tagName: 'menu-item' });
11+
export const MenuLabel = reactWrapper(MenuLabelComponent, { tagName: 'menu-label' });
12+
export const MenuList = reactWrapper(MenuListComponent, { tagName: 'menu-list' });
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { reactWrapper } from '../../helpers/react-wrapper';
22
import { PopMenu as PopMenuComponent } from './index';
33

4-
export const PopMenu = reactWrapper(PopMenuComponent);
4+
export const PopMenu = reactWrapper(PopMenuComponent, { tagName: 'pop-menu' });
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import { reactWrapper } from '../helpers/react-wrapper';
22
import { PopOver as PopOverComponent } from './pop-over';
33

4-
export const PopOver = reactWrapper(PopOverComponent);
4+
export const PopOver = reactWrapper(PopOverComponent, { tagName: 'pop-over' });
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import { FeatureGateBadge as featureGateBadgeComponent } from '../feature-gate-badge';
22
import { reactWrapper } from '../helpers/react-wrapper';
33

4-
export const FeatureGateBadge = reactWrapper(featureGateBadgeComponent, {
5-
name: 'gk-feature-gate-badge',
6-
properties: ['placement', 'subscription'],
7-
});
4+
export const FeatureGateBadge = reactWrapper(featureGateBadgeComponent, { tagName: 'gk-feature-gate-badge' });
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import { FeatureGate as featureGateComponent } from '../feature-gate';
22
import { reactWrapper } from '../helpers/react-wrapper';
33

4-
export const FeatureGate = reactWrapper(featureGateComponent, {
5-
name: 'gk-feature-gate',
6-
properties: ['state', 'visible'],
7-
});
4+
export const FeatureGate = reactWrapper(featureGateComponent, { tagName: 'gk-feature-gate' });

0 commit comments

Comments
 (0)