Repository navigation
fix (html5): Limit html5 to generate one single bundle (no more chunks) to make it work in Safari 15 - #22817
Conversation
|
Caution Review failedAn error occurred during the review process. Please try again later. WalkthroughThe pull request modifies the Webpack configuration by adding the Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant WP as Webpack Build Process
participant Plugin as LimitChunkCountPlugin
Dev->>WP: Run build command
WP->>Plugin: Apply chunk limit (maxChunks: 1)
Plugin-->>WP: Enforce single chunk output
WP->>Dev: Output bundled application (1 chunk)
Suggested reviewers
🪧 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 (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
bigbluebutton-html5/webpack.config.js (1)
33-35: Consider making the chunk limit Safari-specific.The LimitChunkCountPlugin is being applied to all browser targets, which increases the bundle size for all users. Since the issue is Safari-specific, consider moving this plugin to the Safari-specific part of the configuration to maintain optimal loading for other browsers.
const config = { entry: './client/main.tsx', output: { filename: isSafariTarget ? 'bundle.safari.js' : 'bundle.[fullhash].js', path: path.resolve(__dirname, 'dist'), publicPath: '', }, cache: { type: 'filesystem', allowCollectingMemory: true, maxAge: 86400000, }, devtool: 'source-map', plugins: [ - new webpack.optimize.LimitChunkCountPlugin({ - maxChunks: 1, - }), new HtmlWebpackPlugin({ // ... }), // Other plugins... ], // ... }; if (env === prodEnv) { config.mode = prodEnv; config.optimization = { minimize: true, minimizer: isSafariTarget ? [] : [new TerserPlugin()], }; + if (isSafariTarget) { + config.plugins.push( + new webpack.optimize.LimitChunkCountPlugin({ + maxChunks: 1, + }) + ); + } // ... }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
bigbluebutton-html5/webpack.config.js(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: build-package (others)
- GitHub Check: build-package (bbb-html5)
- GitHub Check: build-package (bbb-graphql-server)
- GitHub Check: build-package (bbb-playback-record)
🔇 Additional comments (1)
bigbluebutton-html5/webpack.config.js (1)
33-35: Confirm cross-browser testing has been completed.This change significantly alters how the application is bundled, which could impact loading behavior across different browsers and network conditions. While it fixes the Safari 15 issue, ensure thorough testing has been conducted across all supported browsers.
Have you confirmed that this change works correctly in all supported browsers, especially under different network conditions?
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
bigbluebutton-html5/webpack.config.js (1)
130-131: Appropriate performance limits adjustment.Increasing the
maxAssetSizeandmaxEntrypointSizefrom 6MB to 8MB is necessary to accommodate the larger bundle size (expected to grow from 5.6MB to 6.8MB as mentioned in the PR description). This change properly addresses the performance warnings concern raised in previous reviews.Consider setting up monitoring for bundle size growth over time to ensure it doesn't exceed these new limits in future iterations.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
bigbluebutton-html5/webpack.config.js(2 hunks)
🔇 Additional comments (1)
bigbluebutton-html5/webpack.config.js (1)
33-35: Good solution for Safari 15 compatibility.Adding the
LimitChunkCountPluginwithmaxChunks: 1successfully addresses the Safari 15 issue by forcing webpack to generate a single bundle instead of multiple chunks. This aligns perfectly with the PR objective of eliminating the naming mismatch that caused "Loading chunk" errors in Safari.
|
Automated tests Summary✅ All the CI tests have passed! |
Mermaid, which the diagram block needs, is most of what the equation and diagram blocks add to the client: with it in the bundle, bundle.js grew from 9.46 MB to 13.20 MB (2.30 MB to 3.29 MB gzipped) for every user. `mermaid` now resolves to a small stand-in that imports the real package the first time a diagram is parsed or rendered. The regular build emits Mermaid as separate chunks again; every other dynamic import stays in the bundle (`dynamicImportMode: 'eager'`), as it has since chunks were limited to one in bigbluebutton#22817. The Safari 14-15 build keeps that limit, so it remains a single file with Mermaid inside. Mermaid ships class static blocks, which Safari parses only from 16.4: in a single bundle they kept the whole client from loading there. Mermaid is now compiled for Safari 14 in both builds. The diagram e2e test checks that both participants download Mermaid only once a diagram is drawn.
Mermaid, which the diagram block needs, is most of what the equation and diagram blocks add to the client: with it in the bundle, bundle.js grew from 9.46 MB to 13.20 MB (2.30 MB to 3.29 MB gzipped) for every user. `mermaid` now resolves to a small stand-in that imports the real package the first time a diagram is parsed or rendered. The regular build emits Mermaid as separate chunks again; every other dynamic import stays in the bundle (`dynamicImportMode: 'eager'`), as it has since chunks were limited to one in bigbluebutton#22817. The Safari 14-15 build keeps that limit, so it remains a single file with Mermaid inside. Mermaid ships class static blocks, which Safari parses only from 16.4: in a single bundle they kept the whole client from loading there. Mermaid is now compiled for Safari 14 in both builds. The diagram e2e test checks that both participants download Mermaid only once a diagram is drawn.



Since #22764, the client has been generating two separate bundles. To ensure the Safari bundle uses the same hash as the standard bundle, we renamed it—but the script still tries to load chunks using the old bundle name, causing an error.
This PR updates the webpack config to generate a single bundle (no extra chunks). This resolves the naming mismatch and avoids runtime errors.
The standard bundle size increases from
5.6MBto6.8MB, but this tradeoff may be beneficial, as it avoids downloading additional chunks during a meeting—potentially improving performance.Issue: