Skip to content

Commit 904573c

Browse files
committed
Mark 16.8.6 as baseline
1 parent 525f41c commit 904573c

31 files changed

Lines changed: 189 additions & 258 deletions

__tests__/html2/simple/fatModule/esm.sh/fluentTheme.html

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"botframework-webchat/decorator": "/__dist__/packages/bundle/static/botframework-webchat/decorator.js",
2323
"botframework-webchat/internal": "/__dist__/packages/bundle/static/botframework-webchat/internal.js",
2424
"botframework-webchat-fluent-theme": "/__dist__/packages/fluent-theme/static/botframework-webchat-fluent-theme.js",
25-
"jest-mock": "https://esm.sh/jest-mock",
2625
"react": "https://esm.sh/react@18",
2726
"react-dom": "https://esm.sh/react-dom@18",
2827
"react-dom/": "https://esm.sh/react-dom@18/"
@@ -33,30 +32,9 @@
3332
import { FluentProvider, webLightTheme } from '@fluentui/react-components';
3433
import { createDirectLine, createStoreWithOptions, hooks, ReactWebChat } from 'botframework-webchat';
3534
import { FluentThemeProvider } from 'botframework-webchat-fluent-theme';
36-
import { fn, spyOn } from 'jest-mock';
3735
import { createElement } from 'react';
3836
import { createRoot } from 'react-dom/client';
3937

40-
const consoleError = console.error.bind(console);
41-
42-
spyOn(console, 'error').mockImplementation((...args) => {
43-
const [message] = args;
44-
45-
if (
46-
!(
47-
typeof message === 'string' &&
48-
(message.includes(
49-
'Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.'
50-
) ||
51-
// TODO: [P0] We should fix the "Cannot update a component while rendering a different component" error.
52-
(message.includes('Cannot update a component') &&
53-
message.includes('while rendering a different component')))
54-
)
55-
) {
56-
consoleError(...args);
57-
}
58-
});
59-
6038
const {
6139
testHelpers: { createDirectLineEmulator }
6240
} = window;

__tests__/html2/simple/fatModule/esm.sh/tsx/fluentTheme.html

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"botframework-webchat/decorator": "/__dist__/packages/bundle/static/botframework-webchat/decorator.js",
2323
"botframework-webchat/internal": "/__dist__/packages/bundle/static/botframework-webchat/internal.js",
2424
"botframework-webchat-fluent-theme": "/__dist__/packages/fluent-theme/static/botframework-webchat-fluent-theme.js",
25-
"jest-mock": "https://esm.sh/jest-mock",
2625
"react": "https://esm.sh/react@18",
2726
"react-dom": "https://esm.sh/react-dom@18",
2827
"react-dom/": "https://esm.sh/react-dom@18/"
@@ -31,32 +30,11 @@
3130
</script>
3231
<script src="https://esm.sh/tsx" type="module"></script>
3332
<script type="text/babel">
34-
import { fn, spyOn } from 'jest-mock';
3533
import { FluentProvider, webLightTheme } from '@fluentui/react-components';
3634
import { createDirectLine, createStoreWithOptions, hooks, ReactWebChat } from 'botframework-webchat';
3735
import { FluentThemeProvider } from 'botframework-webchat-fluent-theme';
3836
import { createRoot } from 'react-dom/client';
3937

40-
const consoleError = console.error.bind(console);
41-
42-
spyOn(console, 'error').mockImplementation((...args) => {
43-
const [message] = args;
44-
45-
if (
46-
!(
47-
typeof message === 'string' &&
48-
(message.includes(
49-
'Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.'
50-
) ||
51-
// TODO: [P0] We should fix the "Cannot update a component while rendering a different component" error.
52-
(message.includes('Cannot update a component') &&
53-
message.includes('while rendering a different component')))
54-
)
55-
) {
56-
consoleError(...args);
57-
}
58-
});
59-
6038
const {
6139
testHelpers: { createDirectLineEmulator }
6240
} = window;

