From 9c006e70ae1ec7a7ed358b23f27fa434f4ed0823 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 17:14:36 -0500 Subject: [PATCH 01/25] Update CounterFrontend.py --- mything/microfrontends/counter/CounterFrontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/counter/CounterFrontend.py b/mything/microfrontends/counter/CounterFrontend.py index 1288bb3..59f38b9 100644 --- a/mything/microfrontends/counter/CounterFrontend.py +++ b/mything/microfrontends/counter/CounterFrontend.py @@ -17,4 +17,4 @@ def view(self, props={'page':'Home', 'counter':0, 'setCounter':lambda x: None}): props['counter'], self._html.h('button', {'class':'pure-button pure-button-primary','onClick': lambda: props['setCounter'](props['counter']+1)}, '+1') ]) - return self._html.attach(self.config(), root) + return self._html.attach(self.config())(root) From 3f23f13168f556c1d0d1e6631bd6702662c749d2 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 17:25:44 -0500 Subject: [PATCH 02/25] Update CounterFrontend.py --- mything/microfrontends/counter/CounterFrontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/counter/CounterFrontend.py b/mything/microfrontends/counter/CounterFrontend.py index 59f38b9..1fc1b9c 100644 --- a/mything/microfrontends/counter/CounterFrontend.py +++ b/mything/microfrontends/counter/CounterFrontend.py @@ -17,4 +17,4 @@ def view(self, props={'page':'Home', 'counter':0, 'setCounter':lambda x: None}): props['counter'], self._html.h('button', {'class':'pure-button pure-button-primary','onClick': lambda: props['setCounter'](props['counter']+1)}, '+1') ]) - return self._html.attach(self.config())(root) + return self._html.attach(self.config())(lambda x: root)() From 875e3f85f8208ad7b7ce2326179ffee4a5ff7bc5 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 17:33:30 -0500 Subject: [PATCH 03/25] Update CounterFrontend.py --- mything/microfrontends/counter/CounterFrontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/counter/CounterFrontend.py b/mything/microfrontends/counter/CounterFrontend.py index 1fc1b9c..d712260 100644 --- a/mything/microfrontends/counter/CounterFrontend.py +++ b/mything/microfrontends/counter/CounterFrontend.py @@ -17,4 +17,4 @@ def view(self, props={'page':'Home', 'counter':0, 'setCounter':lambda x: None}): props['counter'], self._html.h('button', {'class':'pure-button pure-button-primary','onClick': lambda: props['setCounter'](props['counter']+1)}, '+1') ]) - return self._html.attach(self.config())(lambda x: root)() + return self._html.attach(self.config())(lambda: root) From e9c21fab1245c7472aed1f5725c27e7ee7c2d322 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 17:55:43 -0500 Subject: [PATCH 04/25] Update CounterFrontend.py --- mything/microfrontends/counter/CounterFrontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/counter/CounterFrontend.py b/mything/microfrontends/counter/CounterFrontend.py index d712260..81dff09 100644 --- a/mything/microfrontends/counter/CounterFrontend.py +++ b/mything/microfrontends/counter/CounterFrontend.py @@ -17,4 +17,4 @@ def view(self, props={'page':'Home', 'counter':0, 'setCounter':lambda x: None}): props['counter'], self._html.h('button', {'class':'pure-button pure-button-primary','onClick': lambda: props['setCounter'](props['counter']+1)}, '+1') ]) - return self._html.attach(self.config())(lambda: root) + return self._html.attach(self.config())(lambda: root)() From 8fe50a2e89280602bde4011ee2d1fa2a69ddeb13 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 18:05:56 -0500 Subject: [PATCH 05/25] Update CounterFrontend.py --- mything/microfrontends/counter/CounterFrontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/counter/CounterFrontend.py b/mything/microfrontends/counter/CounterFrontend.py index 81dff09..fa44490 100644 --- a/mything/microfrontends/counter/CounterFrontend.py +++ b/mything/microfrontends/counter/CounterFrontend.py @@ -17,4 +17,4 @@ def view(self, props={'page':'Home', 'counter':0, 'setCounter':lambda x: None}): props['counter'], self._html.h('button', {'class':'pure-button pure-button-primary','onClick': lambda: props['setCounter'](props['counter']+1)}, '+1') ]) - return self._html.attach(self.config())(lambda: root)() + return self._html.attach(self.config())(root)() From 174163cb259a0b2dc020517408d8d32f2e0b79d8 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 18:25:46 -0500 Subject: [PATCH 06/25] Update CounterFrontend.py --- mything/microfrontends/counter/CounterFrontend.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mything/microfrontends/counter/CounterFrontend.py b/mything/microfrontends/counter/CounterFrontend.py index fa44490..393e490 100644 --- a/mything/microfrontends/counter/CounterFrontend.py +++ b/mything/microfrontends/counter/CounterFrontend.py @@ -10,11 +10,13 @@ def config(self): self._html.withProps({'page': 'Home'}), self._html.withState('counter', 'setCounter', 0) ) - - def view(self, props={'page':'Home', 'counter':0, 'setCounter':lambda x: None}): - root = self._html.h('div', {}, [ + + def root(self, props={'page':'Home', 'counter':0, 'setCounter':lambda x: None}): + return self._html.h('div', {}, [ props['page'], props['counter'], self._html.h('button', {'class':'pure-button pure-button-primary','onClick': lambda: props['setCounter'](props['counter']+1)}, '+1') ]) - return self._html.attach(self.config())(root)() + + def view(self, props): + return self._html.attach(self.config())(self.root)() From ea5c858b19247e34189774ddddca60f3198e4b0f Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 18:35:41 -0500 Subject: [PATCH 07/25] Update CounterFrontend.py --- mything/microfrontends/counter/CounterFrontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/counter/CounterFrontend.py b/mything/microfrontends/counter/CounterFrontend.py index 393e490..8203a79 100644 --- a/mything/microfrontends/counter/CounterFrontend.py +++ b/mything/microfrontends/counter/CounterFrontend.py @@ -19,4 +19,4 @@ def root(self, props={'page':'Home', 'counter':0, 'setCounter':lambda x: None}): ]) def view(self, props): - return self._html.attach(self.config())(self.root)() + return self._html.attach(self.config())(self.root) From 384d5c673def6d590515a9986052b9e6140e0a42 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 22:37:41 -0500 Subject: [PATCH 08/25] Update Makefile --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 5b40fe1..93ac21b 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ build: ## Build pypi package python3 -m poetry build generatejs: ## Build javascript + python3 -m pymake rebuildcustompreact python3 -m poetry run transcrypt -da -sf -de -m -n -b -ds -dc mything python3 -c "print('moving generated js to docs/api/js/');import shutil;import os;os.chdir('__target__');files = os.listdir(); match = lambda file: file.endswith('.js'); move = lambda file: (os.path.exists('../docs/api/js/'+file) and os.remove('../docs/api/js/'+file)) or shutil.move(file, '../docs/api/js/'); list(map(move,filter(match, files)))" From 53a5c6ad356f50224c63dfd2b95f28ddf90f3a2b Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 22:44:04 -0500 Subject: [PATCH 09/25] Update custom-preact.browserify.js --- docs/api/js/custom-preact.browserify.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api/js/custom-preact.browserify.js b/docs/api/js/custom-preact.browserify.js index ceb2c70..1fc6318 100644 --- a/docs/api/js/custom-preact.browserify.js +++ b/docs/api/js/custom-preact.browserify.js @@ -1,10 +1,10 @@ window.CustomHtml = window.CustomHtml || {}; var preact = require('preact'); -for (var i in preact) { window.CustomHtml[i] = preact[i]; } +for (var i in preact) { window.CustomHtml[i] = function() { return preact[i].apply(preact, arguments) } } var proppy = require('proppy'); -for (var i in proppy) { window.CustomHtml[i] = proppy[i]; } +for (var i in proppy) { window.CustomHtml[i] = function() { return proppy[i].apply(proppy, arguments) } } var proppyPreact = require('proppy-preact'); -for (var i in proppyPreact) { window.CustomHtml[i] = proppyPreact[i]; } +for (var i in proppyPreact) { window.CustomHtml[i] = function() { return proppyPreact[i].apply(proppyPreact, arguments) } } From fe2841be9b447cf92f21ce6fd069b84da6cb0a4b Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 22:51:42 -0500 Subject: [PATCH 10/25] Update Makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 93ac21b..4f96137 100644 --- a/Makefile +++ b/Makefile @@ -40,8 +40,8 @@ generatejs: ## Build javascript rebuildcustompreact: ## Download and minify custom preact browserify deps " npm i browserify preact proppy proppy-preact uglify-js - ./node_modules/.bin/browserify docs/api/custom-preact.browserify.js -o docs/api/custom-preact.js - ./node_modules/.bin/uglifyjs docs/api/custom-preact.js -o docs/api/custom-preact.min.js + ./node_modules/.bin/browserify docs/api/js/custom-preact.browserify.js -o docs/api/js/custom-preact.js + ./node_modules/.bin/uglifyjs docs/api/js/custom-preact.js -o docs/api/js/custom-preact.min.js tdd: ## Run tests on file change python3 -m poetry run ptw From 73a12a32728b3ed80a8725151f324d1809ca8fa5 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 23:01:13 -0500 Subject: [PATCH 11/25] Update custom-preact.browserify.js --- docs/api/js/custom-preact.browserify.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/js/custom-preact.browserify.js b/docs/api/js/custom-preact.browserify.js index 1fc6318..27d2a21 100644 --- a/docs/api/js/custom-preact.browserify.js +++ b/docs/api/js/custom-preact.browserify.js @@ -1,10 +1,10 @@ window.CustomHtml = window.CustomHtml || {}; var preact = require('preact'); -for (var i in preact) { window.CustomHtml[i] = function() { return preact[i].apply(preact, arguments) } } +for (var i in preact) { window.CustomHtml[i] = preact[i] } } var proppy = require('proppy'); -for (var i in proppy) { window.CustomHtml[i] = function() { return proppy[i].apply(proppy, arguments) } } +for (var i in proppy) { window.CustomHtml[i] = proppy[i] } var proppyPreact = require('proppy-preact'); for (var i in proppyPreact) { window.CustomHtml[i] = function() { return proppyPreact[i].apply(proppyPreact, arguments) } } From 2348abedfdd28715aec096fd579b151d52e04c62 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 23:13:06 -0500 Subject: [PATCH 12/25] Update custom-preact.browserify.js --- docs/api/js/custom-preact.browserify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/js/custom-preact.browserify.js b/docs/api/js/custom-preact.browserify.js index 27d2a21..d932da4 100644 --- a/docs/api/js/custom-preact.browserify.js +++ b/docs/api/js/custom-preact.browserify.js @@ -1,7 +1,7 @@ window.CustomHtml = window.CustomHtml || {}; var preact = require('preact'); -for (var i in preact) { window.CustomHtml[i] = preact[i] } } +for (var i in preact) { window.CustomHtml[i] = preact[i] } var proppy = require('proppy'); for (var i in proppy) { window.CustomHtml[i] = proppy[i] } From a1831d58c0ad75ff6bc863c32fb3e18f85621cdd Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 23:26:56 -0500 Subject: [PATCH 13/25] Update custom-preact.browserify.js --- docs/api/js/custom-preact.browserify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api/js/custom-preact.browserify.js b/docs/api/js/custom-preact.browserify.js index d932da4..3f5e89e 100644 --- a/docs/api/js/custom-preact.browserify.js +++ b/docs/api/js/custom-preact.browserify.js @@ -7,4 +7,4 @@ var proppy = require('proppy'); for (var i in proppy) { window.CustomHtml[i] = proppy[i] } var proppyPreact = require('proppy-preact'); -for (var i in proppyPreact) { window.CustomHtml[i] = function() { return proppyPreact[i].apply(proppyPreact, arguments) } } +for (var i in proppyPreact) { window.CustomHtml[i] = proppyPreact[i] } From 383027b0ff63a9f6d9d469d0cbab1b6a836e46af Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 23:38:27 -0500 Subject: [PATCH 14/25] Update __init__.py --- mything/microfrontends/core/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mything/microfrontends/core/__init__.py b/mything/microfrontends/core/__init__.py index 704f363..be77f97 100644 --- a/mything/microfrontends/core/__init__.py +++ b/mything/microfrontends/core/__init__.py @@ -31,12 +31,12 @@ def mount(self, tag: str, attributes: typing.List, instance: IFrontend): class PureCssWebComponent(IComponent): def mount(self, tag: str, attributes: typing.List, instance: IFrontend): - def mounter(html, element, mountPoint, style, instance, attributes): + def mounter(html, element, mountPoint, style, instance, attributes, Provider): attrs = dict() for item in attributes: attrs[item] = element.getAttribute(item) custom = instance.view(attrs) - provider = html.h(html.ProppyProvider, {}, [custom]) + provider = html.h(Provider, {}, [custom]) html.render(provider, mountPoint) root = element.attachShadow({ 'mode': 'open' }) style.setAttribute('rel','stylesheet') @@ -44,9 +44,12 @@ def mounter(html, element, mountPoint, style, instance, attributes): style.setAttribute('type','text/css') root.appendChild(style) root.appendChild(mountPoint) + + getProvider = lambda: None + # __pragma__ ('js', '{}', 'class Provider extends html.Component {public getChildContext() {const { children, ...context } = this.props;return context;} public render({ children }) {return (children && children[0]) || null;}};getProvider=()=>Provider;') def cb(html, me, create): - mounter(html, me, create("span"), create("link"), instance, attributes) + mounter(html, me, create("span"), create("link"), instance, attributes, getProvider()) # __pragma__ ('js', '{}', 'class cls extends HTMLElement{connectedCallback(){cb(window.CustomHtml, this, x => document.createElement(x))}}') # __pragma__ ('js', '{}', 'window.customElements.define(tag, cls, attributes);') From 60fde13225bb1826cced712840bbe7488d033285 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 23:40:32 -0500 Subject: [PATCH 15/25] Update __init__.py --- mything/microfrontends/core/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mything/microfrontends/core/__init__.py b/mything/microfrontends/core/__init__.py index be77f97..afed69a 100644 --- a/mything/microfrontends/core/__init__.py +++ b/mything/microfrontends/core/__init__.py @@ -45,10 +45,9 @@ def mounter(html, element, mountPoint, style, instance, attributes, Provider): root.appendChild(style) root.appendChild(mountPoint) - getProvider = lambda: None - # __pragma__ ('js', '{}', 'class Provider extends html.Component {public getChildContext() {const { children, ...context } = this.props;return context;} public render({ children }) {return (children && children[0]) || null;}};getProvider=()=>Provider;') - def cb(html, me, create): + getProvider = lambda: html.Component + # __pragma__ ('js', '{}', 'class Provider extends html.Component {public getChildContext() {const { children, ...context } = this.props;return context;} public render({ children }) {return (children && children[0]) || null;}};getProvider=()=>Provider;') mounter(html, me, create("span"), create("link"), instance, attributes, getProvider()) # __pragma__ ('js', '{}', 'class cls extends HTMLElement{connectedCallback(){cb(window.CustomHtml, this, x => document.createElement(x))}}') From de1a29288bb641c976bd96c9b8fd6b0b1cd348e6 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 23:51:38 -0500 Subject: [PATCH 16/25] Update __init__.py --- mything/microfrontends/core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/core/__init__.py b/mything/microfrontends/core/__init__.py index afed69a..cada447 100644 --- a/mything/microfrontends/core/__init__.py +++ b/mything/microfrontends/core/__init__.py @@ -47,7 +47,7 @@ def mounter(html, element, mountPoint, style, instance, attributes, Provider): def cb(html, me, create): getProvider = lambda: html.Component - # __pragma__ ('js', '{}', 'class Provider extends html.Component {public getChildContext() {const { children, ...context } = this.props;return context;} public render({ children }) {return (children && children[0]) || null;}};getProvider=()=>Provider;') + # __pragma__ ('js', '{}', 'class Provider extends html.Component {getChildContext() {const { children, ...context } = this.props;return context;} render({ children }) {return (children && children[0]) || null;}};getProvider=()=>Provider;') mounter(html, me, create("span"), create("link"), instance, attributes, getProvider()) # __pragma__ ('js', '{}', 'class cls extends HTMLElement{connectedCallback(){cb(window.CustomHtml, this, x => document.createElement(x))}}') From dbb07e4900c1cb17ed8b0cd02706380db5040067 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sat, 11 Jan 2020 23:59:43 -0500 Subject: [PATCH 17/25] Update __init__.py --- mything/microfrontends/core/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mything/microfrontends/core/__init__.py b/mything/microfrontends/core/__init__.py index cada447..63b479b 100644 --- a/mything/microfrontends/core/__init__.py +++ b/mything/microfrontends/core/__init__.py @@ -35,8 +35,7 @@ def mounter(html, element, mountPoint, style, instance, attributes, Provider): attrs = dict() for item in attributes: attrs[item] = element.getAttribute(item) - custom = instance.view(attrs) - provider = html.h(Provider, {}, [custom]) + provider = html.h(Provider, {'providers':{'attrs':attrs}}, [instance.view]) html.render(provider, mountPoint) root = element.attachShadow({ 'mode': 'open' }) style.setAttribute('rel','stylesheet') From b071e552097c07b8a9b444e4d1ac892194dc8c82 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sun, 12 Jan 2020 00:07:30 -0500 Subject: [PATCH 18/25] Update __init__.py --- mything/microfrontends/core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/core/__init__.py b/mything/microfrontends/core/__init__.py index 63b479b..b20489c 100644 --- a/mything/microfrontends/core/__init__.py +++ b/mything/microfrontends/core/__init__.py @@ -35,7 +35,7 @@ def mounter(html, element, mountPoint, style, instance, attributes, Provider): attrs = dict() for item in attributes: attrs[item] = element.getAttribute(item) - provider = html.h(Provider, {'providers':{'attrs':attrs}}, [instance.view]) + provider = html.h(Provider, {'providers':{'attrs':attrs}}, [instance.view()]) html.render(provider, mountPoint) root = element.attachShadow({ 'mode': 'open' }) style.setAttribute('rel','stylesheet') From 6459492cebcdefb78343b6b403f2c3bce2ec5347 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sun, 12 Jan 2020 10:49:37 -0500 Subject: [PATCH 19/25] Update CounterFrontend.py --- mything/microfrontends/counter/CounterFrontend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/counter/CounterFrontend.py b/mything/microfrontends/counter/CounterFrontend.py index 8203a79..f4f20e0 100644 --- a/mything/microfrontends/counter/CounterFrontend.py +++ b/mything/microfrontends/counter/CounterFrontend.py @@ -19,4 +19,4 @@ def root(self, props={'page':'Home', 'counter':0, 'setCounter':lambda x: None}): ]) def view(self, props): - return self._html.attach(self.config())(self.root) + return self._html.h(self._html.attach(self.config())(self.root)) From 054230eb0d73c4c78765a2f4ca689615f14dd31b Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sun, 12 Jan 2020 10:50:46 -0500 Subject: [PATCH 20/25] Update __init__.py --- mything/microfrontends/core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/core/__init__.py b/mything/microfrontends/core/__init__.py index b20489c..dda2145 100644 --- a/mything/microfrontends/core/__init__.py +++ b/mything/microfrontends/core/__init__.py @@ -35,7 +35,7 @@ def mounter(html, element, mountPoint, style, instance, attributes, Provider): attrs = dict() for item in attributes: attrs[item] = element.getAttribute(item) - provider = html.h(Provider, {'providers':{'attrs':attrs}}, [instance.view()]) + provider = html.h(Provider, {'providers':{'attrs':attrs}}, [instance.view(attrs)]) html.render(provider, mountPoint) root = element.attachShadow({ 'mode': 'open' }) style.setAttribute('rel','stylesheet') From 212873c153288992280eca173c536e0cfe9168fb Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sun, 12 Jan 2020 11:12:01 -0500 Subject: [PATCH 21/25] Update __init__.py --- mything/microfrontends/core/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mything/microfrontends/core/__init__.py b/mything/microfrontends/core/__init__.py index dda2145..02b1eb9 100644 --- a/mything/microfrontends/core/__init__.py +++ b/mything/microfrontends/core/__init__.py @@ -45,9 +45,7 @@ def mounter(html, element, mountPoint, style, instance, attributes, Provider): root.appendChild(mountPoint) def cb(html, me, create): - getProvider = lambda: html.Component - # __pragma__ ('js', '{}', 'class Provider extends html.Component {getChildContext() {const { children, ...context } = this.props;return context;} render({ children }) {return (children && children[0]) || null;}};getProvider=()=>Provider;') - mounter(html, me, create("span"), create("link"), instance, attributes, getProvider()) + mounter(html, me, create("span"), create("link"), instance, attributes, html.ProppyProvider) # __pragma__ ('js', '{}', 'class cls extends HTMLElement{connectedCallback(){cb(window.CustomHtml, this, x => document.createElement(x))}}') # __pragma__ ('js', '{}', 'window.customElements.define(tag, cls, attributes);') From 097dce865c62b6b9bbad8d84df5290ad14cf046a Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sun, 12 Jan 2020 17:03:21 -0500 Subject: [PATCH 22/25] Update __init__.py --- mything/microfrontends/core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mything/microfrontends/core/__init__.py b/mything/microfrontends/core/__init__.py index 02b1eb9..7b7320f 100644 --- a/mything/microfrontends/core/__init__.py +++ b/mything/microfrontends/core/__init__.py @@ -35,7 +35,7 @@ def mounter(html, element, mountPoint, style, instance, attributes, Provider): attrs = dict() for item in attributes: attrs[item] = element.getAttribute(item) - provider = html.h(Provider, {'providers':{'attrs':attrs}}, [instance.view(attrs)]) + provider = html.h(Provider, null, [instance.view(attrs)]) html.render(provider, mountPoint) root = element.attachShadow({ 'mode': 'open' }) style.setAttribute('rel','stylesheet') From 749b4bda5c03d195479b124edd62176b9cd1497c Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sun, 12 Jan 2020 17:10:48 -0500 Subject: [PATCH 23/25] Update __init__.py --- mything/microfrontends/core/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mything/microfrontends/core/__init__.py b/mything/microfrontends/core/__init__.py index 7b7320f..eeed275 100644 --- a/mything/microfrontends/core/__init__.py +++ b/mything/microfrontends/core/__init__.py @@ -35,7 +35,7 @@ def mounter(html, element, mountPoint, style, instance, attributes, Provider): attrs = dict() for item in attributes: attrs[item] = element.getAttribute(item) - provider = html.h(Provider, null, [instance.view(attrs)]) + provider = html.h(Provider, None, [instance.view(attrs)]) html.render(provider, mountPoint) root = element.attachShadow({ 'mode': 'open' }) style.setAttribute('rel','stylesheet') @@ -44,8 +44,9 @@ def mounter(html, element, mountPoint, style, instance, attributes, Provider): root.appendChild(style) root.appendChild(mountPoint) - def cb(html, me, create): + def connect(html, me, create): mounter(html, me, create("span"), create("link"), instance, attributes, html.ProppyProvider) - # __pragma__ ('js', '{}', 'class cls extends HTMLElement{connectedCallback(){cb(window.CustomHtml, this, x => document.createElement(x))}}') + # call customElements.define with class that calls connect + # __pragma__ ('js', '{}', 'class cls extends HTMLElement{connectedCallback(){connect(window.CustomHtml, this, x => document.createElement(x))}}') # __pragma__ ('js', '{}', 'window.customElements.define(tag, cls, attributes);') From cf7cbb50756f34f15118c34e66c415a44756aea8 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Sun, 12 Jan 2020 17:53:58 -0500 Subject: [PATCH 24/25] Create _headers --- _headers | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 _headers diff --git a/_headers b/_headers new file mode 100644 index 0000000..c776a47 --- /dev/null +++ b/_headers @@ -0,0 +1,2 @@ +/* + Access-Control-Allow-Origin: * From 806c23c3833f200d1d8e658842074ee94afe0318 Mon Sep 17 00:00:00 2001 From: Stephen Daves Date: Mon, 13 Jan 2020 08:34:25 -0500 Subject: [PATCH 25/25] Rename _headers to docs/api/_headers --- _headers => docs/api/_headers | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename _headers => docs/api/_headers (100%) diff --git a/_headers b/docs/api/_headers similarity index 100% rename from _headers rename to docs/api/_headers