Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
bcb88c1
Fix npm start
compulim Sep 19, 2025
e49f352
Add outDirWithTemp
compulim Sep 19, 2025
5d3193d
Update to Speech SDK 1.45.0
compulim Sep 19, 2025
b47a257
Remove unused compile result
compulim Sep 19, 2025
b2ce3ad
Transform Speech SDK
compulim Sep 19, 2025
79cde24
Simplify exports
compulim Sep 19, 2025
26227ef
Fold actual layer into exports
compulim Sep 19, 2025
c5fbcd0
Exports internal
compulim Sep 19, 2025
ddea14f
Revert "Fold actual layer into exports"
compulim Sep 19, 2025
51dabb5
Rename bundle to iife
compulim Sep 19, 2025
cc6a9f6
Rename path
compulim Sep 19, 2025
856ed0b
Update api boot
compulim Sep 19, 2025
3c74e4c
Redo bundle boot
compulim Sep 19, 2025
9d3be99
Redo component boot
compulim Sep 19, 2025
81ac26c
Redo bundle boot
compulim Sep 19, 2025
d6ce7be
Include component hooks
compulim Sep 19, 2025
4579314
Change to "set" philosophy
compulim Sep 19, 2025
906e7e5
Clean up
compulim Sep 19, 2025
79c9523
Add more fullSet/minimalSet
compulim Sep 19, 2025
4542d5e
Remove old code and rename *set to *
compulim Sep 19, 2025
f2ce77c
Skip tests
compulim Sep 19, 2025
3590a5d
Fix default export
compulim Sep 19, 2025
1466d30
Fix default export
compulim Sep 19, 2025
8df2ca6
Fix tsd
compulim Sep 19, 2025
0291ee3
Clean up
compulim Sep 19, 2025
aa21547
Fix nonce
compulim Sep 19, 2025
d6d826c
Export middleware in IIFE
compulim Sep 19, 2025
cb167ea
Comment out UMD resolve
compulim Sep 19, 2025
62bc044
Add more UMD
compulim Sep 19, 2025
f0b6759
Inject CSS for code splitting
compulim Sep 20, 2025
0631b41
Use re-export
compulim Sep 20, 2025
1dc22f4
Clean up typing
compulim Sep 20, 2025
5234c87
Freeze state
compulim Sep 20, 2025
bd17c1d
Add comment
compulim Sep 20, 2025
6b3e126
Use re-export
compulim Sep 20, 2025
a45d1d1
Use re-export
compulim Sep 20, 2025
b7947d0
Fix minimal import
compulim Sep 20, 2025
6fb9407
Use re-export and cleanup
compulim Sep 20, 2025
baa0c58
Remove minimal exports
compulim Sep 20, 2025
d3c2b2c
Merge branch 'main' into feat-rebundling
compulim Sep 20, 2025
8224cd7
Use re-export
compulim Sep 20, 2025
52ea2a8
Clean up
compulim Sep 20, 2025
8777372
Add exports
compulim Sep 20, 2025
4b4b11e
Use bundle/decorator
compulim Sep 20, 2025
f5e4023
Clean up
compulim Sep 20, 2025
e46315b
Add entry
compulim Sep 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- Unified build info and injection of `<meta>` tag, in PR [#5571](https://github.com/microsoft/BotFramework-WebChat/pull/5571), by [@compulim](https://github.com/compulim)
- Added documentation for `isPartOf` property, in PR [#5573](https://github.com/microsoft/BotFramework-WebChat/pull/5573), by [@compulim](https://github.com/compulim)
- `fluent-theme`: Changed dependencies to import solely from the "bundle" package, in PR [#5584](https://github.com/microsoft/BotFramework-WebChat/pull/5584), by [@compulim](https://github.com/compulim)
- Improved bundling, in PR [#5588](https://github.com/microsoft/BotFramework-WebChat/pull/5588), by [@compulim](https://github.com/compulim)
- New named exports
- `api`: `botframework-webchat-api/hook`
- `bundle`: `botframework-webchat/component`, `botframework-webchat/decorator` (internal-use), `botframework-webchat/hook`
- `component`: `botframework-webchat-component/component`, `botframework-webchat-component/hook`

### Changed

Expand Down
102 changes: 102 additions & 0 deletions __tests__/html2/simple/fatModule/fluentTheme.skip.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;
</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>
48 changes: 48 additions & 0 deletions __tests__/html2/simple/fatModule/simple.skip.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>
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>
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>
File renamed without changes.
3 changes: 3 additions & 0 deletions jest.legacy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const TRANSFORM_IGNORE_PACKAGES = [
'unist-util-stringify-position',
'uuid',

// Related to Speech SDK.
'microsoft-cognitiveservices-speech-sdk',

// Related to Adaptive Cards.
'dom7',
'ssr-window',
Expand Down
Loading
Loading