Skip to content

Commit 3f3b465

Browse files
chore: remove dedicated SSR build (#6253)
BREAKING CHANGE: the dedicated build for Server Side Rendering in the `ssr` folder has been removed as the UI5 Web Components now natively support being imported in Node.js environments. You can import all components from `@ui5/webcomponents-react`.
1 parent ee2785c commit 3f3b465

File tree

140 files changed

+141
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+141
-362
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ packages/cli/dist
1010

1111
# build results for main package
1212
packages/main/dist
13-
packages/main/ssr
1413
packages/main/wrappers
1514

1615
# i18n defaults

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"start:watcher": "lerna run watch:css",
1111
"start:storybook": "storybook dev -p 6006",
1212
"setup": "lerna run build:i18n && lerna run build:css && lerna run build:css-bundle && rimraf node_modules/@types/mocha",
13-
"build": "yarn setup && tsc --build tsconfig.build.json && lerna run build:client && lerna run build:wrapper && lerna run build:ssr",
13+
"build": "yarn setup && tsc --build tsconfig.build.json && lerna run build:client && lerna run build:wrapper",
1414
"build:storybook": "lerna run build:i18n && yarn create-cypress-commands-docs && storybook build -o .out",
1515
"build:storybook-sitemap": "node ./scripts/create-storybook-sitemap.js --directory .out",
1616
"test:prepare": "rimraf temp && lerna run build",

packages/cli/src/scripts/create-wrappers/ComponentRenderer.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { WebComponentWrapper } from './WebComponentWrapper.js';
77
export class ComponentRenderer extends AbstractRenderer {
88
public phase = RenderingPhase.component;
99

10-
private dynamicImportPath: string | undefined;
1110
private attributes: CEM.ClassField[] = [];
1211
private slots: CEM.Slot[] = [];
1312
private events: CEM.Event[] = [];
@@ -16,11 +15,6 @@ export class ComponentRenderer extends AbstractRenderer {
1615
private isAbstract: boolean = false;
1716
private since: string | undefined;
1817

19-
setDynamicImportPath(value: string) {
20-
this.dynamicImportPath = value;
21-
return this;
22-
}
23-
2418
setAttributes(attrs: CEM.ClassField[]) {
2519
this.attributes.push(...attrs);
2620
return this;
@@ -98,8 +92,7 @@ export class ComponentRenderer extends AbstractRenderer {
9892
[${this.events
9993
?.map((event) => `'${event.name}'`)
10094
.toSorted((a, b) => a.localeCompare(b))
101-
.join(', ')}],
102-
() => import('${this.dynamicImportPath}')
95+
.join(', ')}]
10396
);
10497
10598
${context.componentName}.displayName = '${context.componentName}';

packages/cli/src/scripts/create-wrappers/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export default async function createWrappers(packageName: string, outDir: string
6363
.setAttributes(attributes)
6464
.setSlots(declaration.slots ?? [])
6565
.setEvents(declaration.events ?? [])
66-
.setDynamicImportPath(webComponentImport)
6766
.setNote(options.additionalComponentNote ?? '')
6867
.setIsAbstract(declaration._ui5abstract ?? false)
6968
.setSince(declaration._ui5since)

packages/compat/src/components/Table/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,7 @@ const Table = withWebComponent<TablePropTypes, TableDomRef>(
265265
],
266266
['busy', 'hideNoData', 'stickyColumnHeader'],
267267
['columns'],
268-
['load-more', 'popin-change', 'row-click', 'selection-change'],
269-
() => import('@ui5/webcomponents-compat/dist/Table.js')
268+
['load-more', 'popin-change', 'row-click', 'selection-change']
270269
);
271270

272271
Table.displayName = 'Table';

packages/compat/src/components/TableCell/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@ interface TableCellPropTypes extends TableCellAttributes, Omit<CommonProps, 'chi
2121
*
2222
* __Note__: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/)
2323
*/
24-
const TableCell = withWebComponent<TableCellPropTypes, TableCellDomRef>(
25-
'ui5-table-cell',
26-
[],
27-
[],
28-
[],
29-
[],
30-
() => import('@ui5/webcomponents-compat/dist/TableCell.js')
31-
);
24+
const TableCell = withWebComponent<TableCellPropTypes, TableCellDomRef>('ui5-table-cell', [], [], [], []);
3225

3326
TableCell.displayName = 'TableCell';
3427

packages/compat/src/components/TableColumn/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ const TableColumn = withWebComponent<TableColumnPropTypes, TableColumnDomRef>(
6767
['minWidth', 'popinDisplay', 'popinText'],
6868
['demandPopin'],
6969
[],
70-
[],
71-
() => import('@ui5/webcomponents-compat/dist/TableColumn.js')
70+
[]
7271
);
7372

7473
TableColumn.displayName = 'TableColumn';

packages/compat/src/components/TableGroupRow/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ const TableGroupRow = withWebComponent<TableGroupRowPropTypes, TableGroupRowDomR
3030
[],
3131
[],
3232
[],
33-
[],
34-
() => import('@ui5/webcomponents-compat/dist/TableGroupRow.js')
33+
[]
3534
);
3635

