Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fbca05f
Support <script> tag
compulim Sep 13, 2025
0e22b40
Add React rules
compulim Sep 13, 2025
77c6b69
Disable react/jsx-indent
compulim Sep 13, 2025
69e9b37
Fix build
compulim Sep 13, 2025
ecd8bdb
Change path
compulim Sep 13, 2025
b0f733b
Fix bot agent
compulim Sep 13, 2025
ce1eaeb
Fix module format
compulim Sep 13, 2025
f0d64a2
Export createActivityPolymiddlewareFromLegacy
compulim Sep 13, 2025
9fbd4a6
Update to Node.js 22
compulim Sep 13, 2025
7572057
Fix buildInfo.object
compulim Sep 13, 2025
918c5d5
Fix Jest for transpilation
compulim Sep 13, 2025
75dfa14
Add Speech SDK
compulim Sep 13, 2025
60e0182
Better applyConfig API
compulim Sep 13, 2025
65a861d
Use caret versions for devDependencies
compulim Sep 13, 2025
a131b1e
Move preset into bundle/src/package-preset
compulim Sep 13, 2025
8605b94
Fix path
compulim Sep 13, 2025
fc6de67
Move api-middleware under api/src/package-api-middleware
compulim Sep 14, 2025
b81e4a5
Remove private packages from exporting publicly
compulim Sep 14, 2025
a9a94ff
Re-export useSuggestedActionsHooks
compulim Sep 14, 2025
5b76be8
Remove api-middleware
compulim Sep 14, 2025
338913e
Fix tsd
compulim Sep 14, 2025
79d9c47
Remove api-middleware
compulim Sep 14, 2025
8ea754f
Remove react/require-default-props
compulim Sep 14, 2025
c3370f7
Add --if-present
compulim Sep 14, 2025
592d082
Add fat module tests
compulim Sep 15, 2025
1ae8f70
Clean up
compulim Sep 15, 2025
6bebdf3
Support fat module
compulim Sep 17, 2025
bbfbf6f
Remove botframework-webchat-* and install bundle only
compulim Sep 17, 2025
6f43558
Disable Lightning CSS temporarily
compulim Sep 17, 2025
bd3fff8
Including reactResolve plugin
compulim Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ defaults:
env:
CI_PULL_REQUEST: 1 # Skip nightly tests
NODE_ENV: test # Add instrumentation code
node-version: 18.20 # Need to bump jest@29 to resolve something in https://github.com/facebook/react-native/issues/35701
node-version: 22

jobs:
build:
Expand Down
102 changes: 102 additions & 0 deletions __tests__/html2/simple/fatModule/fluentTheme.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<style type="text/css">
/* TODO: [P*] Can we eliminate this style? */
.fui-FluentProvider,
.webchat-fluent {
height: 100%;
}
</style>
</head>
<body>
<main id="webchat"></main>
<script type="importmap">
{
"imports": {
"@fluentui/react-components": "https://esm.sh/@fluentui/react-components?deps=react@18.3.1&exports=FluentProvider,createDarkTheme,webLightTheme",
"botframework-webchat": "/__dist__/packages/bundle/dist/botframework-webchat.mjs",
"botframework-webchat/internal": "/__dist__/packages/bundle/dist/botframework-webchat/internal.mjs",
"botframework-webchat-fluent-theme": "/__dist__/packages/fluent-theme/dist/botframework-webchat-fluent-theme.mjs",
"react": "https://esm.sh/react@18",
"react-dom": "https://esm.sh/react-dom@18",
"react-dom/": "https://esm.sh/react-dom@18/"
}
}
</script>
<script type="module">
import React from 'react';

// We should allow using React from environment.
// When web devs import Web Chat as <script type="module">, we want to enable customization.
// Customization requires React.createElement() and calling some hooks.
window.React = React;
Comment on lines +31 to +36
Copy link
Copy Markdown
Collaborator

@OEvgeny OEvgeny Sep 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider us doing import React from './webchat-react-16.x.x.mjs in the bundled fat module and people could override this via import map if they need a different version of react.

</script>
<script type="module">
import { FluentProvider, createDarkTheme, webLightTheme } from '@fluentui/react-components';
import { createDirectLine, createStoreWithOptions, hooks, ReactWebChat } from 'botframework-webchat';
import { FluentThemeProvider } from 'botframework-webchat-fluent-theme';
import { createElement } from 'react';
import { createRoot } from 'react-dom/client';

const { useStyleOptions } = hooks;
const {
testHelpers: { createDirectLineEmulator }
} = window;

// TODO: This is for `createDirectLineEmulator` only, should find ways to eliminate this line.
window.WebChat = { createStoreWithOptions };

