Conversation
WalkthroughThe changes involve modifications to the build process within the Changes
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (4)
Files skipped from review as they are similar to previous changes (3)
Additional context usedLanguageTool
Markdownlint
Additional comments not posted (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
owenpearson
left a comment
There was a problem hiding this comment.
Looks good so far, couple of suggestions. Also, worth updating the README as part of this PR?
Yeah, good idea. Will add the section to Push plugin about using it from CDN |
f8bdf9d to
f6dfaaa
Compare
|
Added readme in a80ff5f |
f6dfaaa to
a80ff5f
Compare
See internal slack discussion: https://ably-real-time.slack.com/archives/CURL4U2FP/p1723454752656739.
We can't use existing push plugin build output as it has
ulidas external and it tries to import it as a commonjs module. Found the reasoning for this here, with ref to the esbuild docs:This means that for the use of push plugin via script tag from CDN, we would need to either polyfill the
requirecall, or add some wrapper/replacerequire('ulid')call withwindow.ulid(potentially doable with https://github.com/yanm1ng/esbuild-plugin-external-global#readme, but quick test locally didn't produce expected result - it end up callingrequireanyway).All of the above would mean having a separate file for push plugin for CDN use anyway, so at this point it's just easier to bundle
ulidtogether with push plugin for CDN specifically, and publish that.This way CDN users get easy use of the Push plugin (no need to also include
ulidvia CDN), and users that use npm still have access to the push plugin file without extra code (saves ~1kb gzipped).Summary by CodeRabbit
New Features
Bug Fixes
Performance Improvements