3736
TableGroupRow.displayName = 'TableGroupRow';

packages/compat/src/components/TableRow/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ const TableRow = withWebComponent<TableRowPropTypes, TableRowDomRef>(
5656
['type'],
5757
['navigated', 'selected'],
5858
[],
59-
[],
60-
() => import('@ui5/webcomponents-compat/dist/TableRow.js')
59+
[]
6160
);
6261

6362
TableRow.displayName = 'TableRow';

packages/compat/src/components/Toolbar/OverflowPopover.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import type {
99
ToggleButtonPropTypes
1010
} from '@ui5/webcomponents-react';
1111
import { Popover, ToggleButton } from '@ui5/webcomponents-react';
12-
import { useCanRenderPortal } from '@ui5/webcomponents-react/dist/internal/ssr.js';
1312
import { stopPropagation } from '@ui5/webcomponents-react/dist/internal/stopPropagation.js';
1413
import { getUi5TagWithSuffix } from '@ui5/webcomponents-react/dist/internal/utils.js';
1514
import { Device, useSyncRef } from '@ui5/webcomponents-react-base';
@@ -110,7 +109,10 @@ export const OverflowPopover: FC<OverflowPopoverProps> = (props: OverflowPopover
110109
}
111110
};
112111

113-
const canRenderPortal = useCanRenderPortal();
112+
const [canRenderPortal, setCanRenderPortal] = useState(false);
113+
useEffect(() => {
114+
setCanRenderPortal(true);
115+
}, []);
114116

