IE11 Support for amazon-connect-chatjs

I recently built a chat widget that supports Amazon Connect Chatbot with amazon-connect-chatjs. It turned out the library does not support IE11 (see the issue I raised here). The good news is that if we add polyfills, we can make it work. AWS will probably update the library with IE support in the future. But for now, you need to include polyfills below.

If you want to include it in the bundle, you can just install core-js.

import 'core-js/features/promise';
import 'core-js/features/array/from';
import 'core-js/features/object/assign';
import 'core-js/features/object/values';
import 'core-js/es/set';

The hardest one to figure out was Array.from. In IE11, if you do Array.from(new Set([1, 2, 3]), it gives back the empty array without error. This is what is used to get the message in onMessage().

I personally think being able to support IE is one of the most critical front end skills. It is probably more important than using cutting-edge JS tricks that only work for Chrome because a lot of companies still want to support IE11. Some people hate it, but I had a lot of fun figuring this out!

For further information regarding adding polyfills in TypeScript bundle, check out this post

Front-End
Unable to Get Local Issuer Certificate for installing Npm Modules

unable to get local issuer certificate error with yarn install from a private npm repository (such as JFrog), you can try running this command: yarn config set “strict-ssl” false yarn install Error message example error An unexpected error occurred: “https://npco.jfrog.io/artifactory/api/npm/npm-mdh/@mdh/my-library/-/@mdh/my-library-3.21.0.tgz: unable to get local issuer certificate”.

Front-End
Moving away from React.FC and React.VFC

Since the release of React 18, VFC has been deprecated. FunctionalComponent (FC) does not have implicit children any more. See this pull request. It states: Since the release of the React 18 types we haven’t seen any use case for FunctionComponent with implicit children beyond "it breaks existing stuff". As …

Front-End
How to fix react-day-picker flickering hover state between mouseenter and mouseleave

I had an issue with react-day-picker flickering hover state between mouseenter and mouseleave when the cursor was on the edge of the day I was trying to select. This is not a bug in the library. It was the custom style I added to the hover state that was causing …