67092[FEATURE] Introduce lit-html & lit-element as client-side template engine
Commit message
Review
-
Code review CR +2 Done
- Oliver Hader +2
-
Verified V +2 Done
- Oliver Hader +2
- TYPO3com +1 CI
Issues 2
Files 39
- Build/Sources/TypeScript/core/Resources/Public/TypeScript/lit-helper.tsnew+22 −0
- Build/Gruntfile.js3+68 −1
- Build/package.json+3 −0
- Build/yarn.lock+26 −0
- typo3/sysext/core/Classes/Page/PageRenderer.php3+17 −2
- typo3/sysext/core/Documentation/Changelog/master/Feature-91810-IntroduceLit-htmlAndLit-elementAsClient-sideTemplatingEngine.rstnew+162 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-element/lib/css-tag.jsnew+11 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-element/lib/decorators.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-element/lib/updating-element.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-element/lit-element.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/async-append.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/async-replace.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/cache.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/class-map.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/guard.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/if-defined.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/live.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/repeat.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/style-map.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/template-content.jsnew+14 −0
Show 19 more files
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/unsafe-html.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/unsafe-svg.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/directives/until.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/default-template-processor.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/directive.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/dom.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/modify-template.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/part.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/parts.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/render.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/shady-render.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/template-factory.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/template-instance.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/template-result.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lib/template.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/Contrib/lit-html/lit-html.jsnew+14 −0
- typo3/sysext/core/Resources/Public/JavaScript/lit-helper.jsnew+13 −0
- typo3/sysext/core/Tests/Functional/Page/PageRendererTest.php+4 −2
- typo3/sysext/install/Resources/Public/JavaScript/RequireJSConfig.js+12 −0
Review log 4065
Show 2340 earlier messages
-
Benjamin Franzke uploaded patch set 1 12/11/20, 12:03
-
TYPO3com voted on patch set 1 V -1 12/11/20, 12:13 Completed build in 09m 03s on Fri, 11 Dec, 12:13 PM Test Summary: 3 of 32654 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8062
-
Benjamin Franzke uploaded patch set 2 12/11/20, 12:57
-
TYPO3com voted on patch set 2 V -1 12/11/20, 13:08 Completed build in 11m 12s on Fri, 11 Dec, 01:08 PM Test Summary: 3 of 32637 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8064
-
Benjamin Franzke uploaded patch set 3 12/11/20, 13:24
-
TYPO3com voted on patch set 3 V -1 12/11/20, 13:36 Completed build in 11m 35s on Fri, 11 Dec, 01:36 PM Test Summary: 3 of 32654 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8068
-
Benjamin Franzke uploaded patch set 4 12/11/20, 13:37
-
TYPO3com voted on patch set 4 V +1 12/11/20, 13:48 Completed build in 10m 57s on Fri, 11 Dec, 01:48 PM Test Summary: 32412 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8070
-
Benjamin Franzke uploaded patch set 5 12/11/20, 14:05
-
TYPO3com voted on patch set 5 V +1 12/11/20, 14:16 Completed build in 10m 00s on Fri, 11 Dec, 02:16 PM Test Summary: 32411 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8074
-
Benjamin Franzke uploaded patch set 6 12/11/20, 14:25
-
Benjamin Franzke commented on patch set 6 CR -1 12/11/20, 14:28
Blocking until https://review.typo3.org/c/Packages/TYPO3.CMS/+/65047 -
Oliver Hader commented on patch set 6 CR -1 12/11/20, 14:35
Please let me finish my other task in https://review.typo3.org/c/Packages/TYPO3.CMS/+/65048 and then you can refactor whatever you like to refactor -
TYPO3com voted on patch set 6 V +1 12/11/20, 14:35 Completed build in 10m 03s on Fri, 11 Dec, 02:35 PM Test Summary: 32413 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8078
-
Oliver Hader commented on patch set 6 CR -2 12/11/20, 14:41
Please also add examples, how this can be used, like in https://review.typo3.org/c/Packages/TYPO3.CMS/+/65047/7/typo3/sysext/core/Documentation/Changelog/master/Feature-91810-IntroduceClient-sideTemplatingEngine.rst -
Benjamin Franzke commented on patch set 6 12/11/20, 14:42
Reply
..is revertedReply
I would like to revert the original patch instead and then re-introduce native lit-html, therefore I like to rebase your FormEngine patch (65048) on lit-html before we merge that. -
Benjamin Franzke commented on patch set 6 12/11/20, 14:44
Reply
I didn't want to repeat the lit-html template reference too much, therefore I added a link to the template reference. But sure, no examples is probably a bit too less. Will fix. -
Oliver Hader voted on patch set 6 CR -1 12/11/20, 14:56
-
Benjamin Franzke uploaded patch set 7 12/11/20, 15:29
-
Benjamin Franzke uploaded patch set 8 12/11/20, 15:36
-
TYPO3com voted on patch set 7 V +1 12/11/20, 15:42 Completed build in 10m 59s on Fri, 11 Dec, 03:42 PM Test Summary: 32413 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8083
-
TYPO3com voted on patch set 8 V +1 12/11/20, 15:45 Completed build in 08m 56s on Fri, 11 Dec, 03:45 PM Test Summary: 32413 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8084
-
Benjamin Franzke uploaded patch set 9 12/11/20, 20:45
-
TYPO3com voted on patch set 9 V -1 12/11/20, 20:59 Completed build in 13m 18s on Fri, 11 Dec, 08:59 PM Test Summary: 16 of 32536 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8098
-
Benjamin Franzke uploaded patch set 10 12/12/20, 06:02
-
TYPO3com voted on patch set 10 V -1 12/12/20, 06:12 Completed build in 09m 59s on Sat, 12 Dec, 06:12 AM Test Summary: 15 of 32654 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8105
-
Benjamin Franzke uploaded patch set 11 12/12/20, 06:52
-
TYPO3com voted on patch set 11 V -1 12/12/20, 07:04 Completed build in 11m 46s on Sat, 12 Dec, 07:04 AM Test Summary: 27296 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8106
-
TYPO3com commented on patch set 11 12/12/20, 07:16 Completed build in 10m 20s on Sat, 12 Dec, 07:16 AM Test Summary: 2 of 32653 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8107
-
TYPO3com voted on patch set 11 V +1 12/12/20, 07:46 Completed build in 10m 00s on Sat, 12 Dec, 07:46 AM Test Summary: 32411 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8108
-
Benjamin Franzke uploaded patch set 12 12/12/20, 13:05
-
TYPO3com voted on patch set 12 V +1 12/12/20, 13:17 Completed build in 12m 19s on Sat, 12 Dec, 01:17 PM Test Summary: 32414 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8117
-
Benjamin Franzke uploaded patch set 13 12/12/20, 16:32
-
TYPO3com voted on patch set 13 V +1 12/12/20, 16:45 Completed build in 12m 54s on Sat, 12 Dec, 04:45 PM Test Summary: 32414 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8124
-
Benjamin Franzke uploaded patch set 14 12/12/20, 21:49
-
TYPO3com voted on patch set 14 V +1 12/12/20, 22:00 Completed build in 10m 37s on Sat, 12 Dec, 10:00 PM Test Summary: 32414 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8129
-
Benjamin Franzke uploaded patch set 15 12/14/20, 13:19
-
Benjamin Franzke commented on patch set 15 12/14/20, 13:23
This change is ready for review.This one is ready for review. But we should merge the revert of the initial template approach before: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67095 -
TYPO3com voted on patch set 15 V +1 12/14/20, 13:32 Completed build in 13m 00s on Mon, 14 Dec, 01:32 PM Test Summary: 32415 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8161
-
Benjamin Franzke uploaded patch set 16 12/14/20, 13:37
-
TYPO3com voted on patch set 16 V +1 12/14/20, 13:48 Completed build in 11m 14s on Mon, 14 Dec, 01:48 PM Test Summary: 32415 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8163
-
Benni Mack commented on patch set 16 12/15/20, 09:46
ext_localconf.php:74shouldn't we move this into EXT:backend? -
Benjamin Franzke uploaded patch set 17 12/15/20, 09:57
-
Benjamin Franzke commented on patch set 17 12/15/20, 09:57
ext_localconf.php:74ReplyAck -
TYPO3com voted on patch set 17 V +1 12/15/20, 10:13 Completed build in 15m 58s on Tue, 15 Dec, 10:13 AM Test Summary: 32412 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8189
-
Benjamin Franzke uploaded patch set 18 12/16/20, 21:06
-
TYPO3com voted on patch set 18 V +1 12/16/20, 21:16 Completed build in 10m 08s on Wed, 16 Dec, 09:16 PM Test Summary: 32433 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8218
-
Oliver Hader commented on patch set 18 12/17/20, 11:43
Gruntfile.js:479How could we ensure that added/removed files in a future release of `lit-html` are reflected here?LiveSearch.ts:102I was thinking about this pattern a bit (create temp node for composing inner details). `TemplateResult.getHTML` might be used directly here - however when focussing on the long-term goals, still `render` might be better, since it maintains state (caches) internally allowing data-binding. For this particular case data-binding is superfluous, as long as we still have lots of functions that either expect raw string HTML or jQuery "nodes". Thus, it would be filling the cache without actually being used → probably higher memory consumption when using this pattern for various scenarios.LiveSearch.ts:120UnresolvedI'll double check lit's behavior for NodePart vs AttributePart here - I'm pretty sure XSS is not possible, but I have to "see it with my own eyes" ;)Notification.ts:163Web Animations via JavaScript is still a draft - it feels this fade-in/fade-out would be used more often and requires a new custom `animate` directive - as a strategy facade for either WebAnimation/JS, jQuery or CSS transitions...NotificationTest.ts:80Could that delay be avoided completely, since we await the `updateComplete` life-cycle promise to be finished already?LiveSearch.php:222Seems `typeLabel` is not to be used client-side, is it?PageRenderer.php:1507Why & what's the difference here? Probably add a comment... -
Benjamin Franzke commented on patch set 18 12/17/20, 14:11
Thank you for your review.Gruntfile.js:479ReplyYea, I wasn't sure what we want here. The Gruntfile is very explicit regarding the copied files in other places like for jquery-ui as well, therefore I've tried to keep the pattern of "name every file explicitly". I would be fine with autogenerating this list. We would only need to life with empty modules being added as well (I mean thats what happens for EXT:core/Resources/Public/JavaScript/Event/EventInterface.js as well). And then it would be usefull to also delete possibly deleted files.LiveSearch.ts:102ReplyHm, yea, I wanted to use `TemplateResult.getHTML` as well, but the HTML contains markers like `<!--{{lit-8700743881662687}}-->` and *not* the values, that's because lit-html replaces these (of course escaped) via DOM API during render(). Therefore a "real" rendering with render() on a DOM element is actually needed. But you are right, it's always preferable to directly render to elements instead of rendering to temporary elements just to convert to string afterwards. …But I think data-binding is not superfluous here, LiveSearch may happen multiple times, therefore the HTML template can be cached by lit-html. Also data-binding really serves as XSS protection IMO.Notification.ts:163ReplyYea, it's a draft, but it's so much more fluent than jQuery's manual timeout based animation.. 😊 Generalizing this might be useful, yes. With `directive` you mean a lit-html directive, or a general helper class? Sounds like you have something in mind? If we decide against web animations api, then we'd need to keep using $.fn.slideUp() is in patchset 13: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67092/13/Build/Sources/TypeScript/backend/Resources/Public/TypeScript/Notification.tsNotificationTest.ts:80ReplyIt is actually still needed here. The test on the next line verifies that the notification will be hidden (automatically) and therefore the timeout needs to be "waited" for before that check can happen.LiveSearch.php:222ReplyIt's used to group the search results in LiveSearch.ts (passed as `groupBy: 'typeLabel'` to $.fn.autocomplete`). This label is then passed as argument `category` to `formatGroup` and there it is renderer to HTML via lit-html (and therefore it is escaped client side and thatswhy htmlspecialchars is removed here).PageRenderer.php:1507ReplyI've added it to the PageRendererTest. This is because requirejs 'packages' configuration requires a numeric indexed array (while all other requirejs configuration is string-indexed). So this case (a 'package' in 'public' didn't happen when you added the public vs non-public), and therefore we need to switch aways from array_replace_recursive. Now, with lit-html and lit-element in ['public']['packages'], the package definition for codemirror (added in EXT:t3editor/Classes/Hook/PageRendererRenderPreProcess.php) would otherwise overwrite the public definitions of lit-html. When public and non-public configurations are "replaced" (instead of merged) here. So we need array_merge for numeric-indexed arrays and array_replace_recursive, for string-indexed arrays. Therefore the switch to `replaceAndAppendScalarValuesRecursive`. -
Benjamin Franzke uploaded patch set 19 12/17/20, 19:09
-
Benjamin Franzke commented on patch set 19 12/17/20, 19:09
Gruntfile.js:479ReplyChanged to use glob's for lib/*.js and directives/*.js.NotificationTest.ts:80ReplyAdded a comment to the code.PageRenderer.php:1507ReplyAdded a comment to the method call. -
TYPO3com voted on patch set 19 V +1 12/17/20, 19:20 Completed build in 10m 09s on Thu, 17 Dec, 07:20 PM Test Summary: 32496 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8233
-
Oliver Hader commented on patch set 19 12/17/20, 21:31
LiveSearch.ts:102Reply UnresolvedI see... context-based rendering (to avoid XSS) happens in AttributePart and NodePart. I'll create some `renderHTML` function for that...Notification.ts:163Reply UnresolvedI had something like https://angular.io/guide/animations#code-review in mind, or https://www.webcomponents.org/element/@polymer/neon-animation/elements/fade-in-animation However that seems to be a little bit more complicated since we're using light-DOM and encapsulated shadow-CSS would not work with it...LiveSearch.php:222ReplyAck -
Oliver Hader uploaded patch set 20 12/17/20, 21:45
-
Oliver Hader commented on patch set 20 12/17/20, 21:48
Double checked attribute encoding... I don't have any other/better idea for animations - however it seems that Web Animation L2 API is supported by all browsers matching the min. requirements for TYPO3 v11. -
TYPO3com voted on patch set 20 V -1 12/17/20, 21:58 Completed build in 12m 57s on Thu, 17 Dec, 09:58 PM Test Summary: 2 of 29265 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8234
-
TYPO3com voted on patch set 20 V +1 12/17/20, 22:26 Completed build in 53m 38s on Thu, 17 Dec, 10:26 PM Test Summary: 32496 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8234
-
Oliver Hader commented on patch set 20 V -1 12/17/20, 22:53
Something seems to be wrong with ContextMenu (and I am not able to spot it). Using the context menu in page-tree and showing info-popup of a page gives me 4 instances of that modal - I can close the 1st using the `x` button, the remaining can only be closed using ESC key. Not applying the ContextMenu.ts changes "solved" the problem... It might be related to the mix of lit-html and jQuery towards event handling - however, I did not spot any obvious flaw in the code here... -
Oliver Hader uploaded patch set 21 12/17/20, 23:01
-
Oliver Hader commented on patch set 21 12/17/20, 23:02
Removed the integrations for the time being and will re-add them as separated patches -
TYPO3com voted on patch set 21 V -1 12/17/20, 23:16 Completed build in 14m 37s on Thu, 17 Dec, 11:16 PM Test Summary: 1 of 31911 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8236
-
Oliver Hader voted on patch set 21 V +1 CR +1 12/17/20, 23:21
-
TYPO3com voted on patch set 21 V +1 12/17/20, 23:30 Completed build in 43m 41s on Thu, 17 Dec, 11:30 PM Test Summary: 32496 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8236
-
Oliver Hader voted on patch set 21 V +2 CR +2 12/18/20, 00:02
-
Oliver Hader merged patch set 22 12/18/20, 00:02