115117
const accessibleRole = (() => {
116118
if (a11yConfig?.overflowPopover?.contentRole) {

packages/main/package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@
1010
".": {
1111
"types": "./dist/index.d.ts",
1212
"browser": "./dist/index.js",
13-
"node": "./ssr/index.js",
13+
"node": "./dist/index.js",
1414
"default": "./dist/index.js"
1515
},
1616
"./wrappers": {
1717
"types": "./wrappers/index.d.ts",
1818
"default": "./wrappers/index.js"
1919
},
20-
"./ssr": {
21-
"types": "./ssr/index.d.ts",
22-
"default": "./ssr/index.js"
23-
},
2420
"./package.json": "./package.json",
2521
"./styles.css": "./dist/css/index.css",
2622
"./dist": "./dist/index.js",
@@ -42,10 +38,9 @@
4238
"./dist/json-imports/*"
4339
],
4440
"scripts": {
45-
"clean": "rimraf dist tmp wrappers ssr",
41+
"clean": "rimraf dist tmp wrappers",
4642
"build:i18n": "node scripts/generateI18n.mjs",
4743
"build:client": "babel src --out-dir dist --extensions .ts,.tsx --env-name client && tsc --project tsconfig.build.json --declarationDir dist",
48-
"build:ssr": "babel src --out-dir ssr --extensions .ts,.tsx --env-name ssr && tsc --project tsconfig.build.json --declarationDir ssr",
4944
"build:wrapper": "babel src --out-dir wrappers --extensions .ts,.tsx --env-name wrapper && tsc --project tsconfig.build.json --declarationDir wrappers",
5045
"build:css": "postcss --base src --dir dist/css src/**/*.css",
5146
"build:css-bundle": "node ../../config/merge-css-modules.js",
@@ -87,7 +82,6 @@
8782
"files": [
8883
"dist",
8984
"wrappers",
90-
"ssr",
9185
"CHANGELOG.md",
9286
"LICENSE",
9387
"NOTICE.txt",

packages/main/src/internal/ssr.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/main/src/internal/withWebComponent.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { useIsomorphicLayoutEffect, useSyncRef } from '@ui5/webcomponents-react-
55
import type { ComponentType, ReactElement, ReactNode, Ref } from 'react';
66
import { cloneElement, forwardRef, Fragment, isValidElement, useEffect, useState, version } from 'react';
77
import type { CommonProps, Ui5DomRef } from '../types/index.js';
8-
import { useServerSideEffect } from './ssr.js';
98
import { camelToKebabCase, capitalizeFirstLetter, kebabToCamelCase, parseSemVer } from './utils.js';
109

1110
const createEventPropName = (eventName: string) => `on${capitalizeFirstLetter(kebabToCamelCase(eventName))}`;
@@ -32,8 +31,7 @@ export const withWebComponent = <Props extends Record<string, any>, RefType = Ui
3231
regularProperties: string[],
3332
booleanProperties: string[],
3433
slotProperties: string[],
35-
eventProperties: string[],
36-
loader: () => Promise<unknown>
34+
eventProperties: string[]
3735
) => {
3836
const webComponentsSupported = parseSemVer(version).major >= 19;
3937
// displayName will be assigned in the individual files
@@ -48,10 +46,6 @@ export const withWebComponent = <Props extends Record<string, any>, RefType = Ui
4846

4947
const [isDefined, setIsDefined] = useState(definedWebComponents.has(Component));
5048

51-
useServerSideEffect(() => {
52-
void loader();
53-
});
54-
5549
// regular props (no booleans, no slots and no events)
5650
const regularProps = regularProperties.reduce((acc, name) => {
5751
if (rest.hasOwnProperty(name) && isPrimitiveAttribute(rest[name])) {

packages/main/src/webComponents/Avatar/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ const Avatar = withWebComponent<AvatarPropTypes, AvatarDomRef>(
160160
['accessibilityAttributes', 'accessibleName', 'colorScheme', 'fallbackIcon', 'icon', 'initials', 'shape', 'size'],
161161
['disabled', 'interactive'],
162162
['badge'],
163-
[],
164-
() => import('@ui5/webcomponents/dist/Avatar.js')
163+
[]
165164
);
166165

167166
Avatar.displayName = 'Avatar';

packages/main/src/webComponents/AvatarGroup/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ const AvatarGroup = withWebComponent<AvatarGroupPropTypes, AvatarGroupDomRef>(
144144
['accessibilityAttributes', 'type'],
145145
[],
146146
['overflowButton'],
147-
['click', 'overflow'],
148-
() => import('@ui5/webcomponents/dist/AvatarGroup.js')
147+
['click', 'overflow']
149148
);
150149

151150
AvatarGroup.displayName = 'AvatarGroup';

packages/main/src/webComponents/Bar/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,7 @@ interface BarPropTypes
7373
*
7474
* __Note__: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/)
7575
*/
76-
const Bar = withWebComponent<BarPropTypes, BarDomRef>(
77-
'ui5-bar',
78-
['design'],
79-
[],
80-
['endContent', 'startContent'],
81-
[],
82-
() => import('@ui5/webcomponents/dist/Bar.js')
83-
);
76+
const Bar = withWebComponent<BarPropTypes, BarDomRef>('ui5-bar', ['design'], [], ['endContent', 'startContent'], []);
8477

8578
Bar.displayName = 'Bar';
8679

packages/main/src/webComponents/BarcodeScannerDialog/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ const BarcodeScannerDialog = withWebComponent<BarcodeScannerDialogPropTypes, Bar
5959
[],
6060
['open'],
6161
[],
62-
['close', 'scan-error', 'scan-success'],
63-
() => import('@ui5/webcomponents-fiori/dist/BarcodeScannerDialog.js')
62+
['close', 'scan-error', 'scan-success']
6463
);
6564

6665
BarcodeScannerDialog.displayName = 'BarcodeScannerDialog';

packages/main/src/webComponents/Breadcrumbs/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ const Breadcrumbs = withWebComponent<BreadcrumbsPropTypes, BreadcrumbsDomRef>(
7676
['design', 'separators'],
7777
[],
7878
[],
79-
['item-click'],
80-
() => import('@ui5/webcomponents/dist/Breadcrumbs.js')
79+
['item-click']
8180
);
8281

8382
Breadcrumbs.displayName = 'Breadcrumbs';

packages/main/src/webComponents/BreadcrumbsItem/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ const BreadcrumbsItem = withWebComponent<BreadcrumbsItemPropTypes, BreadcrumbsIt
6161
['accessibleName', 'href', 'target'],
6262
[],
6363
[],
64-
[],
65-
() => import('@ui5/webcomponents/dist/BreadcrumbsItem.js')
64+
[]
6665
);
6766

6867
BreadcrumbsItem.displayName = 'BreadcrumbsItem';

packages/main/src/webComponents/BusyIndicator/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ const BusyIndicator = withWebComponent<BusyIndicatorPropTypes, BusyIndicatorDomR
8484
['delay', 'size', 'text', 'textPlacement'],
8585
['active'],
8686
[],
87-
[],
88-
() => import('@ui5/webcomponents/dist/BusyIndicator.js')
87+
[]
8988
);
9089

9190
BusyIndicator.displayName = 'BusyIndicator';

packages/main/src/webComponents/Button/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ const Button = withWebComponent<ButtonPropTypes, ButtonDomRef>(
177177
],
178178
['disabled', 'submits'],
179179
[],
180-
['click'],
181-
() => import('@ui5/webcomponents/dist/Button.js')
180+
['click']
182181
);
183182

184183
Button.displayName = 'Button';

packages/main/src/webComponents/Calendar/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ const Calendar = withWebComponent<CalendarPropTypes, CalendarDomRef>(
206206
['formatPattern', 'maxDate', 'minDate', 'primaryCalendarType', 'secondaryCalendarType', 'selectionMode'],
207207
['hideWeekNumbers'],
208208
['calendarLegend', 'specialDates'],
209-
['selection-change'],
210-
() => import('@ui5/webcomponents/dist/Calendar.js')
209+
['selection-change']
211210
);
212211

213212
Calendar.displayName = 'Calendar';

packages/main/src/webComponents/CalendarDate/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,7 @@ interface CalendarDatePropTypes extends CalendarDateAttributes, Omit<CommonProps
2222
* __Note__: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/)
2323
* @abstract
2424
*/
25-
const CalendarDate = withWebComponent<CalendarDatePropTypes, CalendarDateDomRef>(
26-
'ui5-date',
27-
['value'],
28-
[],
29-
[],
30-
[],
31-
() => import('@ui5/webcomponents/dist/CalendarDate.js')
32-
);
25+
const CalendarDate = withWebComponent<CalendarDatePropTypes, CalendarDateDomRef>('ui5-date', ['value'], [], [], []);
3326

3427
CalendarDate.displayName = 'CalendarDate';
3528

packages/main/src/webComponents/CalendarDateRange/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ const CalendarDateRange = withWebComponent<CalendarDateRangePropTypes, CalendarD
3737
['endValue', 'startValue'],
3838
[],
3939
[],
40-
[],
41-
() => import('@ui5/webcomponents/dist/CalendarDateRange.js')
40+
[]
4241
);
4342

