worker-dom
worker-dom copied to clipboard
Linter + rollup plugin for transpile workarounds
E.g. we workaround super.getter (#332) to avoid an expensive transpile. It would be nice to have:
- A linter to catch and ban future instances of
super.getterpattern. - A rollup plugin to remove the workaround for module outputs.
Another pattern here would be to selectively modify the root source in this case for the nomodule output.
Input
class Y {
get textContent() {
return 'text';
}
}
class x extends Y {
get textContent() {
return super.textContent;
}
}
Module Output
class Y {
get textContent() {
return 'text';
}
}
class x extends Y {
get textContent() {
return super.textContent;
}
}
Nomodule Output (Before Babel)
class Y {
get textContent() {
return 'text';
}
_textContent() {
return 'text';
}
}
class x extends Y {
get textContent() {
return super._textContent();
}
}