babel-plugin-transform-custom-element-classes icon indicating copy to clipboard operation
babel-plugin-transform-custom-element-classes copied to clipboard

Add this behavior to Babel

Open robdodson opened this issue 7 years ago • 8 comments

I spoke with @hzoo at the recent Chrome Dev Summit afterparty about this issue, and we discussed updating the behavior in Babel to call Reflect.construct when extending exotic things like HTMLElement.

I was wondering if the maintainers of this project would be interested in helping put together a PR to explore updating Babel's behavior?

cc @owencm @justinfagnani

robdodson avatar Nov 03 '17 18:11 robdodson

FWIW, I strongly support this as a way to fix https://github.com/facebookincubator/create-react-app/issues/3225

owencm avatar Nov 03 '17 22:11 owencm

It may just be me but, I've never actually been able to get this plugin to work.

treshugart avatar Nov 05 '17 01:11 treshugart

@treshugart I put together a simple vanilla element and example and it seems to be working OK. Do you happen to have a reproducible test case where it breaks?

robdodson avatar Nov 24 '17 15:11 robdodson

Would love to deprecate this repository if this feature is upstreamed.

josh avatar Dec 12 '17 20:12 josh

is anyone familiar enough with the Babel codebase to do the upstreaming work...? 😁 cc @justinfagnani, @fredkschott

robdodson avatar Dec 12 '17 21:12 robdodson

Can do a call to go over things if it's helpful. https://github.com/babel/babel/issues/4480#issuecomment-351056130 some people are really excited for this kind of thing + https://github.com/WebReflection/babel-plugin-transform-builtin-classes

Ok @nicolo-ribaudo started a PR so maybe everyone can help review if it covers the same behavior as this plugin. https://github.com/babel/babel/pull/7020

hzoo avatar Dec 12 '17 21:12 hzoo

Hey @robdodson, I think I was just being a dummy. I was using it on the consuming end as opposed to building Skate with it (IIRC). See comment here. Looks like there's plans for this to go into Skate as well.

treshugart avatar Dec 12 '17 23:12 treshugart

Hi everyone, Can someone confirm if the behavior of this plugin is covered by https://github.com/babel/babel/pull/7020 or not? I don't want to block that PR on this, but I can look to port this plugin in @babel/plugin-transform-classes if the other Babel team members agree.

nicolo-ribaudo avatar Dec 18 '17 22:12 nicolo-ribaudo