microsoft / microsoft/BotFramework-WebChat

Better polyfilling for IE11 in NPM

Open
#2,511 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

backlog community-help-wanted feature-request
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

Feature request

Currently, the polyfilling story isn't great on NPM via create-react-app.

One approach is to follow what create-react-app does. To make CRA works in IE11, you will need to import 'react-app-polyfill/ie11'; and it will bring all polyfills required to make the CRA app works in IE11.

We could do something similar with:

import 'botframework-webchat/ie11';
import { ReactWebChat } from 'botframework-webchat';

Or

import 'botframework-webchat-polyfill/ie11';
import { ReactWebChat } from 'botframework-webchat';

Also, it seems Set does not need to be polyfilled.

Update from 2021-12-14

We should use @babel/plugin-transform-runtime and configure @babel/preset-env with useBuiltIns: "usage" to inline polyfills (a.k.a. ponyfills).

  • Add breaking changes: fetch is no longer polyfilled when using <script> tag to load Web Chat

For NPM install, we should do some investigations, goals:

  • Import botframework-webchat will work on IE11 or older browsers without significant work on bundler configuration
    • Chrome 85 introduced String.prototype.replaceAll
  • Ponyfills should not be leaked

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing packages/bundle/src/index-es5.ts and the current NPM import behavior, then compare the CRA and Babel approaches described in the issue. Done means the documented botframework-webchat import works for IE11 or older browsers without significant bundler configuration, while ponyfills do not leak; the issue also calls out a fetch change for script-tag usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript, react
Domain
build-system, frontend, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.