run(async function () {
const { directLine, store } = createDirectLineEmulator();

const fluentTheme = {
...createDarkTheme({
10: '#12174c',
20: '#1a1f5b',
30: '#21276a',
40: '#293079',
50: '#303788',
60: '#384097',
70: '#4049a7',
80: '#151e80',
90: '#4f59c5',
100: '#5661d4',
110: '#5e69e3',
120: '#7982e8',
130: '#949bec',
140: '#afb5f1',
150: '#c9cdf6',
160: '#e4e6fa'
}),
colorNeutralBackground1Disabled: '#101010',
colorNeutralBackground1Hover: '#101010',
colorNeutralForeground5: '#424242'
};

createRoot(document.getElementsByTagName('main')[0]).render(
createElement(
FluentProvider,
{ className: 'fui-FluentProvider', theme: fluentTheme },
createElement(
FluentThemeProvider,
{ variant: 'fluent' },
createElement(ReactWebChat, { directLine, store })
)
)
);

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity('Hello, World!');

await pageConditions.numActivitiesShown(1);

await host.snapshot('local');
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions __tests__/html2/simple/fatModule/simple.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
</head>
<body>
<main id="webchat"></main>
<script type="importmap">
{
"imports": {
"botframework-webchat": "/__dist__/packages/bundle/dist/botframework-webchat.mjs"
}
}
</script>
<script type="module">
import { createDirectLine, createStoreWithOptions, renderWebChat } from 'botframework-webchat';

run(async function () {
const {
testHelpers: { createDirectLineEmulator }
} = window;

// TODO: This is for `createDirectLineEmulator` only, should find ways to eliminate this line.
window.WebChat = { createStoreWithOptions };

const { directLine, store } = createDirectLineEmulator();

renderWebChat(
{
directLine,
store
},
document.getElementById('webchat')
);

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity('Hello, World!');

await pageConditions.numActivitiesShown(1);

await host.snapshot('local');
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
</head>
<body>
<main id="webchat"></main>
<script type="importmap">
{
"imports": {
"botframework-webchat": "/__dist__/packages/bundle/dist/botframework-webchat.mjs",
"botframework-webchat/middleware": "/__dist__/packages/bundle/dist/botframework-webchat/middleware.mjs",
"react": "https://esm.sh/react@18",
"react-dom": "https://esm.sh/react-dom@18",
"react-dom/": "https://esm.sh/react-dom@18/"
}
}
</script>
<script type="module">
import React from 'react';

// We should allow using React from environment.
// When web devs import Web Chat as <script type="module">, we want to enable customization.
// Customization requires React.createElement() and calling some hooks.
window.React = React;
</script>
<script type="module">
import { createDirectLine, createStoreWithOptions, hooks, ReactWebChat } from 'botframework-webchat';
import { activityComponent, createActivityPolymiddleware } from 'botframework-webchat/middleware';
import { createElement } from 'react';
import { createRoot } from 'react-dom/client';

const { useStyleOptions } = hooks;
const {
testHelpers: { createDirectLineEmulator }
} = window;

// TODO: This is for `createDirectLineEmulator` only, should find ways to eliminate this line.
window.WebChat = { createStoreWithOptions };

run(async function () {
const { directLine, store } = createDirectLineEmulator();

function MyMiddleware({ nextResult }) {
// THEN: Web Chat hooks can be called.
const [{ accent }] = useStyleOptions();

return createElement(
'div',
{ style: { borderColor: accent, borderStyle: 'solid', borderWidth: 2 } },
nextResult?.render({})
);
}

createRoot(document.getElementsByTagName('main')[0]).render(
createElement(ReactWebChat, {
directLine,
polymiddleware: [
createActivityPolymiddleware(
next => request => activityComponent(MyMiddleware, { nextResult: next(request) })
)
],
store
})
);

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity('Hello, World!');

await pageConditions.numActivitiesShown(1);

await host.snapshot('local');
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<!doctype html>
<html lang="en-US">
<head>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
</head>
<body>
<main id="webchat"></main>
<script type="importmap">
{
"imports": {
"botframework-webchat": "/__dist__/packages/bundle/dist/botframework-webchat.mjs",
"botframework-webchat/middleware": "/__dist__/packages/bundle/dist/botframework-webchat/middleware.mjs",
"react": "https://esm.sh/react@18",
"react-dom": "https://esm.sh/react-dom@18"
}
}
</script>
<script type="module">
import React from 'react';
import ReactDOM from 'react-dom';

// We should allow using React from environment.
// When web devs import Web Chat as <script type="module">, we want to enable customization.
// Customization requires React.createElement() and calling some hooks.
window.React = React;
window.ReactDOM = ReactDOM;
</script>
<script type="module">
import { createDirectLine, createStoreWithOptions, hooks, renderWebChat } from 'botframework-webchat';
import { activityComponent, createActivityPolymiddleware } from 'botframework-webchat/middleware';
import { createElement } from 'react';

const { useStyleOptions } = hooks;
const {
testHelpers: { createDirectLineEmulator }
} = window;

// TODO: This is for `createDirectLineEmulator` only, should find ways to eliminate this line.
window.WebChat = { createStoreWithOptions };

run(async function () {
const { directLine, store } = createDirectLineEmulator();

function MyMiddleware({ nextResult }) {
// THEN: Web Chat hooks can be called.
const [{ accent }] = useStyleOptions();

return createElement(
'div',
{ style: { borderColor: accent, borderStyle: 'solid', borderWidth: 2 } },
nextResult?.render({})
);
}

renderWebChat(
{
directLine,
polymiddleware: [
createActivityPolymiddleware(
next => request => activityComponent(MyMiddleware, { nextResult: next(request) })
)
],
store
},
document.getElementsByTagName('main')[0]
);

await pageConditions.uiConnected();

await directLine.emulateIncomingActivity('Hello, World!');

await pageConditions.numActivitiesShown(1);

await host.snapshot('local');
});
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
1 change: 1 addition & 0 deletions jest.legacy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const TRANSFORM_IGNORE_PACKAGES = [
'micromark-util-sanitize-uri',
'micromark-util-subtokenize',
'micromark',
'microsoft-cognitiveservices-speech-sdk',
'mime',
'unist-util-stringify-position',
'uuid'
Expand Down
1 change: 0 additions & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
'**/*.md': prettierMarkdown,
'packages/**/*.css': ['npm run precommit:biome'],
'packages/api/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:api'],
'packages/api-middleware/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:api-middleware'],
'packages/base/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:base'],
'packages/bundle/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:bundle'],
'packages/component/src/**/*.{mjs,js,ts,tsx}': ['npm run precommit:eslint:component'],
Expand Down
Loading
Loading