__tests__/html2/simple/fatModule/fluentTheme.html

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"botframework-webchat/decorator": "/__dist__/packages/bundle/static/botframework-webchat/decorator.js",
2424
"botframework-webchat/internal": "/__dist__/packages/bundle/static/botframework-webchat/internal.js",
2525
"botframework-webchat-fluent-theme": "/__dist__/packages/fluent-theme/static/botframework-webchat-fluent-theme.js",
26-
"jest-mock": "https://esm.sh/jest-mock",
2726
"react": "/__dist__/packages/bundle/static/react.18.js",
2827
"react-dom": "/__dist__/packages/bundle/static/react-dom.18.js",
2928
"react-dom/client": "/__dist__/packages/bundle/static/react-dom.18/client.js",
@@ -37,30 +36,9 @@
3736
import { FluentProvider, webLightTheme } from '@fluentui/react-components';
3837
import { createDirectLine, createStoreWithOptions, hooks, ReactWebChat } from 'botframework-webchat';
3938
import { FluentThemeProvider } from 'botframework-webchat-fluent-theme';
40-
import { fn, spyOn } from 'jest-mock';
4139
import { createElement } from 'react';
4240
import { createRoot } from 'react-dom/client';
4341

44-
const consoleError = console.error.bind(console);
45-
46-
spyOn(console, 'error').mockImplementation((...args) => {
47-
const [message] = args;
48-
49-
if (
50-
!(
51-
typeof message === 'string' &&
52-
(message.includes(
53-
'Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.'
54-
) ||
55-
// TODO: [P0] We should fix the "Cannot update a component while rendering a different component" error.
56-
(message.includes('Cannot update a component') &&
57-
message.includes('while rendering a different component')))
58-
)
59-
) {
60-
consoleError(...args);
61-
}
62-
});
63-
6442
const { useStyleOptions } = hooks;
6543
const {
6644
testHelpers: { createDirectLineEmulator }

__tests__/html2/simple/fatModule/simple.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</script>
1919
<script type="module">
2020
import { createDirectLine, createStoreWithOptions, renderWebChat } from 'botframework-webchat';
21+
import { version } from 'react';
2122

2223
run(async function () {
2324
const {
@@ -40,6 +41,7 @@
4041
await host.snapshot('local');
4142

4243
expect(typeof globalThis.React).toBe('undefined');
44+
expect(version).toBe('18.3.1');
4345
});
4446
</script>
4547
</body>

__tests__/html2/simple/fatModule/simple.react-18.html renamed to __tests__/html2/simple/fatModule/simple.react-baseline.html

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,15 @@
1111
{
1212
"imports": {
1313
"botframework-webchat": "/__dist__/packages/bundle/static/botframework-webchat.js",
14-
"jest-mock": "https://esm.sh/jest-mock",
15-
"react": "/__dist__/packages/bundle/static/react.18.js",
16-
"react-dom": "/__dist__/packages/bundle/static/react-dom.18.js",
17-
"react-dom/client": "/__dist__/packages/bundle/static/react-dom.18/client.js"
14+
"react": "/__dist__/packages/bundle/static/react.baseline.js",
15+
"react-dom": "/__dist__/packages/bundle/static/react-dom.baseline.js",
16+
"react-dom/client": "/__dist__/packages/bundle/static/react-dom.baseline/client.js"
1817
}
1918
}
2019
</script>
2120
<script type="module">
22-
import { createDirectLine, createStoreWithOptions, ReactWebChat } from 'botframework-webchat';
23-
import { fn, spyOn } from 'jest-mock';
24-
import { createElement } from 'react';
25-
import { createRoot } from 'react-dom/client';
26-
27-
const consoleError = console.error.bind(console);
28-
29-
spyOn(console, 'error').mockImplementation((...args) => {
30-
const [message] = args;
31-
32-
if (
33-
!(
34-
typeof message === 'string' &&
35-
(message.includes(
36-
'Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.'
37-
) ||
38-
// TODO: [P0] We should fix the "Cannot update a component while rendering a different component" error.
39-
(message.includes('Cannot update a component') &&
40-
message.includes('while rendering a different component')))
41-
)
42-
) {
43-
consoleError(...args);
44-
}
45-
});
21+
import { createDirectLine, createStoreWithOptions, renderWebChat } from 'botframework-webchat';
22+
import { createElement, version } from 'react';
4623

4724
run(async function () {
4825
const {
@@ -54,7 +31,7 @@
5431

5532
const { directLine, store } = createDirectLineEmulator();
5633

57-
createRoot(document.getElementById('webchat')).render(createElement(ReactWebChat, { directLine, store }));
34+
renderWebChat({ directLine, store }, document.getElementById('webchat'));
5835

5936
await pageConditions.uiConnected();
6037

@@ -65,6 +42,7 @@
6542
await host.snapshot('local');
6643

6744
expect(typeof globalThis.React).toBe('undefined');
45+
expect(version).toBe('16.8.6');
6846
});
6947
</script>
7048
</body>

__tests__/html2/simple/fatModule/simple.react-18.html.snap-1.png renamed to __tests__/html2/simple/fatModule/simple.react-baseline.html.snap-1.png

File renamed without changes.

__tests__/html2/simple/fatModule/simple.react-umd.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</head>
88
<body>
99
<main id="webchat"></main>
10-
<script src="https://unpkg.com/react@16.8.6/umd/react.development.js"></script>
11-
<script src="https://unpkg.com/react-dom@16.8.6/umd/react-dom.development.js"></script>
10+
<script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script>
11+
<script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"></script>
1212
<script type="importmap">
1313
{
1414
"imports": {
@@ -43,7 +43,7 @@
4343

4444
await host.snapshot('local');
4545

46-
expect(globalThis).toHaveProperty('React.version', '16.8.6');
46+
expect(globalThis).toHaveProperty('React.version', '17.0.2');
4747
});
4848
</script>
4949
</body>

docs/HOSTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,19 @@ For React web app, it is important to have all React components rendered with th
8989

9090
To choose between different version of React runtime, modify the import map and reference the version of your choice. React runtime must be loaded as ES Modules (ESM) instead of UMD. You may need to use a smart CDN service to load React runtime as ESM.
9191

92-
When deploying to locked down environment, clients may not have access to smart CDN service. For conveniences, Web Chat repacked React 16.8.6 and React 18 as ESM under the `/static/` directory.
92+
When deploying to locked down environment, clients may not have access to smart CDN service. For conveniences, Web Chat repacked React 16.8.6 (baseline) and React 18 (latest supported) as ESM under the `/static/` directory.
9393

9494
<details>
95-
<summary>For React 18</summary>
95+
<summary>For React (latest supported)</summary>
9696

9797
```html
9898
<script type="importmap">
9999
{
100100
"imports": {
101101
"botframework-webchat": "https://cdn.botframework.com/4.19.0/static/botframework-webchat.js",
102-
"react": "https://cdn.botframework.com/4.19.0/static/react-18.js",
103-
"react-dom": "https://cdn.botframework.com/4.19.0/static/react-dom-18.js",
104-
"react-dom/client": "https://cdn.botframework.com/4.19.0/static/react-dom-18/client.js"
102+
"react": "https://cdn.botframework.com/4.19.0/static/react.js",
103+
"react-dom": "https://cdn.botframework.com/4.19.0/static/react-dom.js",
104+
"react-dom/client": "https://cdn.botframework.com/4.19.0/static/react-dom/client.js"
105105
}
106106
}
107107
</script>
@@ -110,16 +110,16 @@ When deploying to locked down environment, clients may not have access to smart
110110
</details>
111111

112112
<details>
113-
<summary>For React 16.8.6</summary>
113+
<summary>For React 16.8.6 (baseline)</summary>
114114

115115
```html
116116
<script type="importmap">
117117
{
118118
"imports": {
119119
"botframework-webchat": "https://cdn.botframework.com/4.19.0/static/botframework-webchat.js",
120-
"react": "https://cdn.botframework.com/4.19.0/static/react.js",
121-
"react-dom": "https://cdn.botframework.com/4.19.0/static/react-dom.js",
122-
"react-dom/client": "https://cdn.botframework.com/4.19.0/static/react-dom/client.js"
120+
"react": "https://cdn.botframework.com/4.19.0/static/react.baseline.js",
121+
"react-dom": "https://cdn.botframework.com/4.19.0/static/react-dom.baseline.js",
122+
"react-dom/client": "https://cdn.botframework.com/4.19.0/static/react-dom.baseline/client.js"
123123
}
124124
}
125125
</script>

lint-staged.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ module.exports = {
3636
],
3737
'packages/repack/object-assign/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-object-assign'],
3838
'packages/repack/react/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-react'],
39-
'packages/repack/react@18/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-react-18'],
39+
'packages/repack/react@baseline/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-react-baseline'],
4040
'packages/repack/react@umd/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-react-umd'],
4141
'packages/repack/react-dom/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-react-dom'],
42-
'packages/repack/react-dom@18/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-react-dom-18'],
42+
'packages/repack/react-dom@baseline/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-react-dom-baseline'],
4343
'packages/repack/react-dom@umd/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-react-dom-umd'],
4444
'packages/repack/react-is/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:repack-react-is'],
4545
'packages/styles/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:styles'],

0 commit comments

Comments
 (0)