Web Components Rant...
-
After a long time of 'Umming' and 'Arring' I've finally succumbed to the dark side and embraced the concept of 'Web Components'. They happen to offer the ideal solution (in fact) for a project I'm currently working on. The concept (in the unlikely event that any of you are even vaguely interested ;P ) is that they allow me to break a large code and mark up base into reusable blocks (Templates), something 'real' developers have had the ability to do for decades, they allow me to sandbox a node's attribution (Shadow DOM), which is so Firkelling Handy it's a marvel I've got this far without it, and then I can allegedly Import (for import read: #include) all this W3C sanctioned loveliness into my project! I have, to all intents and purposes, objects in a web app! BUT... The only browser that supports the #include bit is only available in Narnia, will only run on an Audi, needs to be launched from the command line with several incomprehensible flags, whilst simultaneously holding down four modifier keys, and standing on one leg, facing North North-East, on a specific day in the Wickan Calendar... WHY? They all support (to some degree) the other 'components', so if they will let me create templates and add them to the Shadow DOM, even create my own tags and use them willy nilly throughout my page, why in the name of all that's holy do I have to put the whole sorry mess in one bloody great big file? Flumoxed. I am going to walk slowly away from the keyboard now, before I type something I may regret. Danny
-
After a long time of 'Umming' and 'Arring' I've finally succumbed to the dark side and embraced the concept of 'Web Components'. They happen to offer the ideal solution (in fact) for a project I'm currently working on. The concept (in the unlikely event that any of you are even vaguely interested ;P ) is that they allow me to break a large code and mark up base into reusable blocks (Templates), something 'real' developers have had the ability to do for decades, they allow me to sandbox a node's attribution (Shadow DOM), which is so Firkelling Handy it's a marvel I've got this far without it, and then I can allegedly Import (for import read: #include) all this W3C sanctioned loveliness into my project! I have, to all intents and purposes, objects in a web app! BUT... The only browser that supports the #include bit is only available in Narnia, will only run on an Audi, needs to be launched from the command line with several incomprehensible flags, whilst simultaneously holding down four modifier keys, and standing on one leg, facing North North-East, on a specific day in the Wickan Calendar... WHY? They all support (to some degree) the other 'components', so if they will let me create templates and add them to the Shadow DOM, even create my own tags and use them willy nilly throughout my page, why in the name of all that's holy do I have to put the whole sorry mess in one bloody great big file? Flumoxed. I am going to walk slowly away from the keyboard now, before I type something I may regret. Danny
Correct me if I'm wrong.... WebComponent are awesome, but they work nowhere. Is that it? Web developmemnt is so great hey!?! :D Let me suggest a working alternative... Give a go (ha! pun! ;P ) at VueJS[^], be inspired by my collection of VueSamples[^]! :)
All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!
-
After a long time of 'Umming' and 'Arring' I've finally succumbed to the dark side and embraced the concept of 'Web Components'. They happen to offer the ideal solution (in fact) for a project I'm currently working on. The concept (in the unlikely event that any of you are even vaguely interested ;P ) is that they allow me to break a large code and mark up base into reusable blocks (Templates), something 'real' developers have had the ability to do for decades, they allow me to sandbox a node's attribution (Shadow DOM), which is so Firkelling Handy it's a marvel I've got this far without it, and then I can allegedly Import (for import read: #include) all this W3C sanctioned loveliness into my project! I have, to all intents and purposes, objects in a web app! BUT... The only browser that supports the #include bit is only available in Narnia, will only run on an Audi, needs to be launched from the command line with several incomprehensible flags, whilst simultaneously holding down four modifier keys, and standing on one leg, facing North North-East, on a specific day in the Wickan Calendar... WHY? They all support (to some degree) the other 'components', so if they will let me create templates and add them to the Shadow DOM, even create my own tags and use them willy nilly throughout my page, why in the name of all that's holy do I have to put the whole sorry mess in one bloody great big file? Flumoxed. I am going to walk slowly away from the keyboard now, before I type something I may regret. Danny
There is a polyfill that will allow use in browsers without native support, at least according to: WebComponents.org[^]. I've not tried it, but worth a look.
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
-
After a long time of 'Umming' and 'Arring' I've finally succumbed to the dark side and embraced the concept of 'Web Components'. They happen to offer the ideal solution (in fact) for a project I'm currently working on. The concept (in the unlikely event that any of you are even vaguely interested ;P ) is that they allow me to break a large code and mark up base into reusable blocks (Templates), something 'real' developers have had the ability to do for decades, they allow me to sandbox a node's attribution (Shadow DOM), which is so Firkelling Handy it's a marvel I've got this far without it, and then I can allegedly Import (for import read: #include) all this W3C sanctioned loveliness into my project! I have, to all intents and purposes, objects in a web app! BUT... The only browser that supports the #include bit is only available in Narnia, will only run on an Audi, needs to be launched from the command line with several incomprehensible flags, whilst simultaneously holding down four modifier keys, and standing on one leg, facing North North-East, on a specific day in the Wickan Calendar... WHY? They all support (to some degree) the other 'components', so if they will let me create templates and add them to the Shadow DOM, even create my own tags and use them willy nilly throughout my page, why in the name of all that's holy do I have to put the whole sorry mess in one bloody great big file? Flumoxed. I am going to walk slowly away from the keyboard now, before I type something I may regret. Danny
Danny Martin wrote:
The only browser that supports the #include bit is only available in Narnia, will only run on an Audi, needs to be launched from the command line with several incomprehensible flags, whilst simultaneously holding down four modifier keys, and standing on one leg, facing North North-East, on a specific day in the Wickan Calendar... WHY?
Because "It works the way want it to!", that's why. Have you not met many open source devs?
I wanna be a eunuchs developer! Pass me a bread knife!
-
Danny Martin wrote:
The only browser that supports the #include bit is only available in Narnia, will only run on an Audi, needs to be launched from the command line with several incomprehensible flags, whilst simultaneously holding down four modifier keys, and standing on one leg, facing North North-East, on a specific day in the Wickan Calendar... WHY?
Because "It works the way want it to!", that's why. Have you not met many open source devs?
I wanna be a eunuchs developer! Pass me a bread knife!
Alas, I have met several. They all lived in Narnia and drove Audis... :sigh: Danny
-
There is a polyfill that will allow use in browsers without native support, at least according to: WebComponents.org[^]. I've not tried it, but worth a look.
"If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.
Cheers Rob, Yes, there are a couple of libraries out there to patch the 'standard', but the use of templates was to reduce the code base... There are work-arounds, I currently include js files that render the modules programatically. HTML templates would have reduced the byte count considerably. My issue is that I need the browser to cache my files (it's an app that requires some limited offline capability), so server side options like AJAX and PHP will fail. iframes would work, but there is a large amount of interaction between elements, which is a real ball ache with multiple sub documents. There's also just something inherently wrong with iframes... My real beef is that, at least according to caniuse.com, Firefox has no intention of supporting 'import', now or in the future. It's available through a switch, but will never make the mainstream engine. The other components are in development or working, just not import. "Ho hum" though eh? Danny