64 Commits

Author SHA1 Message Date
Dylan Piercey
c0643c8bca
Fix issue with removing children inside of fragments (#1359) 2019-06-18 10:28:22 -07:00
Andrew Gliga
af95c09e94
Merge branch 'master' of github.com:marko-js/marko into body-only-if-tag 2019-06-06 12:20:36 -07:00
Dylan Piercey
6b5ed8574e
Fix issue with setting textarea value to false (#1348) 2019-06-05 14:05:58 -07:00
Dylan Piercey
eaa7024720
Improve for loop auto keying (#1346) 2019-06-05 11:29:29 -07:00
Dylan Piercey
f1744b95d9
Fix and deprecate passing a non string key (#1344) 2019-06-05 11:28:58 -07:00
Michael Rawlings
4a73060bc6 Cleanup tests (#1341)
Cleanup tests and add assertions that all deprecated tests log warnings, and all non deprecated tests don't.
2019-05-28 10:54:31 -07:00
Dylan Piercey
25d29b10e0
Fix regression with namespace inside of a fragment (#1340) 2019-05-21 18:09:40 -07:00
Dylan Piercey
197f3ff718
Register components before mounting (#1336)
* Register components before mounting
2019-05-21 14:08:14 -07:00
Dylan Piercey
4cdc807b3b
Walk nested fragments for getEl (#1339) 2019-05-21 14:07:54 -07:00
Dylan Piercey
e065c140ff
Namespace fixes (#1333)
* Calculate namespace on actualize
2019-05-20 13:13:51 -07:00
Michael Rawlings
a2153d2c66 Fix preserve (#1334)
* use scoped keys when adding to the global preserve lookup, fixes key collision issue
2019-05-17 09:48:37 -07:00
Andrew Gliga
6e30730d11
Fixed null rendering to use fragment 2019-05-14 11:23:54 -07:00
Dylan Piercey
c59b95453c
Allow macros with tag params to be implicit components (#1326) 2019-05-13 12:41:40 -07:00
Andrew Gliga
053f01ff44 Fixed tests and rendering of null tag 2019-05-13 09:10:57 -07:00
Andrew Gliga
458ae1b85a
Added null tag to render body 2019-05-10 13:34:39 -07:00
Michael Rawlings
3143990d95
fix destorying a component that has already removed some top-level nodes (#1321) 2019-04-22 14:19:43 -07:00
Michael Rawlings
101c5c6bb8
refactor to better separate compiler/taglib/core-tags/runtime (#1319)
* refactor out taglib loader/finder/lookup

* add comments for taglib apis that we need to deprecate

* move components into runtime/core-tags
2019-04-16 13:34:26 -07:00
Dylan Piercey
070b09becd
Fix issue with hydrating nested fragments that are adjacent in the dom (#1294) 2019-03-19 16:08:37 -07:00
Dylan Piercey
2f54313613
Fix regression for no-update on dynamic tag html attributes (#1292)
* Fix regression for no-update on dynamic tag html attributes
2019-03-15 13:00:47 -07:00
Dylan Piercey
95c515e66f
Fix function as event handler when server side rendering (#1262) 2019-02-15 15:49:08 -08:00
Michael Rawlings
7fefb6b4b3 fix no-update when nodes don't match up during diff (#1247) 2019-01-29 13:55:35 -08:00
Michael Rawlings
75f1628d99 update to new htmljs-parser which supports pipe params, add flagged tag param migration (#1236)
* update to new htmljs-parser which supports pipe params, add flagged tag param migration
2019-01-17 13:26:59 -08:00
Michael Rawlings
b6443ea1f0 Fixes #1219 - transitive widget getEl and events (#1225) 2019-01-10 11:35:51 -08:00
Michael Rawlings
42e86a3990 add failing tests (#1221) 2019-01-04 14:18:17 -07:00
Michael Rawlings
edd7d8e9b0 w-id migration key only for components (#1217)
* only add id:scoped for html/dynamic tags
2019-01-03 10:55:07 -07:00
Michael Rawlings
5ea9eaa657
Legacy compat updates (#1189)
* legacy: add _isWidget property from marko-widgets@6

* add back legacy method that was not deprecated in marko-widgets

* add data-widget property back to legacy widgets

* fix defineRenderer (legacy) to work with non-widgets as well

* assign id attribute to legacy dom nodes

* allow accessing the parent widget from a legacy child template

* getWidget/s only gets legacy widgets, keep init

* remove call to non-existant api

* don't kick off registration as this causes an issue with circular dependencies in legacy widgets

* add component names in debug mode

* fix keys and this.el in legacy widgets

* ensure widgetconfig object exists for legacy init

* ensure this.el exists before attaching __widget to it

* add back private __document to legacy widgets

* add deprecation warnings
2018-12-10 17:01:55 -08:00
De Oliveira Tristan
1bfe909c36 added scoped link feature (#1172)
* added scoped link feature
* added scoped link to documentation
2018-11-21 13:10:45 -08:00
Dylan Piercey
f77b7e0c5c Prevent input mutation when repeated attribute tags and spread attributes used. (#1142) 2018-10-03 05:10:38 +09:00
Michael Rawlings
12a8b4d06b
Fix component dom insert (#1129) 2018-09-14 13:25:39 -07:00
Michael Rawlings
c4beac5824
Dom data weakmap (#1124)
* Use weakmaps for storing data on dom nodes to avoid name collisions.
2018-09-11 10:42:14 -07:00
Dylan Piercey
25405da669 Add back abiity to get child component element from getEl (#1116) 2018-08-28 16:55:37 -07:00
Michael Rawlings
df79fcc5f0
Diffing/Keying fixes (#1094)
* Updates the diffing algorithm to use an HTMLFragment node as an abstraction rather than keeping track of startNode and endNode all throughout the diffing algorithm.

* Uses the HTMLFragment for the <${dynamic}> tag and <include> tags to preserve server-rendered content for which the renderBody is not available in the browser.

* Component ids are based on the resulting parent tree (not the owner tree). This means we cannot rely on the ids in the global lookup, so component key/refs are now also stored on the component instance.

* Static node trees are now only auto assigned a key for the top-level node (instead of all nodes).

* Server comment starting markers now have the component's key serialized so the component can be attached to its owner

* Server comment markers no longer have the id on the closing marker, it is stack based.

* Normalize differences between hydration and client-rendering, so post mount the DOM looks the same regardless of whether a component was server or client rendered.

* fix matching up fragments when hydrating by taking components and normalized text nodes into account

* remove wrapping divs in test, should no longer be needed.  address hydration issue with alternate fragment matching approach.

* add fragment to dom if there's a parentNode even if no startNode

* add test for mismatched hydration

* don't detach components before moving

* use fragments to preserve renderBody content

* use ___finishFragment as the incomplete fragment marker

* ensure fragments get destroyed properly and dom node key sequences don't continue from previous renders

* use parent/owner terminology in more places, component ids are now parent scoped, key/ref components are attached to their owner for both client + server render, server comment boundaries include the owner and the key in addition to the fully scoped component id, autokeyed dom nodes are attached to their parent, hydration now uses a stack: ids in ending comment nodes not needed, hydration checks to see if a component has been initialized and will attach keys directly to the owner if so

* add mutation guards for text/comment nodes, add mutation guard for input value

* make component-pages test better represent streaming hydration, fix html/head/body hydration in a better/more generic way

* add test for async rendered keyrefs

* add test for repeated mult-level transclusion

* Autokeyed elements are now stored on the parent rather than the owner. User assigned key/refs are still stored on the owner component. Because of this, user assigned keys are now prefixed (with @) to differentiate them from autokeys. This also has the benefit that assigning numeric keys can no longer conflict with the autokeys.

* add re-rendering the intermediate container to one of the new tests
2018-08-27 11:46:47 -07:00
Michael Rawlings
342ddb0084
fix event names with dashes 2018-08-16 12:24:27 -07:00
Dylan Piercey
cd7d93ba3b Add test for nested fragments. (#1107) 2018-08-14 12:56:06 -07:00
Dylan Piercey
e7057f140e Add test for top level transcluded content. (#1108) 2018-08-13 16:03:41 -07:00
Michael Rawlings
168dc9b71e
support functions as event handlers (#1106) 2018-08-07 14:58:47 -07:00
Michael Rawlings
b749da95ed
Use capture for event delegation (#1104)
use delegation for all events
2018-08-06 15:50:55 -07:00
Michael Rawlings
c7b993db08
fix all for loop types (#1091) 2018-07-19 16:47:10 -07:00
Michael Rawlings
7b7e6328bb
fixes #1022 - transcluded keys don't match, stateful component not preserved (#1086) 2018-07-16 13:22:33 -07:00
Michael Rawlings
280f734f70
fixes #1075 - cannot compile dynamic tag at root with user key (#1081) 2018-07-10 13:05:43 -07:00
Michael Rawlings
f5ebda8f2a
Tag params (#1076) 2018-07-10 13:04:46 -07:00
Cameron Braid
d49498cb94 added failing test for #1059 (#1072)
* added failing test for #1059
2018-06-29 13:19:25 -07:00
Michael Rawlings
5fe6cbec2e
fix nextsibiling error caused by components not being removed from lookup (#1068)
* fix nextSibiling error caused by components not being removed from lookup
2018-06-28 15:13:31 -07:00
Dylan Piercey
6d9c11d072 No longer set scoped attributes as default keys. (#1069)
* No longer set scoped attributes as default keys.
* Remove now unnecessary variable from compiled output
2018-06-28 12:19:31 -07:00
Michael Rawlings
505dd1e1ba
switch to using extracted jsdom-context-require 2018-06-27 14:12:41 -07:00
Michael Rawlings
a5b93ebb25
fix for loop autokeys (#1067) 2018-06-25 21:35:39 -07:00
Michael Rawlings
e2fd5b63da
dynamic tag (#1057) 2018-06-19 17:11:54 -07:00
Michael Rawlings
f29b9a21ec
additional tests 2018-06-19 13:54:34 -07:00
Dylan Piercey
1a37333440 Add same test for legacy compatibility layer. 2018-05-10 13:26:49 -07:00
Dylan Piercey
5be4d52d32 Add test for updating in onMount 2018-05-10 13:26:49 -07:00