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

Bundle ShikiJS for Webpack 4 #5349

Merged
merged 3 commits into from
Nov 5, 2024
Merged

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Nov 5, 2024

Fixed #5350.

Changelog Entry

Fixed

Description

regex only has named export. However, Webpack 4 cannot import named export in CommonJS mode.

We need to temporarily bundle shiki, @shikijs/*, oniguruma-to-js and regex in botframework-webchat-component.

It is okay to keep named import in src/Attachment/Text/private/shiki.ts as we will be bundling code directly.

Design

Specific Changes

  • Bundle shiki and its dependency chain in botframework-webchat-component by marking shiki as noExternal
  • 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 November 5, 2024 07:02
@compulim compulim merged commit a49da14 into microsoft:main Nov 5, 2024
25 checks passed
@compulim compulim deleted the fix-webpack4 branch November 5, 2024 16:07
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.

Webpack 4 cannot resolve regex used by @shikijs/engine-javascript and onikumura-to-js
2 participants