Commit Graph

113 Commits

Author SHA1 Message Date
Evan You d7379c7647 fix(runtime-core): fix key/ref resolution for cloneVNode
fix #1041
2020-04-24 12:42:46 -04:00
Evan You dcf2458fa8 fix(runtime-core): fix dynamic node tracking in dynamic component that resolves to plain elements
fix #1039
2020-04-24 12:18:51 -04:00
Evan You 19223f5462 build: remove __BUNLDER__ flag so that HMR is available for all builds 2020-04-20 13:39:47 -04:00
Evan You 09b4202a22 refactor(reactivity): adjust APIs
BREAKING CHANGE: Reactivity APIs adjustments:

- `readonly` is now non-tracking if called on plain objects.
  `lock` and `unlock` have been removed. A `readonly` proxy can no
  longer be directly mutated. However, it can still wrap an already
  reactive object and track changes to the source reactive object.

- `isReactive` now only returns true for proxies created by `reactive`,
   or a `readonly` proxy that wraps a `reactive` proxy.

- A new utility `isProxy` is introduced, which returns true for both
  reactive or readonly proxies.

- `markNonReactive` has been renamed to `markRaw`.
2020-04-15 16:45:20 -04:00
Evan You 4046f0bc03 chore: revert debugging dev flag 2020-04-14 18:32:27 -04:00
Evan You 2e06f5bbe8 feat(runtime-core): detect and warn against components made reactive
close #962
2020-04-14 18:07:47 -04:00
Evan You cb504c287f refactor(runtime-core): refactor slots resolution
Get rid of need for setup proxy in production mode and improve console
inspection in dev mode
2020-04-06 21:06:53 -04:00
Evan You c5f0f63b91 refactor(runtime-core): make setup attrs proxy dev only 2020-04-06 17:57:27 -04:00
Evan You ec4a4c1e06 refactor(runtime-core): refactor props resolution
Improve performance in optimized mode + tests
2020-04-06 17:37:47 -04:00
Evan You eee5095692 refactor: rename `<portal>` to `<teleport>`
BREAKING CHANGE: `<portal>` has been renamed to `<teleport>`.

    `target` prop is also renmaed to `to`, so the new usage will be:

    ```html
    <Teleport to="#modal-layer" :disabled="isMobile">
      <div class="modal">
        hello
      </div>
    </Teleport>
    ```

    The primary reason for the renaming is to avoid potential naming
    conflict with [native portals](https://wicg.github.io/portals/).
2020-04-01 21:55:19 -04:00
Evan You 8ce3da0104 feat(portal): support disabled prop 2020-03-30 11:24:28 -04:00
Evan You aafb880a0a feat(portal): support multiple portal appending to same target 2020-03-27 18:42:57 -04:00
Evan You bfae9b2e55 types: fix createVNode dts generation 2020-03-23 17:36:19 -04:00
Evan You 455a1534c9 refactor: transformHArgs -> transformVNodeArgs 2020-03-23 16:54:28 -04:00
Evan You f529dbde23 fix: dynamic component fallback to native element
fix #870
2020-03-23 14:47:04 -04:00
Evan You b8c1be18f3 refactor(types): use stricter settings
fix #847
2020-03-23 11:08:22 -04:00
Evan You ba9a91c48c refactor: remove null comparisons 2020-03-18 18:14:51 -04:00
Evan You aa4ab39c1a refactor: separate vnode hooks and directive hooks 2020-03-18 12:30:26 -04:00
Evan You 6679799540 refactor: refactor vnode hooks invocation 2020-03-18 12:30:26 -04:00
Evan You 9ad65b1653 refactor(template-ref): improve template ref handling
close #836, close #839
2020-03-16 13:06:46 -04:00
Evan You 8a58dce603 feat(runtime-core): set context for manual slot functions as well 2020-03-16 13:06:46 -04:00
djy0 58bc51991e
chore(runtime-core): fix typo in warning (#841) [ci skip] 2020-03-15 11:29:21 -04:00
Evan You eb1d538ea2 test(ssr): hydration suspense tests 2020-03-13 13:05:05 -04:00
Evan You a3cc970030 feat(ssr/suspense): suspense hydration
In order to support hydration of async components, server-rendered
fragments must be explicitly marked with comment nodes.
2020-03-13 13:05:05 -04:00
Katashin dd17fa1c90
feat(runtime-core): add special property to get class component options (#821) 2020-03-12 11:46:32 -04:00
Cédric Exbrayat 28a9beed16
fix(runtime-core): always set invalid vnode type (#820)
Currently, when a component used is not properly registered, we have a warning and the vnode type is set to a Comment type in DEV mode. But in prod mode, we have no default value, making such an application broken and throw a strange error (`can not read _isSuspense of undefined`).

This commit avoids such an error in prod mode (as it is currently the case in Vue 2.x).
2020-03-11 16:44:14 -04:00
djy0 54a0e93c27
fix(runtime-core): should allow empty string and 0 as valid vnode key (#807) 2020-03-09 16:03:57 -04:00
Evan You e1660f4338 refactor(runtime-core): adjust attr fallthrough behavior
BREAKING CHANGE: adjust attr fallthrough behavior

    Updated per pending RFC https://github.com/vuejs/rfcs/pull/137

    - Implicit fallthrough now by default only applies for a whitelist
      of attributes (class, style, event listeners, a11y attributes, and
      data attributes).

    - Fallthrough is now applied regardless of whether the component has
      explicitly declared props. (close #749)
2020-02-28 17:53:26 -05:00
Evan You 9d2ac6675a refactor: make portal tree-shakeable 2020-02-15 17:44:37 -05:00
Evan You 6df2aca070 refactor(types): move shapeFlags to shared 2020-02-14 01:36:42 -05:00
Evan You 9aaef60ad2 wip(ssr): adjust event hydration flag 2020-02-13 18:28:40 -05:00
Evan You 6b505dcd23 wip(ssr): basic element hydration 2020-02-13 17:47:00 -05:00
Evan You 27913e661a feat(compiler-dom/runtime-dom): stringify eligible static trees 2020-02-12 11:56:42 -05:00
Evan You e3988b40d8 refactor(compiler-core): use dedicated node type for element codegen
Previously codegen node for elements and components used raw expressions,
which leads to multiple permutations of AST shapes based on whether the
node is a block or has directives. The complexity is spread across the
entire compiler and occurs whenever a transform needs to deal with
element codegen nodes.

This refactor centralizes the handling of all possible permutations
into the codegen phase, so that all elements/components will have a
consistent node type throughout the transform phase.

The refactor is split into two commits (with test updates in a separate
one) so changes can be easier to inspect.
2020-02-11 18:40:42 -05:00
Evan You 12fcf9ab95 fix(compiler): fix v-for fragment openBlock argument 2020-02-10 18:19:49 -05:00
Evan You 6e06810add test(ssr): tests for utils and props rendering 2020-01-29 15:10:45 -05:00
Evan You 6b1ce00621 wip(ssr): renderer support for optimized and manual slots 2020-01-28 22:58:02 -05:00
Evan You 012bc5df9d wip(ssr): restructure 2020-01-27 17:23:42 -05:00
likui ec63623fe8 fix: Suspense should include into dynamic children (#653)
fix #649
2020-01-22 10:45:27 -05:00
Evan You 84dc5a6862 fix(runtime-core/vnode): should not render boolean values in vnode children (close #574) 2020-01-06 11:57:19 -05:00
Evan You 7d436ab59a fix: mounting new children 2019-12-22 16:24:24 -05:00
Evan You 47a6a84631 fix(core): clone mounted hoisted vnodes on patch
...since they may need to be checked as fragment child
2019-12-22 13:31:13 -05:00
Evan You eda495efd8 feat(hmr): root instance reload 2019-12-22 12:25:04 -05:00
Evan You 69c9dbc825 feat(sfc): scopeId runtime support 2019-12-17 12:31:38 -05:00
Evan You f77ae132e5 feat(hmr): reload and force slot update on re-render 2019-12-12 21:09:47 -05:00
meteorlxy f3007a6b4f fix(core): use String to convert primitive types (#518) 2019-12-04 18:28:52 +01:00
Evan You a834807942 refactor: rename transition components 2019-11-24 16:00:46 -05:00
Evan You 5c691aebfd feat(transition): handle cancel hooks 2019-11-22 17:10:17 -05:00
Evan You 79f23a2f77 feat(transition): support component child 2019-11-20 22:46:32 -05:00
Evan You 93561b080e feat(transition): base transition component 2019-11-20 22:46:32 -05:00