vuejs/vue-vapor

optimize the production build results

Open

#292 opened on Nov 19, 2024

View on GitHub
 (3 comments) (1 reaction) (0 assignees)TypeScript (115 forks)auto 404
good first issueperformancetodo

Repository metrics

Stars
 (2,392 stars)
PR merge metrics
 (PR metrics pending)

Description

Note that this is not a real bug, just an optimization item.

see Playground

It seems no need to wrap it as an IIFE.

setup(__props) {
  const msg = ref('Hello World!')
  return ((_ctx) => {
    const n0 = t0()
    _setInheritAttrs(false)
    _renderEffect(() => _setText(n0, msg.value))
    return n0
  })()
}

better is:

setup(__props) {
  const msg = ref('Hello World!')
  const n0 = t0()
  _setInheritAttrs(false)
  _renderEffect(() => _setText(n0, msg.value))
  return n0
}

Contributor guide