4443
CalendarDateRange.displayName = 'CalendarDateRange';

packages/main/src/webComponents/CalendarLegend/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ const CalendarLegend = withWebComponent<CalendarLegendPropTypes, CalendarLegendD
5858
[],
5959
['hideNonWorkingDay', 'hideSelectedDay', 'hideToday', 'hideWorkingDay'],
6060
[],
61-
[],
62-
() => import('@ui5/webcomponents/dist/CalendarLegend.js')
61+
[]
6362
);
6463

6564
CalendarLegend.displayName = 'CalendarLegend';

packages/main/src/webComponents/CalendarLegendItem/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ const CalendarLegendItem = withWebComponent<CalendarLegendItemPropTypes, Calenda
4545
['text', 'type'],
4646
[],
4747
[],
48-
[],
49-
() => import('@ui5/webcomponents/dist/CalendarLegendItem.js')
48+
[]
5049
);
5150

5251
CalendarLegendItem.displayName = 'CalendarLegendItem';

packages/main/src/webComponents/Card/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ const Card = withWebComponent<CardPropTypes, CardDomRef>(
7878
['accessibleName', 'accessibleNameRef', 'loadingDelay'],
7979
['loading'],
8080
['header'],
81-
[],
82-
() => import('@ui5/webcomponents/dist/Card.js')
81+
[]
8382
);
8483

8584
Card.displayName = 'Card';

packages/main/src/webComponents/CardHeader/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ const CardHeader = withWebComponent<CardHeaderPropTypes, CardHeaderDomRef>(
8282
['additionalText', 'subtitleText', 'titleText'],
8383
['interactive'],
8484
['action', 'avatar'],
85-
['click'],
86-
() => import('@ui5/webcomponents/dist/CardHeader.js')
85+
['click']
8786
);
8887

8988
CardHeader.displayName = 'CardHeader';

packages/main/src/webComponents/Carousel/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ const Carousel = withWebComponent<CarouselPropTypes, CarouselDomRef>(
194194
],
195195
['cyclic', 'hideNavigationArrows', 'hidePageIndicator'],
196196
[],
197-
['navigate'],
198-
() => import('@ui5/webcomponents/dist/Carousel.js')
197+
['navigate']
199198
);
200199

201200
Carousel.displayName = 'Carousel';

packages/main/src/webComponents/CheckBox/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ const CheckBox = withWebComponent<CheckBoxPropTypes, CheckBoxDomRef>(
163163
['accessibleName', 'accessibleNameRef', 'name', 'text', 'valueState', 'wrappingType'],
164164
['checked', 'disabled', 'displayOnly', 'indeterminate', 'readonly', 'required'],
165165
[],
166-
['change'],
167-
() => import('@ui5/webcomponents/dist/CheckBox.js')
166+
['change']
168167
);
169168

170169
CheckBox.displayName = 'CheckBox';

0 commit comments

Comments
 (0)