Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Web Components and Shadow Dom

I tried searching the forum for this topic and there was nothing so I'm going to make this one just so there is a least one --who knows when a course involving this will appear on the Treehouse Road Map:

http://teamtreehouse.com/roadmap


Personally I get very very frustrated working with HTML.

First of all it's basically 2D, not 3D oriented.

I know HTML was developed by Tim Berners-Lee back in the early 1990s to share CERN papers among the scientists there, not (at that time) to do 3D texturemapping:

http://tulrich.com/geekstuff/canvas/perspective.html

http://www.html5canvastutorials.com/three/html5-canvas-webgl-texture-with-three-js/

...and hardware accelerated in browser graphics including realtime augmented reality overlays for real time video feeds:

http://www.w3.org/community/ar/demos-and-projects/

https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Manipulating_video_using_canvas


As you can see from the links above, there are some interesting graphics happening in the browser these days...

Here's a few Treehouse blog posts related to this:

http://blog.teamtreehouse.com/3d-in-the-browser-webgl-versus-css-3d-transforms

http://blog.teamtreehouse.com/real-time-3d-web

http://blog.teamtreehouse.com/5-incredible-webgl-demos

(the above link includes a screenshot of the Unreal Engine HTML5 demo "Epic Citadel, which sadly doesn't exist anymore)

http://blog.teamtreehouse.com/the-beginners-guide-to-three-js

The last link represents the closest Treehouse has come to have a course devoted to doing 3D in a browser.


However, it's going to take a whole other set of technologies to overcome the limitations of the DOM.

What limitations are we talking about?

Read this article:

http://acko.net/blog/shadow-dom/

..about how:

"Unfortunately HTML is crufty, CSS is annoying and the DOM's unwieldy. Hence we now have libraries like React. It creates its own virtual DOM just to be able to manipulate the real oneβ€”the Agile Bureaucracy design pattern.

The more we can avoid the DOM, the better. But why? And can we fix it?"

It's basically an intro to shadow DOMs.

Shadow DOMs are one of the 4 pieces of something called Web Components:

http://webcomponents.org/

These 4 pieces are:

  • templates, which define chunks of markup that are inert but can be activated for use later;
  • decorators, which apply templates to let CSS affect rich visual and behavioral changes to documents;
  • custom elements, which let authors define their own elements, including new presentation and API, that can be used in HTML documents; and
  • shadow DOM which defines how presentation and behavior of decorators and custom elements fit together in the DOM tree.

..per this page:

https://dvcs.w3.org/hg/webcomponents/raw-file/57f8cfc4a7dc/explainer/index.html

Here's another page on shadow DOMs from the Polymer project:

https://www.polymer-project.org/platform/shadow-dom.html


There's also nothing on Treehouse about Web Components rival - React, which uses a virtual DOM instead of a shadow DOM.

I guess we're lucky Treehouse even has one Angular.JS course at this point..

Here's the only Treehouse forum thread I could find about React (where I posted some links):

https://teamtreehouse.com/forum/reactjs


There are other things happening to expand the graphic possibilities/potentialities of the browser.

There is the Ubisoft browser version of the "From Dust" game,

http://from-dust.ubisoft.com/

(copy link into a current version of Google Chrome)

...which I believe is based on the Google NACL (Native Client) technology:

http://www.chromium.org/nativeclient/reference/research-papers


When will these interesting (if experimental) technologies become cross browser friendly/compatible?

Probably after every single version of IE supports every CSS3 and SVG feature.

I wish I had a "twiddling fingers my fingers" emoticon to insert here..

Oh well..it's probably not anything that anyone is interested in anyways..just ignore my self-mumblings..

1 Answer

Hey James, there's a Treehouse workshop entitled 3D in the Browser. I think Chris Coyier expanded on Steven Wittens's article with Hatin’ on Web Tech.

With the given nature of this topic, and maybe even your personal view, you might also like W3C and WHATWG should die... (explicit language be warned).