Skip to content

Commit

Permalink
Enable IE11
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Apr 5, 2020
1 parent 5e45796 commit dea095e
Show file tree
Hide file tree
Showing 34 changed files with 208 additions and 54 deletions.
2 changes: 1 addition & 1 deletion __tests__/html/offlineUI.fatalError.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>
<div id="webchat"></div>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script type="text/babel" data-presets="es2015,stage-3">
<script type="text/babel" data-presets="env,stage-3">
const { conditions, createStore, host, pageObjects, shareObservable, timeouts, token } = window.WebChatTest;

(async function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/offlineUI.firstConnect.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div id="webchat"></div>
<script crossorigin="anonymous" src="https://unpkg.com/lolex@4/lolex.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script type="text/babel" data-presets="es2015,stage-3">
<script type="text/babel" data-presets="env,stage-3">
const { conditions, createStore, host, pageObjects, shareObservable, timeouts, token } = window.WebChatTest;

(async function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/offlineUI.invalidCredentials.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>
<div id="webchat"></div>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script type="text/babel" data-presets="es2015,stage-3">
<script type="text/babel" data-presets="env,stage-3">
const { conditions, createStore, host, pageObjects, timeouts } = window.WebChatTest;

(async function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/offlineUI.networkInterrupt.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div id="webchat"></div>
<script crossorigin="anonymous" src="https://unpkg.com/lolex@4/lolex.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script type="text/babel" data-presets="es2015,stage-3">
<script type="text/babel" data-presets="env,stage-3">
const { conditions, createStore, host, pageObjects, shareObservable, timeouts, token } = window.WebChatTest;

(async function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/offlineUI.sendFailed.noAck.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div id="webchat"></div>
<script crossorigin="anonymous" src="https://unpkg.com/lolex@4/lolex.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script type="text/babel" data-presets="es2015,stage-3">
<script type="text/babel" data-presets="env,stage-3">
const { conditions, createStore, host, pageObjects, shareObservable, timeouts, token } = window.WebChatTest;

(async function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/offlineUI.sendFailed.notSend.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div id="webchat"></div>
<script crossorigin="anonymous" src="https://unpkg.com/lolex@4/lolex.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script type="text/babel" data-presets="es2015,stage-3">
<script type="text/babel" data-presets="env,stage-3">
const { conditions, createStore, host, pageObjects, timeouts, token } = window.WebChatTest;

(async function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/offlineUI.slowNetwork.firstConnect.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div id="webchat"></div>
<script crossorigin="anonymous" src="https://unpkg.com/lolex@4/lolex.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script type="text/babel" data-presets="es2015,stage-3">
<script type="text/babel" data-presets="env,stage-3">
const { conditions, createStore, host, pageObjects, updateIn, timeouts, token } = window.WebChatTest;

(async function() {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/offlineUI.slowNetwork.reconnect.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div id="webchat"></div>
<script crossorigin="anonymous" src="https://unpkg.com/lolex@4/lolex.js"></script>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script type="text/babel" data-presets="es2015,stage-3">
<script type="text/babel" data-presets="env,stage-3">
const { conditions, createStore, host, pageObjects, shareObservable, timeouts, token } = window.WebChatTest;

(async function() {
Expand Down
3 changes: 2 additions & 1 deletion __tests__/html/speechRecognition.simple.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<script crossorigin="anonymous" src="https://unpkg.com/core-js@2/client/core.min.js"></script>
<script crossorigin="anonymous" src="https://unpkg.com/@babel/standalone@7/babel.min.js"></script>
<script crossorigin="anonymous" src="https://unpkg.com/regenerator-runtime/runtime.js"></script>
<script crossorigin="anonymous" src="https://unpkg.com/[email protected]/umd/react.development.js"></script>
Expand All @@ -18,7 +19,7 @@
<script
type="text/babel"
data-plugins="@babel/plugin-proposal-async-generator-functions"
data-presets="es2015,stage-3"
data-presets="env,stage-3"
>
const {
conditions,
Expand Down
2 changes: 1 addition & 1 deletion __tests__/html/toast.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>
<div id="webchat"></div>
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script type="text/babel" data-presets="es2015,stage-3">
<script type="text/babel" data-presets="env,stage-3">
(async function() {
const { conditions, createStore, host, pageObjects, timeouts, token } = window.WebChatTest;

Expand Down
21 changes: 3 additions & 18 deletions packages/component/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"react-dictate-button": "1.2.2",
"react-film": "2.0.2",
"react-redux": "7.2.0",
"react-say": "2.0.0",
"react-say": "2.0.1-master.c5d6304",
"react-scroll-to-bottom": "1.3.2",
"redux": "4.0.5",
"remark": "10.0.1",
Expand Down
32 changes: 32 additions & 0 deletions packages/testharness/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packages/testharness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"build": "npm run build:babel && npm run build:webpack",
"build:babel": "babel src --out-dir lib --verbose",
"build:webpack": "webpack-cli",
"postinstall": "webpack-cli --config pre/webpack.config.js",
"prestart": "npm run build:babel",
"start": "concurrently --kill-others --names \"babel,webpack\" \"npm run start:babel\" \"npm run start:webpack\"",
"start:babel": "npm run build:babel -- --skip-initial-build --watch",
Expand All @@ -21,6 +22,7 @@
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.7",
"@babel/runtime": "^7.8.7",
"babel-loader": "^8.1.0",
"concurrently": "^5.1.0",
"core-js": "^3.6.4",
"source-map-loader": "^0.2.4",
Expand All @@ -29,9 +31,12 @@
},
"dependencies": {
"@babel/plugin-proposal-async-generator-functions": "^7.8.3",
"abort-controller": "^3.0.0",
"abort-controller-es5": "^1.0.1",
"base64-arraybuffer": "^0.2.0",
"event-iterator": "^1.2.0",
"event-target-shim": "^5.0.1",
"event-target-shim-es5": "^1.0.1",
"expect": "^25.1.0",
"math-random": "^1.0.4",
"microsoft-cognitiveservices-speech-sdk": "1.10.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import BabelPluginProposalAsyncGeneratorFunctions from '@babel/plugin-proposal-async-generator-functions';

export default BabelPluginProposalAsyncGeneratorFunctions;
3 changes: 3 additions & 0 deletions packages/testharness/pre/external/event-iterator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { EventIterator } from 'event-iterator';

export { EventIterator }
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
AudioSourceErrorEvent,
AudioSourceInitializingEvent,
AudioSourceOffEvent,
AudioSourceReadyEvent,
AudioStreamNodeAttachedEvent,
AudioStreamNodeAttachingEvent,
AudioStreamNodeDetachedEvent
} from 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/AudioSourceEvents';

export {
AudioSourceErrorEvent,
AudioSourceInitializingEvent,
AudioSourceOffEvent,
AudioSourceReadyEvent,
AudioStreamNodeAttachedEvent,
AudioStreamNodeAttachingEvent,
AudioStreamNodeDetachedEvent
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { EventSource } from 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/EventSource';

export { EventSource };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Events } from 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Events';

export { Events };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createNoDashGuid } from 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Guid';

export { createNoDashGuid };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { PromiseHelper } from 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Promise';

export { PromiseHelper };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { Stream } from 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Stream';

export { Stream };
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { AudioStreamFormat } from 'microsoft-cognitiveservices-speech-sdk';

export { AudioStreamFormat };
70 changes: 70 additions & 0 deletions packages/testharness/pre/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
const { join } = require('path');

module.exports = {
devtool: 'source-map',
entry: {
'external/@babel/plugin-proposal-async-generator-functions/index': join(
__dirname,
'./external/@babel/plugin-proposal-async-generator-functions/index.js'
),
'external/event-iterator/index': join(__dirname, './external/event-iterator/index.js'),
'external/microsoft-cognitiveservices-speech-sdk/index': join(
__dirname,
'./external/microsoft-cognitiveservices-speech-sdk/index.js'
),
'external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/AudioSourceEvents': join(
__dirname,
'./external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/AudioSourceEvents.js'
),
'external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Events': join(
__dirname,
'./external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Events.js'
),
'external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/EventSource': join(
__dirname,
'./external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/EventSource.js'
),
'external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Guid': join(
__dirname,
'./external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Guid.js'
),
'external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Promise': join(
__dirname,
'./external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Promise.js'
),
'external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Stream': join(
__dirname,
'./external/microsoft-cognitiveservices-speech-sdk/distrib/lib/src/common/Stream.js'
)
},
mode: 'development',
module: {
rules: [
{
exclude: [],
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
forceAllTransforms: true,
modules: 'commonjs'
}
]
]
}
}
}
]
},
// @babel/plugin-proposal-async-generator-functions is causing a false error because @babel/core import "fs" without the need to use it.
// We are emptying out "fs" to ignore the error.
node: { fs: 'empty' },
output: {
libraryTarget: 'commonjs2',
path: join(__dirname, '../lib')
}
};
10 changes: 7 additions & 3 deletions packages/testharness/src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { EventIterator } from 'event-iterator';
import babelPluginProposalAsyncGeneratorFunctions from '@babel/plugin-proposal-async-generator-functions';
import createDeferred from 'p-defer-es5';
import expect from 'expect';
import updateIn from 'simple-update-in';

import { EventIterator } from './external/event-iterator';
import BabelPluginProposalAsyncGeneratorFunctions from './external/@babel/plugin-proposal-async-generator-functions';

import { timeouts } from './constants';
import * as conditions from './conditions/index';
import * as elements from './elements/index';
Expand All @@ -23,7 +24,10 @@ import shareObservable from './utils/shareObservable';
import sleep from './utils/sleep';
import subscribeConsole, { getHistory as getConsoleHistory } from './utils/subscribeConsole';

window.Babel.registerPlugin('@babel/plugin-proposal-async-generator-functions', babelPluginProposalAsyncGeneratorFunctions);
window.Babel.registerPlugin(
'@babel/plugin-proposal-async-generator-functions',
BabelPluginProposalAsyncGeneratorFunctions
);

const log = console.log.bind(console);

Expand Down
2 changes: 1 addition & 1 deletion packages/testharness/src/jobs.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import createDeferred from 'p-defer';
import createDeferred from 'p-defer-es5';

import uniqueId from './utils/uniqueId';

Expand Down
2 changes: 2 additions & 0 deletions packages/testharness/src/pageObjects/wait.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import AbortController from 'abort-controller-es5';

import sleep from '../utils/sleep';

export default async function wait(condition, timeout = 2000) {
Expand Down
Loading

0 comments on commit dea095e

Please sign in to comment.