refactor(compiler-vapor): Should perform safety check for simple expressions in events.#14815
refactor(compiler-vapor): Should perform safety check for simple expressions in events.#14815jackma9604 wants to merge 1 commit into
Conversation
…essions in events.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
Size ReportBundles
Usages
|
|
Thanks for this PR, but I don't think this is necessary. VDOM needs Vapor does not need this because it does not have the same |
This adjustment is made to maintain consistency with the behavior of simple expressions for events in vdom mode.
html
<button @click="onClick">Button</button>vdom after compilation
onClick: _cache[0] || (_cache[0] = (...args) => (_ctx.onClick && _ctx.onClick(...args)))vapor after compilation
n0.$evtclick = _createInvoker(e => _ctx.onClick(e))If onClick is not defined, an error will occur after the click event
Adjusted vapor compilation result
n0.$evtclick = _createInvoker(e => (_ctx.onClick && _ctx.onClick(e)))see: Playground