feat: return app instance from init functions#1680
Conversation
WalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/design-core/src/preview/src/main.js (1)
33-34: LGTM! Consider adding JSDoc documentation for consistency.The implementation correctly returns the Vue app instance after mounting, consistent with the
initfunction changes.Consider adding JSDoc documentation for consistency:
+/** + * Initialize the TinyEngine preview application + * @param {Object} options - Initialization options + * @param {Array|Object} options.registry - Custom registry configuration + * @param {Object} [options.lifeCycles={}] - Lifecycle hooks + * @returns {App} The Vue application instance + */ export const initPreview = ({ registry, lifeCycles = {} }) => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/design-core/src/init.js(1 hunks)packages/design-core/src/preview/src/main.js(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
packages/design-core/src/init.js (1)
packages/design-core/src/preview/src/main.js (1)
app(28-28)
packages/design-core/src/preview/src/main.js (1)
packages/design-core/src/init.js (1)
app(148-148)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: push-check
🔇 Additional comments (1)
packages/design-core/src/init.js (1)
154-155: Implementation verified—return statement correctly returns Vue app instance after initialization.Verification confirms no TypeScript definition files exist in packages/design-core, so type definitions do not require updating. The implementation is correct and enables callers to perform additional operations or access app configuration after initialization.
English | 简体中文
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Background and solution
What is the current behavior?
从 init 方法中,返回应用实例,支持使用实例进行更多扩展的场景。
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
initandinitPreviewfunctions now return the Vue app instance after mounting, enabling access to the initialized app for further configuration.