45 Commits

Author SHA1 Message Date
Dylan Piercey
881f1b8da7
Lazy attributes for dynamic tags (#1365) 2019-06-25 15:01:52 -07:00
Dylan Piercey
eaa7024720
Improve for loop auto keying (#1346) 2019-06-05 11:29:29 -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
e065c140ff
Namespace fixes (#1333)
* Calculate namespace on actualize
2019-05-20 13:13:51 -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
14cec4c212
Improve dynamic tag arguments parsing (#1308) 2019-04-03 12:34:33 -07:00
Dylan Piercey
8be4a5d00d
Remove redundant part of key path for nested macros (#1295) 2019-03-19 16:14:05 -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
979c813190
Improve parsing of arguments (#1286)
* Improve parsing of arguments
2019-03-13 14:03:31 -07:00
Dylan Piercey
c96d181cd1
Fix issue with <title> namespace inside an svg (#1284) 2019-03-13 13:59:56 -07:00
Dylan Piercey
bfe194d8c9 Implement modern arguments support for dynamic tags (#1259) 2019-02-14 15:12:09 -08:00
Dylan Piercey
9e1577fff4
Migrate legacy macro syntax to tag params 2019-02-07 11:54:00 -08:00
Dylan Piercey
59ce9e8f07
Update <for> to use tag params and add migration (#1238) 2019-02-07 11:53:59 -08:00
Dylan Piercey
24753a7674
Upgrade <await> tag to use tag parameters and attribute tags. Add migration from old syntax. (#1244) 2019-02-07 11:50:49 -08:00
Dylan Piercey
681ba112cd Remove unneeded hasRenderBody check (#1255) 2019-02-07 11:30:10 -08:00
Neville Mehta
8cc3f12c40 add test for whitespace between class {} and <html> (#1256) 2019-02-07 11:28:29 -08:00
Dylan Piercey
6ed4e9dd7f
Improve optimization for nested tags wrapped in an if statement (#1249)
* Improve optimization for nested tags wrapped in an if statement with whitespace
2019-01-31 15:03:09 -08:00
Dylan Piercey
465ebee841
Treat importing tags the same as using the tag within the template. (#1245) 2019-01-29 13:56:18 -08:00
Michael Rawlings
d808906bd3 importing a marko template adds it to tags meta (#1226)
* importing a marko template adds it to tags meta
2019-01-10 13:12:41 -08:00
Michael Rawlings
b6443ea1f0 Fixes #1219 - transitive widget getEl and events (#1225) 2019-01-10 11:35:51 -08: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
Dylan Piercey
e1f60f20ca
Add migrations for marko-init and template-helpers directives (#1209) 2018-12-27 14:03:14 -07:00
Dylan Piercey
db5559cde1
Add migrator for include, layout-use and layout-placeholder tags (#1204)
Add migrator for include tag/directive
Add migrator for layout-placeholder tag
Add migrator for layout-use tag
2018-12-27 13:37:08 -07: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
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
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
Michael Rawlings
1eb2842d23 use TemplateLiteral node 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
Dylan Piercey
bd9c0ee0cd
Prevent implicit components with tag params (#1149) 2018-10-03 13:18:28 -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
c7b993db08
fix all for loop types (#1091) 2018-07-19 16:47:10 -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
Denis Budyak
eae689a8fd Fix import-var compilation when there are no explicit attributes 2018-03-23 15:10:35 -07:00
Michael Rawlings
92c448f639 Autotest refactor (#1023)
* update autotest api and first few test suites

* refactor components-browser to use the new autotest api

* minor changes to update adjustIndent and components-pages to new autotest api

* refactor and combine async-render, deprecated-async-fragments, and render suites

* migrate compiler tests to new autotest runner

* migrate components-compilation tests to use new autotest api

* migrate most remaining test runners to new autotest api

* update adjustIndent

* migrate express tests to new autotest api

* switch from compare to snapshot

* move versions into directory

* remove snapshot sequences, prefix to name, suffix to ext

* refactor autotest

* keep node 4 happy: don't use destructured parameters

* use strict

* update contributing document to reflect new autotest api

* better snapshot errors with clickable path

* remove old vdomSkip property, fix some normalization in the render test runner, skip only tests that need to be skipped

* for generated vdom expectations use expected.html instead of rerendering the html template, update expected files that had editor added newlines at the end

* remove half-finished test that was intended to replace another test (render/fixtures/preserveWhitespace-load-option) - we'll keep the original
2018-03-23 11:27:52 -07:00
Michael Rawlings
0f5e639775 Format + lint (#1016)
* add prettierignore

* switch to eslint:recommended + eslint-config-prettier

* fix eslint violations

* remove more .jshintrc files

* better conditional structure

* add prettier and update prettier ignore

* add precommit hook to run prettier

* add lint check to precommit and format check to ci

* format all the things

* add generated files

* let npm do it's thing with package.json
2018-03-09 10:02:11 -08:00
Dylan Piercey
a7f529debd Testing Improvements. (#989)
* * Setup utility to run jsdom tests in the same process without bundling.
* Cleanup require hooks in test suite.
* Test organization and cleanup.
* Remove redundant autotest utilities.

* Switch to require for browser.json loading

* Cache browser.json remaps. Fix components-browser rehydration setup

* Improve inline docs, remove some unneeded init code for testing modules.

* Remove unneeded promise polyfill
2018-02-20 10:26:48 -08:00
Dylan Piercey
d00ea44d46 Test perf and organization (#981)
* Switch to in memory lasso builds and other optimizations.

* Condense components-compilation tests.

* Update lasso-fs-writer

* Condense components-compilation and compiler tests

* Increase mocha test timeout

* Allow lasso to be gc'd for tests

* Improve test cache clearing

* Fix lasso memory leak in tests

* Cache instanbul intrumenting.

* Hide complain logs.
2018-02-06 18:53:55 -08:00
Dylan Piercey
d484de9f14 Fixes top level static for custom tags. (#959)
* Fixes top level static for custom tags.

* Switch static tag from code-generator to transformer to increase it's priority.

* Rename test.

* Fix expected file for tests.
2018-02-06 15:59:42 -08:00
Dylan Piercey
1496a0f26c Organize tests (#934) 2017-11-22 16:46:18 -08:00