300 Commits

Author SHA1 Message Date
Dylan Piercey
d9166e52fb
Remove inline compiler (#1208) 2018-12-27 09:40:53 -07:00
Dylan Piercey
a2c8b10e5b
Remove unreachable dynamic attribute code (#1205) 2018-12-26 15:42:16 -07:00
Bhavin Patel
b26d2608c7 Migrate w-body attr in favor of using dynamic tags (#1199)
Add migrator for w-body.
2018-12-26 08:13:54 -07:00
Bhavin Patel
1f5f138504 Migrate legacy dynamic attr (#1202)
Add migrator from dynamic attributes to spread attributes.
2018-12-26 08:08:44 -07:00
Dylan Piercey
b8c662599e
Fix regression with undefined spread attributes (#1201) 2018-12-20 17:00:52 -08:00
Dylan Piercey
0cf4af2885
Fix widget el id migration (#1198) 2018-12-14 17:12:08 -08:00
Dylan Piercey
3f1d7420a7 Remove deprecations already moved to the migrate stage (#1196) 2018-12-14 15:21:03 -08:00
Dylan Piercey
8bf8d3caa4
Add "getTemplateData" migration. (#1195) 2018-12-14 13:57:34 -08:00
Bhavin Patel
e7bfb039d8 Added migrators for w-* attrs & code restructure (#1190)
* Added migrator for w-id, w-for, w-preserve, w-preserve-attrs and widget-elId
2018-12-14 12:28:47 -08:00
Dylan Piercey
21ce06f8ad
Optional migrations & basic w-bind migration (#1192)
* Setup optional migration support

* Add migration call for w-bind

* Add tests for optional migrations

* Add assertions based on migration prompts

* Skip migration tests on node 6

* Fix typo
2018-12-14 09:50:05 -08:00
Dylan Piercey
cfe165760e Fix regression with setProps in compatibility layer (#1193) 2018-12-13 10:00:47 -08:00
Michael Rawlings
9a916d856c
Env var helpers (#1191)
* add MARKO_NO_MIGRATE env var to skip migration stage

* add EXPECT_DEPRECATED_FAILURES env var to expect all fixtures in a deprecated directory to fail

* add COMPLAIN_THROWS env var to cause deprecation warnings to be errors
2018-12-12 10:53:27 -08:00
Bhavin Patel
f23316abc9 Code restructure & mIgrator for w-on (#1186)
migrate w-on to modern event handler directive
2018-12-11 15:47:55 -08:00
Michael Rawlings
3afd7d4264
regenerate package-lock and run prettier 2018-12-11 13:19:07 -08: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
Michael Rawlings
37e0c912ab
Template literal print fixes (#1188)
* when writing a TemplateLiteral, it should not transpile unless generated

* proper escaping for template literals

* add printing test for TemplateLiteral node
2018-12-10 17:01:19 -08:00
Bhavin Patel
f14a7c8acf Added migrator for async-fragment & bugfix for Normalizer.js (#1185)
convert async-fragment transform to be a migrator
2018-12-07 10:05:41 -08:00
Dylan Piercey
3338fd4e0a
Fix regression in parse javascript not aborting on unrecognized nodes (#1184)
* Fix regression in parse javascript not aborting on unrecognized nodes
2018-12-06 12:40:54 -08:00
Dylan Piercey
7d37fe3634 Migration stage (#1180)
* Add migration stage to taglib
* integrate migrations into migration stage
2018-12-03 15:35:19 -08:00
Michael Rawlings
3e68893388
add new parse api 2018-12-03 13:00:49 -08:00
Michael Rawlings
1eb2842d23 use TemplateLiteral node 2018-12-03 12:28:56 -08:00
Michael Rawlings
eb51003030 parse = parseRaw + normalize 2018-12-03 12:28:56 -08:00
Dylan Piercey
c791afcf12 Fix regression with function in var/assign tags (#1176) 2018-11-27 12:07:29 -08:00
Michael Rawlings
13ead29445
fix parsing if statements without braces (#1175) 2018-11-27 12:00:36 -08:00
Dylan Piercey
39542567e0
Convert imperative rendering inside scriptlets to dynamic tags (#1174) 2018-11-26 10:48:45 -08:00
timlauter
3e6b954584 [MARKO-14] - <invoke> Migration Transform (#1165)
Convert `<invoke>` tag to translate to modern Marko features (including imperative rendering to dynamic tag)
2018-11-26 09:23:21 -08:00
timlauter
f2d8c970da [MARKO-3] - <assign> and <var> tag migration (#1158)
Convert `<assign>` and `<var>` tags to translate to modern Marko features.
2018-11-26 09:22:14 -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
e651e689b8
Re-add spread attribute optimization and bail out when repeated @tags present. Prevent dynamic tag from cloning non object attributes. (#1171) 2018-11-21 12:42:52 -08:00
Dylan Piercey
3acffd876d Preserve a private context object when set on out.global. (#1168) 2018-11-15 11:01:33 -08:00
aganeshalingam
e621b83c83 Add support for file name to contain [some word] (#1166)
* Add support for file name to contain [some word]
2018-11-12 13:55:59 -08:00
Michael Rawlings
ea08b2c077
Let to var in runtime code (#1153) 2018-10-09 04:32:13 +09:00
Dylan Piercey
bd9c0ee0cd
Prevent implicit components with tag params (#1149) 2018-10-03 13:18:28 -07:00
Dylan Piercey
fa779a74b6 Fix issue with include tag hydration. (#1143)
* Add failing test cases for repeated at tag hydration with preserved content
* Fix owner component for include tag and use unmodified key for matching fragment markers
2018-10-03 05:52:09 +09: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
ecef7f33c7
add additional reference to fragment (#1130) 2018-09-14 13:26:10 -07: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
Michael Rawlings
a8ebc62f93
runtimeId (#1123)
* allow custom runtimeId to be passed which allows multiple versions of Marko to run without stepping on eachother
2018-09-10 16:27:36 -07:00
Dylan Piercey
b2cc5cd27c
Remove object.assign from browser code. (#1120) 2018-08-30 15:31:01 -07:00
Dylan Piercey
e2bb09850b
Express Errors with res.marko API (#1119)
* Emit express errors with res.marko

* Switch to using '.on' instead of catch to prevent unhandled promise rejections
2018-08-29 10:33:42 -07:00
Dylan Piercey
38ee375ca3
Fix multi line import parsing. (#1118) 2018-08-29 10:30:02 -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
4937dcd3fc
closes #847 - allow discovering tags where the template name matches the directory (#1117)
* closes #847 - allow discovering tags in the directory structure components/tag-name/tag-name.marko

* add docs for discovering tags with template name matching parent directory
2018-08-28 16:35:22 -07:00
Dylan Piercey
e7c682dafc Remove es2015 features from runtime. (#1115) 2018-08-28 13:36:52 -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
Dylan Piercey
487d2b8974
Fix node inspect deprecation warning. (#1111) 2018-08-17 15:06:27 -07:00
Michael Rawlings
342ddb0084
fix event names with dashes 2018-08-16 12:24:27 -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