Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
24a31f4
First attempt
compulim Sep 22, 2025
e1f0e1b
Clean up
compulim Sep 22, 2025
7c7660e
Ignore static
compulim Sep 22, 2025
1007bb7
Better separator
compulim Sep 22, 2025
44a125c
Add importmap
compulim Sep 22, 2025
3223c98
Add static
compulim Sep 22, 2025
e7f1933
Add version number
compulim Sep 22, 2025
2a1b619
Clean up
compulim Sep 22, 2025
0794fff
Short chunk name
compulim Sep 22, 2025
5ee28fd
Unify entryNames
compulim Sep 22, 2025
957a18f
Use __ (double underscore)
compulim Sep 22, 2025
d65deae
Add sourcemap
compulim Sep 22, 2025
be06655
Better React
compulim Sep 22, 2025
b54ff06
Clean up
compulim Sep 22, 2025
b0fb739
Add version number
compulim Sep 22, 2025
8f991b2
Save ReactDOM
compulim Sep 22, 2025
0fd2eb1
Use React CJS without global
compulim Sep 23, 2025
6a38b5b
Add Speech SDK
compulim Sep 23, 2025
a062b3b
Repack
compulim Sep 24, 2025
57bedf0
Add base64-js
compulim Sep 24, 2025
f70605b
Fix eslint
compulim Sep 24, 2025
b24a157
Repack botframework-directlinejs
compulim Sep 24, 2025
ecde5eb
Better esbuild src
compulim Sep 24, 2025
091651e
Repack react and react-dom
compulim Sep 24, 2025
6aeb652
Add sourcemap
compulim Sep 24, 2025
b68a8f2
Repack react-is
compulim Sep 24, 2025
fedc958
Clean up
compulim Sep 24, 2025
d14580a
Add @types/*
compulim Sep 24, 2025
19086d6
Clean up
compulim Sep 24, 2025
f1eb51a
Delete object-assign
compulim Sep 24, 2025
5dc5761
Delete object-assign
compulim Sep 24, 2025
ff812f8
Cheaper object-assign
compulim Sep 24, 2025
a3d5364
Remove unnecessary devDependencies
compulim Sep 24, 2025
266619e
Clean up
compulim Sep 24, 2025
39ea506
Add comment for 1.45.0
compulim Sep 24, 2025
b0fe103
Fix eslint
compulim Sep 24, 2025
bff9152
Remove isConcurrentMode
compulim Sep 24, 2025
baa424d
Bump to react-is@16
compulim Sep 24, 2025
69354bb
Revert
compulim Sep 24, 2025
b5e6b70
Add precommit
compulim Sep 24, 2025
c889197
Debump to 1.17.0
compulim Sep 24, 2025
0a4d7a9
Add repack
compulim Sep 24, 2025
633a07d
Fix npm start for repacks
compulim Sep 24, 2025
1769dfd
Fix npm run build
compulim Sep 24, 2025
a5d7492
Add start:static
compulim Sep 24, 2025
701aca8
Better message
compulim Sep 24, 2025
89db7cf
Better message
compulim Sep 24, 2025
107db4d
Clean up
compulim Sep 24, 2025
d49d192
Add first fat module test
compulim Sep 24, 2025
2333852
Add more tests
compulim Sep 24, 2025
b030e91
Add more exports and tests
compulim Sep 24, 2025
86e3180
Use isomorphic React
compulim Sep 24, 2025
de10d02
Add snapshot
compulim Sep 24, 2025
fdfb619
Fix watch mode
compulim Sep 24, 2025
37f69ee
Isomorphic React as esbuild plugin
compulim Sep 24, 2025
6a09746
Fix npm run build
compulim Sep 24, 2025
c74ceb7
Remove isomorphic React
compulim Sep 24, 2025
40a6651
Rename to skip
compulim Sep 24, 2025
22ad404
Add to lint-staged
compulim Sep 24, 2025
9544eb9
Fix dev server
compulim Sep 24, 2025
db069e5
Add npm start html-react-parser
compulim Sep 24, 2025
9639eb3
Remove comment
compulim Sep 24, 2025
190ad32
Clean up
compulim Sep 24, 2025
ab927c7
Don't print token
compulim Sep 24, 2025
95b0c26
Add test for createRoot
compulim Sep 24, 2025
0b5f05a
Fix import react-dom
compulim Sep 24, 2025
4b5637c
Add entry
compulim Sep 24, 2025
1e4f798
Add static
compulim Sep 24, 2025
f0c055b
Upload static artifact
compulim Sep 24, 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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!/__tests__
/__tests__/__image_snapshots__
!/packages/bundle/dist
!/packages/bundle/static
!/packages/debug-theme/dist
!/packages/fluent-theme/dist
!/packages/playground/build
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/daily-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: bundles
path: packages/bundle/dist/**/*
path: |
packages/bundle/dist/**/*
packages/bundle/stable/**/*

- name: Upload tarballs
uses: actions/upload-artifact@v4
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/preview-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: bundle
path: 'packages/bundle/dist/**/*'
path: |
packages/bundle/dist/**/*
packages/bundle/stable/**/*

