Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump webpack and remove event-target-shim #5156

Merged
merged 3 commits into from May 2, 2024
Merged

Bump webpack and remove event-target-shim #5156

merged 3 commits into from May 2, 2024

Conversation

compulim
Copy link
Contributor

@compulim compulim commented May 2, 2024

Fixes #5155.

Changelog Entry

Known issues

  • Web Chat is not loading with error Uncaught TypeError: Super constructor null of anonymous class is not a constructor

Fixed

Changed

Description

webpack@5.84.1 has a bug that marked event-target-shim to be "unused pure superclass". We are on webpack@5.89.0 and is experiencing the bug.

Our recent ESM work (#5148) emits minified code in our package tarball and expose the issue in Webpack. For example:

var ABC = class extends XYZ {}, abc = new ABC();

Webpack will re-emit it as following and marked the XYZ superclass as "unused pure":

var ABC = class extends (null && XYZ) {}, abc = new ABC();

Despite our E2E tests use CDN bundle, we did not catch this issue in PR validation because it will only repro on production build. In other words, it only repro on NODE_ENV=production npm run build.

Design

While we are working on the issue, we thought it was related to event-target-shim. Since we dropped IE11 support, we no longer need majority functionality of event-target-shim, we replaced it with our own createOnEventShim.

We continue to keep this replacement work as it will reduce our bundle size.

Specific Changes

  • Bump to webpack@5.91.0
  • Removed event-target-shim and replaced with createOnEventShim
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review May 2, 2024 01:08
@compulim compulim merged commit a8ff179 into main May 2, 2024
25 checks passed
@compulim compulim deleted the bump-webpack branch May 2, 2024 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CDN bundle (UMD build) is broken due to bug in Webpack 5.89
2 participants