From 42d8cbdba5dd640df5b2f0384dddc0fa8cd11c25 Mon Sep 17 00:00:00 2001 From: Aleksandr Elkin Date: Fri, 19 May 2023 18:12:44 +0200 Subject: [PATCH 1/2] feat(PATCH-430): upgrade dependencies to latest --- .browserslistrc | 2 +- .github/workflows/main.yml | 6 +- .nvmrc | 2 +- README.md | 74 +- package-lock.json | 18148 +++++++++++++++--------- package.json | 44 +- rollup.config.js => rollup.config.mjs | 26 +- src/app.js | 14 +- src/hub.js | 13 +- src/log.js | 2 +- src/msg.js | 2 +- src/polyfills.js | 6 + test/tasks/browserstack.desktop.json | 64 +- test/tasks/test-runner.js | 7 +- 14 files changed, 11209 insertions(+), 7201 deletions(-) rename rollup.config.js => rollup.config.mjs (71%) create mode 100644 src/polyfills.js diff --git a/.browserslistrc b/.browserslistrc index cb8b7388..9f480c5e 100644 --- a/.browserslistrc +++ b/.browserslistrc @@ -1,7 +1,6 @@ last 2 Chrome versions last 2 ChromeAndroid versions last 2 Edge versions -IE 11 last 2 Firefox versions last 2 FirefoxAndroid versions last 2 iOs versions @@ -10,3 +9,4 @@ last 2 OperaMobile versions last 2 Safari versions last 2 Samsung versions not dead +IE 11 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1eff75f2..dedb54cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,12 +13,12 @@ jobs: timeout-minutes: 30 steps: - name: ⬇️ Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: ⎔ Setup node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: 14 + node-version-file: .nvmrc cache: 'npm' - name: 📥 Download deps diff --git a/.nvmrc b/.nvmrc index da2d3988..3c032078 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -14 \ No newline at end of file +18 diff --git a/README.md b/README.md index 92c83153..d3a14e19 100644 --- a/README.md +++ b/README.md @@ -41,25 +41,25 @@ const app = io(); // Spawn an App: (async () => { - // Do the actual spawn call - const [err, data] = await app.spawn(targetApp, targetData); - - if (err) { - // Something went horribly wrong while spawning app - } else { - doSomethingWith(data); - } + // Do the actual spawn call + const [err, data] = await app.spawn(targetApp, targetData); + + if (err) { + // Something went horribly wrong while spawning app + } else { + doSomethingWith(data); + } })(); // Allow your app to be spawned by others: app.define({ - async spawn(data) { - // Wait for user input here... - const userData = await myPrompt(); + async spawn(data) { + // Wait for user input here... + const userData = await myPrompt(); - // Send response back to parent - return userData; - } + // Send response back to parent + return userData; + } }); ``` @@ -83,17 +83,17 @@ import io from '@tradeshift/io'; const app = io(); app.define({ - async spawn(data) { - // CODE HERE: Animate opening your UI and wait for user input. + async spawn(data) { + // CODE HERE: Animate opening your UI and wait for user input. - // Wait for user input here... - const userData = await myPrompt(); + // Wait for user input here... + const userData = await myPrompt(); - // CODE HERE: Animate closing your UI. + // CODE HERE: Animate closing your UI. - // Send response back to parent - return userData; - } + // Send response back to parent + return userData; + } }); ``` @@ -101,10 +101,10 @@ Callback based Spawn handler if you prefer: ```js app.define({ - spawn(data, submit, parent) { - // Send response back to parent - submit(userData); - } + spawn(data, submit, parent) { + // Send response back to parent + submit(userData); + } }); ``` @@ -123,10 +123,10 @@ const app = io(); */ // Listen to all events sent to my App -app.on('*', event => {}); +app.on('*', (event) => {}); // Listen to events for a specific topic (sent to my App) -const myListener = event => {}; +const myListener = (event) => {}; const myTopic = 'my-topic'; const unlisten = app.on(myTopic, myListener); // Stop listening @@ -146,21 +146,21 @@ app.emit('fly-high', { flameColor: 'red' }, 'Tradeshift.FlamingSkull'); ```js (async () => { - const [err, response] = await app1.emit('topic-with-request', 'App2', data); - if (err) { - // Something went horribly wrong while emitting - } else { - doSomethingWith(response); - } + const [err, response] = await app1.emit('topic-with-request', 'App2', data); + if (err) { + // Something went horribly wrong while emitting + } else { + doSomethingWith(response); + } })(); app1.emit('topic-with-request', 'App2', data); app1.emit('topic-without-request', 'App2', data); -app2.on('topic-with-request', event => { - return 'my-response'; +app2.on('topic-with-request', (event) => { + return 'my-response'; }); -app2.on('topic-without-request', event => {}); +app2.on('topic-without-request', (event) => {}); ```