- name: Upload npm-tarball
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pull-request-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
./package.json
./__tests__/
./packages/bundle/dist/
./packages/bundle/static/
./packages/debug-theme/dist/
./packages/fluent-theme/dist/
./packages/test/harness/
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- `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`
- (Experimental) Added support for importing via `<script type="module">`, by [@compulim](https://github.com/compulim) in PR [#5592](https://github.com/microsoft/BotFramework-WebChat/pull/5592)

### Changed

Expand Down
82 changes: 82 additions & 0 deletions __tests__/html2/simple/fatModule/adaptiveCards.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!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/static/botframework-webchat.js",
"react": "/__dist__/packages/bundle/static/react.js",
"react-dom": "/__dist__/packages/bundle/static/react-dom.js"
}
}
</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({
attachments: [
{
content: {
type: 'AdaptiveCard',
body: [
{
type: 'TextBlock',
text: 'You can choose one of the followings.'
}
],
$schema: 'http://adaptivecards.io/schemas/adaptive-card.json',
version: '1.2',
actions: [
{
type: 'Action.Submit',
title: 'What time is it?'
},
{
type: 'Action.Submit',
title: 'What is the weather?'
}
]
},
contentType: 'application/vnd.microsoft.card.adaptive'
}
],
from: { id: 'bot', role: 'bot' },
text: 'What can I do for you?',
type: 'message'
});

await pageConditions.numActivitiesShown(1);

await host.snapshot('local');

expect(typeof globalThis.React).toBe('undefined');
});
</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.
82 changes: 82 additions & 0 deletions __tests__/html2/simple/fatModule/esm.sh/adaptiveCards.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!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/static/botframework-webchat.js",
"react": "https://esm.sh/react@18",
"react-dom": "https://esm.sh/react-dom@18"
}
}
</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({
attachments: [
{
content: {
type: 'AdaptiveCard',
body: [
{
type: 'TextBlock',
text: 'You can choose one of the followings.'
}
],
$schema: 'http://adaptivecards.io/schemas/adaptive-card.json',
version: '1.2',
actions: [
{
type: 'Action.Submit',
title: 'What time is it?'
},
{
type: 'Action.Submit',
title: 'What is the weather?'
}
]
},
contentType: 'application/vnd.microsoft.card.adaptive'
}
],
from: { id: 'bot', role: 'bot' },
text: 'What can I do for you?',
type: 'message'
});

await pageConditions.numActivitiesShown(1);

await host.snapshot('local');

expect(typeof globalThis.React).toBe('undefined');
});
</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
Expand Up @@ -10,7 +10,9 @@
<script type="importmap">
{
"imports": {
"botframework-webchat": "/__dist__/packages/bundle/dist/botframework-webchat.mjs"
"botframework-webchat": "/__dist__/packages/bundle/static/botframework-webchat.js",
"react": "https://esm.sh/react@18",
"react-dom": "https://esm.sh/react-dom@18"
}
}
</script>
Expand All @@ -27,13 +29,7 @@

const { directLine, store } = createDirectLineEmulator();

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

await pageConditions.uiConnected();

Expand All @@ -42,6 +38,8 @@
await pageConditions.numActivitiesShown(1);

await host.snapshot('local');

expect(typeof globalThis.React).toBe('undefined');
});
</script>
</body>
Expand Down
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,71 @@
<!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/static/botframework-webchat.js",
"botframework-webchat/middleware": "/__dist__/packages/bundle/static/botframework-webchat.middleware.js",
"react": "https://esm.sh/react@18",
"react-dom": "https://esm.sh/react-dom@18"
}
}
</script>
<script type="module">
import { createDirectLine, createStoreWithOptions, hooks, ReactWebChat } from 'botframework-webchat';
import { activityComponent, createActivityPolymiddleware } from 'botframework-webchat/middleware';
import { createElement } from 'react';
import { render } from 'react-dom';

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({})
);
}

render(
createElement(ReactWebChat, {
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.
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,14 @@
<script type="importmap">
{
"imports": {
"botframework-webchat": "/__dist__/packages/bundle/dist/botframework-webchat.mjs",
"botframework-webchat/middleware": "/__dist__/packages/bundle/dist/botframework-webchat/middleware.mjs",
"botframework-webchat": "/__dist__/packages/bundle/static/botframework-webchat.js",
"botframework-webchat/middleware": "/__dist__/packages/bundle/static/botframework-webchat.middleware.js",
"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';
Expand Down
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
Expand Up @@ -10,23 +10,13 @@
<script type="importmap">
{
"imports": {
"botframework-webchat": "/__dist__/packages/bundle/dist/botframework-webchat.mjs",
"botframework-webchat/middleware": "/__dist__/packages/bundle/dist/botframework-webchat/middleware.mjs",
"botframework-webchat": "/__dist__/packages/bundle/static/botframework-webchat.js",
"botframework-webchat/middleware": "/__dist__/packages/bundle/static/botframework-webchat.middleware.js",
"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';
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 4 additions & 13 deletions __tests__/html2/simple/fatModule/fluentTheme.skip.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,14 @@
{
"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": "/__dist__/packages/bundle/static/botframework-webchat.js",
"botframework-webchat/internal": "/__dist__/packages/bundle/static/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/"
"react": "/__dist__/packages/bundle/static/react.js",
"react-dom": "/__dist__/packages/bundle/static/react-dom.js"
}
}
</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';
Expand Down
Loading
Loading