-
Notifications
You must be signed in to change notification settings - Fork 8
Upgrade Kapa SDK #311
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
Upgrade Kapa SDK #311
Conversation
✅ Deploy Preview for docs-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThe changes update the JavaScript build process in two main areas. First, the handling of vendor bundle files is adjusted so that Sequence Diagram(s)Updated React Bundling Flow with esbuildsequenceDiagram
participant GulpTask as Gulp Task
participant Glob as glob
participant esbuild as esbuild
participant FS as File System
GulpTask->>Glob: Find all .js/.jsx files in srcDir
Glob-->>GulpTask: Return list of entry files
GulpTask->>FS: Ensure destDir exists
loop For each entry file
GulpTask->>esbuild: Build file with options (bundle, minify, sourcemap, etc.)
alt Build succeeds
esbuild-->>GulpTask: Success
GulpTask->>FS: Write output file to destDir
else Build fails
esbuild-->>GulpTask: Error
GulpTask->>GulpTask: Log error
end
end
GulpTask-->>GulpTask: Complete when all builds finish
Suggested reviewers
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Nitpick comments (2)
gulp.d/tasks/build.js (1)
69-75: LGTM! Consider documenting why sorttable.js needs special handling.The implementation correctly excludes
sorttable.jsfrom minification. This is a clean approach when dealing with vendor scripts that don't work correctly when minified.Consider adding a comment explaining why
sorttable.jsrequires special handling (e.g., minification breaks functionality, relies on specific formatting, etc.) to help future maintainers understand this exception.gulp.d/tasks/bundle-react.js (1)
19-19: Consider using async glob for consistency.Since the function is async, consider using the async version of glob to avoid blocking:
- const entries = glob.sync(path.join(srcDir, '**/*.{js,jsx}')) + const { glob } = require('glob') + const entries = await glob(path.join(srcDir, '**/*.{js,jsx}'))
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
gulp.d/tasks/build.js(1 hunks)gulp.d/tasks/bundle-react.js(1 hunks)package.json(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
gulp.d/tasks/build.js (1)
gulp.d/tasks/build-preview-pages.js (1)
vfs(12-12)
gulp.d/tasks/bundle-react.js (2)
gulp.d/tasks/build.js (3)
require(17-17)path(11-11)fs(7-7)gulpfile.js (7)
require(3-3)require(7-7)glob(22-26)path(8-8)log(6-6)srcDir(15-15)destDir(16-16)
🔇 Additional comments (2)
package.json (1)
26-26: Verify breaking changes in @kapaai/react-sdk upgradeThe bump from
^0.0.3to^0.3.0likely includes breaking API changes—please confirm that all usages in your code match the new version’s API:• src/js/react/AskAI.jsx
– ImportedKapaProvider—verify its required props (e.g., config shape, required keys) haven’t changed.
• src/js/react/components/ChatInterface.jsx
– ImporteduseChathook—check whether its signature or returned values (methods, state) differ in v0.3.0.Review the SDK’s changelog or docs for any renamed exports, changed hook parameters, or updated initialization patterns and update these components accordingly.
gulp.d/tasks/bundle-react.js (1)
9-17: Excellent documentation!The JSDoc comments clearly describe the function's purpose, parameters, and return value. The async function signature is appropriate for the esbuild operations.
Docstrings generation was requested by @JakeSCahill. * #311 (comment) The following files were modified: * `gulp.d/tasks/bundle-react.js`
|
Note Generated docstrings for this pull request at #312 |
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Docstrings generation was requested by @JakeSCahill. * #311 (comment) The following files were modified: * `gulp.d/tasks/bundle-react.js` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This pull request introduces significant updates to the build system by adopting
esbuildfor React bundling, improving the handling of JavaScript vendor files, and updating dependencies inpackage.json.The migration to
esbuildfor React components was necessary because the latest@kapaai/react-sdkpackage uses dependencies that require ES modules support, which Browserify doesn't handle well. This hybrid approach gives us:This change supports our ongoing efforts to modernize our documentation UI while maintaining compatibility with our existing components and libraries.
Build System Improvements
browserifyandbabelifywithesbuildfor bundling React components ingulp.d/tasks/bundle-react.js. This change simplifies the build process, adds support for modern JavaScript features, and improves build performance. The new implementation also ensures compatibility with JSX and includes sourcemap generation.gulp.d/tasks/build.jsfile to handlesorttable.jsseparately without applyinguglify, ensuring better flexibility for specific vendor files.Dependency Updates
@asciidoctor/tabsfrom^1.0.0-beta.5to^1.0.0-beta.6and@kapaai/react-sdkfrom^0.0.3to^0.3.0inpackage.json. These updates bring in the latest features and fixes.esbuildas a new dependency inpackage.jsonto support the updated React bundling process.