This repository was archived by the owner on Sep 3, 2022. It is now read-only.
Tags: composi/core
Tags
Minor updates to h, createVNode and patch functions. 1. Simplified childNodes assignment in h function. 2. Removed unnecessary parameter in createVNode call. 3. createVNode now has default values of null for key and flag parameters. 4. Updated tests to reflect changes in h function. 5. Instead of assigning default value to createVNode function inside its body, moved assignment as default value in the call signature itself. 6. Marked flag parameter as optional.
Refined VNode comparison for better exists. 1. Created new property on container: previousVNode. This contains a clone of the previous VNode before patching. This means its element properties all have null values, same as a newly provided VNode would. 2. The patchElement function in vdom.js now check the container's previousVNode property to check with the provided VNode from render. If the two objects are identical, it exists. Before this didn't happen because the default vnode property on the container has references to DOM elements from the last patch.
Added error checking for when user provides invalid container for ren… …der function. 1. Composi will now log an error and bail when an invalid container argument is used with the render function. 2. Will output an error message detailing the reason for failure to render, along with the selector used.
PreviousNext