Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- `sendBoxMiddleware`, related to PR [#5504](https://github.com/microsoft/BotFramework-WebChat/pull/5504)
- `sendBoxToolbarMiddleware`, related to PR [#5504](https://github.com/microsoft/BotFramework-WebChat/pull/5504)
- `styleOptions.hideUploadButton` is being deprecated in favor of `styleOptions.disableFileUpload`. The option will be removed on or after 2027-07-14
- `botframework-directlinespeech-sdk` no longer ponyfill `AbortController`, it is supported by modern browsers, in PR [#5530](https://github.com/microsoft/BotFramework-WebChat/pull/5530)

### Added

Expand Down Expand Up @@ -235,6 +236,8 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
- Fixed [#5476](https://github.com/microsoft/BotFramework-WebChat/issues/5476). Modernizing components through memoization and use [`valibot`](https://npmjs.com/package/valibot) for props validation, by [@compulim](https://github.com/compulim)
- Ported `useSuggestedActions` to use React hooks as backend instead of Redux store, in PR [#5489](https://github.com/microsoft/BotFramework-WebChat/pull/5489), by [@compulim](https://github.com/compulim)
- Removed `StarterPromptsCardAction` during `blueprint` ui state in PR [#5477](https://github.com/microsoft/BotFramework-WebChat/pull/5477), by [@jcheung824](https://github.com/jcheung824)
- Removed `abort-controller-es5` package in `botframework-directlinespeech-sdk` package, in PR [#5530](https://github.com/microsoft/BotFramework-WebChat/pull/5530), by [@compulim](https://github.com/compulim)
- Removed `request` and `request-progress` package in `cldr-data-downloader` package, in PR [#5530](https://github.com/microsoft/BotFramework-WebChat/pull/5530), by [@copilot](https://github.com/copilot) and [@compulim](https://github.com/compulim)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/sendAttachmentOn/invalidImage.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
);

// THEN: It should send the file.
await pageConditions.allOutgoingActivitiesSent();
await pageConditions.numActivitiesShown(3);
await pageConditions.allOutgoingActivitiesSent();
await host.snapshot();
},
{ ignoreErrors: 'The source image could not be decoded.' }
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/sendAttachmentOn/onAttach.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
await host.upload(pageElements.uploadButton(), 'seaofthieves.jpg');

// THEN: A thumbnail with the bot reply should show.
await pageConditions.allOutgoingActivitiesSent();
await pageConditions.numActivitiesShown(2);
await pageConditions.allOutgoingActivitiesSent();
await host.snapshot();
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/sendAttachmentOn/onSend.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
await host.click(pageElements.sendButton());

// THEN: A thumbnail with the bot reply should show.
await pageConditions.allOutgoingActivitiesSent();
await pageConditions.numActivitiesShown(2);
await pageConditions.allOutgoingActivitiesSent();
await host.snapshot();
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/sendAttachmentOn/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
await host.click(pageElements.sendButton());

// THEN: A thumbnail with the bot reply should show.
await pageConditions.allOutgoingActivitiesSent();
await pageConditions.numActivitiesShown(2);
await pageConditions.allOutgoingActivitiesSent();
await host.snapshot();
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/sendAttachmentOn/simple.keyboardOnly.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
await host.sendKeys(' ');

// THEN: A thumbnail with the bot reply should show.
await pageConditions.allOutgoingActivitiesSent();
await pageConditions.numActivitiesShown(2);
await pageConditions.allOutgoingActivitiesSent();
await host.snapshot();
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/sendAttachmentOn/speech.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
await pageObjects.clickMicrophoneButton();

// THEN: A thumbnail with the bot reply should show.
await pageConditions.allOutgoingActivitiesSent();
await pageConditions.numActivitiesShown(2);
await pageConditions.allOutgoingActivitiesSent();
await host.snapshot();
},
{
Expand Down
1,363 changes: 195 additions & 1,168 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion packages/directlinespeech/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@
"dependencies": {
"@babel/runtime": "7.28.2",
"abort-controller": "3.0.0",
"abort-controller-es5": "2.0.1",
"base64-arraybuffer": "1.0.2",
"core-js": "3.44.0",
"core-js-pure": "3.44.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/* eslint class-methods-use-this: ["error", { "exceptMethods": ["cancel", "getVoices", "speak"] }] */

import { AbortController } from 'abort-controller-es5';
import { createSpeechRecognitionPonyfillFromRecognizer } from 'web-speech-cognitive-services';

import createTaskQueue from './createTaskQueue';
import EventTarget, { Event, getEventAttributeValue, setEventAttributeValue } from 'event-target-shim';
import EventTarget, { getEventAttributeValue, setEventAttributeValue } from 'event-target-shim';
import playCognitiveServicesStream from './playCognitiveServicesStream';
import playWhiteNoise from './playWhiteNoise';
import SpeechSynthesisAudioStreamUtterance from './SpeechSynthesisAudioStreamUtterance';
Expand Down
1 change: 1 addition & 0 deletions packages/styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
"@types/node": "^24.1.0",
"botframework-webchat-base": "0.0.0-0",
"cross-env": "^10.0.0",
"esbuild": "^0.25.8",
"tsup": "^8.5.0",
"type-fest": "^4.41.0",
"typescript": "~5.8.3"
Expand Down
4 changes: 1 addition & 3 deletions packages/support/cldr-data-downloader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
"adm-zip": "0.5.16",
"nopt": "8.1.0",
"progress": "2.0.3",
"q": "1.5.1",
"request": "2.88.2",
"request-progress": "3.0.0"
"q": "1.5.1"
}
}
108 changes: 66 additions & 42 deletions packages/support/cldr-data-downloader/src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,26 @@
'use strict';

import Q from 'q';
import requestProgress from 'request-progress';
import request from 'request';
import path from 'path';
import fs from 'fs';

const workingDir = process.cwd();

function getRequestOptions(options) {
options = Object.assign({}, options, {
// Get response as a buffer
encoding: null,

// The default download path redirects to a CDN URL.
followRedirect: true,

// If going through proxy, spoof the User-Agent, since may commerical proxies block blank or unknown agents in headers
function getFetchOptions(options) {
const fetchOptions = {
method: 'GET',
redirect: 'follow', // equivalent to followRedirect: true
headers: {
'User-Agent': 'curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5'
}
});
};

return options;
// Merge any additional options
if (options && options.headers) {
fetchOptions.headers = { ...fetchOptions.headers, ...options.headers };
}

return fetchOptions;
}

function fetchFromFilesystem(src) {
Expand Down Expand Up @@ -114,7 +112,7 @@ function download(src) {
}

const downloadDfd = Q.defer();
const options = getRequestOptions(src);
const options = getFetchOptions(src);

function notify(state) {
downloadDfd.notify(state);
Expand All @@ -123,48 +121,74 @@ function download(src) {
// eslint-disable-next-line no-console
console.log('GET `' + src.url + '`');

requestProgress(
request(options, (error, response, body) => {
if (error) {
error.message =
'Error making request.\n' +
error.stack +
'\n\nPlease report this full log at https://github.com/rxaviers/cldr-data-downloader';

downloadDfd.reject(error);

throw error;
} else if (!response) {
error = new Error(
'Something unexpected happened, please report this full log at https://github.com/rxaviers/cldr-data-downloader'
);

downloadDfd.reject(error);

throw error;
// eslint-disable-next-line no-magic-numbers
} else if (response.statusCode !== 200) {
error = new Error(
// Use fetch instead of request
fetch(src.url, options)
.then(async response => {
if (!response.ok) {
const error = new Error(
'Error requesting archive.\nStatus: ' +
response.statusCode +
response.status +
'\nRequest options: ' +
// eslint-disable-next-line no-magic-numbers
JSON.stringify(options, null, 2) +
'\nResponse headers: ' +
// eslint-disable-next-line no-magic-numbers
JSON.stringify(response.headers, null, 2) +
JSON.stringify(Object.fromEntries(response.headers.entries()), null, 2) +
'\nMake sure your network and proxy settings are correct.\n\nIf you continue to have issues, please report this full log at https://github.com/rxaviers/cldr-data-downloader'
);
downloadDfd.reject(error);

throw error;
}

notify({ received: body.length, percent: 100 });
// Get the content length for progress tracking
const contentLength = parseInt(response.headers.get('content-length'), 10);
const reader = response.body.getReader();
const chunks = [];
let receivedLength = 0;

// Read the response in chunks to track progress
// eslint-disable-next-line no-constant-condition
while (true) {
// eslint-disable-next-line no-await-in-loop
const { done, value } = await reader.read();

if (done) {
break;
}

chunks.push(value);
receivedLength += value.length;

// Notify progress if we have content length
if (contentLength) {
// eslint-disable-next-line no-magic-numbers
const percent = Math.round((receivedLength / contentLength) * 100);
notify({ total: contentLength, received: receivedLength, percent });
}
}

// Combine all chunks into a single buffer
const body = new Uint8Array(receivedLength);
let position = 0;
for (const chunk of chunks) {
body.set(chunk, position);
position += chunk.length;
}

// Final progress notification
notify({ total: receivedLength, received: receivedLength, percent: 100 });

downloadDfd.resolve(body);
downloadDfd.resolve(Buffer.from(body));
})
).on('progress', notify);
.catch(error => {
error.message =
'Error making request.\n' +
error.stack +
'\n\nPlease report this full log at https://github.com/rxaviers/cldr-data-downloader';

downloadDfd.reject(error);
throw error;
});

return downloadDfd.promise;
}
Expand Down
Loading