June 11, 201511 yr I have been reading about custom html elements, but haven't actually used any so far. Today I saw a site using them and their html was very descriptive and nice to read. Found this article and thought it was a good read - http://www.broken-links.com/2015/01/27/best-practice-creating-custom-elements/ What are your thoughts - do you use custom tags?
June 11, 201511 yr I have not been using custom tags. I don't know much about the subject but I worry that they would hurt the semantics of the markup. It looks like your custom element would depend on JS to extend a standard element and inherit its semantic values. Also you could run into problems if one of the names you choose for your custom tags later would be implemented as a standardized element in future HTML specs. On the other hand (as you point out) we would be able to produce very descriptive and readable markup.
June 12, 201511 yr The whole topic of web components interests me greatly and I think this is the way the web is headed based on my reading so far. At the moment they are more for web apps than websites so I wouldn't worry too much about semantics, if you really were worried you can give them aria attributes that fixes any accessability issues. It's a smart way of building modules that can be re-used an in terms of semantics for the programmer it's very good when you can mark up modules that say exactly what they are: <carousel> </carousel> is a lot better than <div class="carousel"> </div> You can use Shadow DOM inside of these which enables you to put in further markup and styles that are scoped only to that module, which is really powerful as CSS has always been seen to have a global scope until now. If you want to get more into this side of things look into React.js This is what I plan to try and learn in the next 12 months, amongst other things. As far as things not requiring JavaScript - We're getting to the point now where a lot of applications are impossible to build without JavaScript so those users unfortunately have to miss out (0.1% of them). Of course where we can build fallbacks then do so, but within reason there's little point in spending a large proportion of your budgeted hours to account for that 0.1%, there's just no return on your clients investment there. This number will also be falling. Try turning JS off and see how horrific your browsing experience is. Edited June 12, 201511 yr by rbrtsmith
June 12, 201511 yr I'm not sure what stage we will be able to use Web Components comfortably. The browser support is terrible, and even polyfills like Polymer are only supported in a handful of browsers. React doesn't use Shadow DOM, so it's one option if you want to break things out into components. It's probably the best solution around currently, and it's used by the likes of Twitter and Facebook for creating re-usable UI.
June 12, 201511 yr I'm not sure what stage we will be able to use Web Components comfortably. The browser support is terrible, and even polyfills like Polymer are only supported in a handful of browsers. React doesn't use Shadow DOM, so it's one option if you want to break things out into components. It's probably the best solution around currently, and it's used by the likes of Twitter and Facebook for creating re-usable UI. One for the future, kinda like flexbox it's been around ages now but were pretty close now to support across the board. 5 years maybe for web components or am I being overly optomistic?
June 12, 201511 yr One for the future, kinda like flexbox it's been around ages now but were pretty close now to support across the board. 5 years maybe for web components or am I being overly optomistic? The new Microsoft 'Spartan' browser still has Web Components and Shadow DOM as under consideration, so it will probably be 5 years before MS even implement them.
June 12, 201511 yr And people are telling me that the 'Spartan' browser is 'brand new' and not just another Internet Explorer. I laugh. I wish Microsoft would just give up on Web Browsers to be honest! I think it's gonna be quite good to be honest, nothing like the abominations of the past, although I find far less bugs with IE11 than I do with Safari. They've been recruiting some very good developers of late. Christian Heilmann recently left mozilla as a standards and web evengelist for to work for MS in a similar role, according to his blog they are actually planning on doing some good things. He wrote about leaving Mozilla to MS here, makes for interesting reading: http://christianheilmann.com/2015/01/29/on-towards-my-next-challenge-2/
June 12, 201511 yr And people are telling me that the 'Spartan' browser is 'brand new' and not just another Internet Explorer. I laugh. I wish Microsoft would just give up on Web Browsers to be honest! You can view the progress of IE's implementations here. If you search for web components you will see that nothing is set in stone, and you can also see other browsers with the feature implemented. Chrome and Opera are currently the only ones that have pushed this idea, with 100% implementation of custom elements, shadow DOM, HTML templates and HTML imports (http://caniuse.com/#search=web%20components).
June 15, 201511 yr Here's a pretty interesting summary, which touches on a lot of what has been discussed here https://hacks.mozilla.org/2015/06/the-state-of-web-components. It looks like it could be extremely time consuming to a standardised spec into all major browsers.
June 15, 201511 yr I see this as nothing more than advertising of a new product. They're hardly going to say: 'Brand new Spartan browser is actually Internet Explorer 12 with a re-brand' are they? As an avid MS avoider I couldn't care less whether it's a good browser or not. I just hope that anything that is developed for proper browsers works okay in it. Not advertising, this is from well known devs in the community, devs who in the past have slated IE. The reason people like Heilmann has gone there is because he thinks he can make a difference there, you'll see a big change in 'IE / spartan' in the next few years. I've never been a fan of MS, but if you get a really strong team of developers there all pushing the standards then good things will happen. Actually for example ES6 in IE11 has pretty good support compared to the other browsers. Safari is the browser that's holding things back now it has the most unresolved bug reports, I don't think it's in Apples interest to push the web platform, afterall it's somewhat in competition to their precious app store. Edited June 15, 201511 yr by rbrtsmith
July 16, 201511 yr A couple of questions answered by Microsoft regarding web components https://blogs.windows.com/msedgedev/2015/07/15/microsoft-edge-and-web-components/. I think it will be a long time until we're able to use them in production. We can't even use Flexbox if browser support is an issue.
July 16, 201511 yr A couple of questions answered by Microsoft regarding web components https://blogs.windows.com/msedgedev/2015/07/15/microsoft-edge-and-web-components/. I think it will be a long time until we're able to use them in production. We can't even use Flexbox if browser support is an issue. Agreed it's gonna be years, but for now we can build React components, not the same at compile time, but at source you get a lot of the same benefits such as encapsulation etc. Edited July 16, 201511 yr by rbrtsmith
Create an account or sign in to comment