Olical / react-faux-dom

DOM like structure that renders to React (unmaintained, archived)
http://oli.me.uk/2015/09/09/d3-within-react-the-right-way/
The Unlicense
1.21k stars 87 forks source link

use ES classes for more accurate emulation #117

Closed graingert closed 7 years ago

graingert commented 7 years ago

eg:

class CSS2Properties {
  setProperty(name, value) {
    this[name] = value;
  }
}

class Element {
  constructor(nodeName, parentNode) {
    this.nodeName = nodeName;
    this.parentNode = parentNode;
    this._style = new CSS2Properties();
  }

  get style() {
    return this._style;
  }
}
graingert commented 7 years ago

and like webpack or etc.

Olical commented 7 years ago

I guess because it's already being run through webpack it wouldn't be that hard to do. I just didn't want to incur the overhead(ache) of transpiling JavaScript. I'm open to merging PRs for this, but I have no desire to change to a newer syntax just for stylistic reasons.

I realise that class construction is arguably better when you use actual classes, but is it actually an issue for anyone right now? If not, maybe it's not worth the risk of breaking things.

I stuck to ES5 just to keep things simple since I didn't require the newer parts of the language spec.

graingert commented 7 years ago

It makes life easier to add getters and setters

On 16 Oct 2017 14:14, "Oliver Caldwell" notifications@github.com wrote:

I guess because it's already being run through webpack it wouldn't be that hard to do. I just didn't want to incur the overhead(ache) of transpiling JavaScript. I'm open to merging PRs for this, but I have no desire to change to a newer syntax just for stylistic reasons.

I realise that class construction is arguably better when you use actual classes, but is it actually an issue for anyone right now? If not, maybe it's not worth the risk of breaking things.

I stuck to ES5 just to keep things simple since I didn't require the newer parts of the language spec.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Olical/react-faux-dom/issues/117#issuecomment-336882841, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZQTGfzc_zlY3ewmXMLJHrV0Xw0nwSRks5ss1bKgaJpZM4P3HEm .

Olical commented 7 years ago

Going to close this one since it's not a show stopper and I'm just trying to keep up with maintenance at the moment.