facebook/react — pull request #760 by syranide (2013-12-31 13:54:45+00:00)
Title: Support for JSX tag namespaces <React:DOM:div />

This has been suggested and discussed before: https://github.com/facebook/react/issues/74, https://github.com/facebook/react/issues/221, https://github.com/facebook/esprima/pull/6, etc.

But it seems to me like the discussions rather died out than a rejection of the issue. So here's for one final resurrection of the issue, with a proper implementation, using the XML-namespaces as seemed to be preferred by @jeffmo.

In my opinion, this issue points to a very pleasant *but not required* feature that vanilla JS has, that JSX currently lacks. To me, it also highlights a possible issue with respect to best practices for sharing components and frameworks, as this may have impact design decisions depending on the authors preference for JS or JSX. Having to locally require and assign every single component intended to be used is *tedious* and unnecessarily verbose. Simply being able to refer to a collection of components, as we easily can in JS, should be available to JSX as well.

```JS
// In plain JS
var MyDOM = require('MyDOM');
MyDOM.ComponentA(null);
MyDOM.ComponentB(null);

// In existing JSX
var MyDOM = require('MyDOM');
var MyDOM_ComponentA = MyDOM.ComponentA;
var MyDOM_ComponentB = MyDOM.ComponentB;

// In enhanced JSX
var MyDOM = require('MyDOM');

```

This brings JS and JSX to parity on this issue in my opinion, without inventing custom features or weird syntaxes, and it seems to me that this should not block any important future design decisions (that would be compatible with JSX), and it's entirely optional for the user.

This PR depends on ... for `fb-esprima`. All feedback and criticisms are appreciated.