-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(un-es6-class): support extending super class #58
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
==========================================
+ Coverage 91.33% 91.41% +0.07%
==========================================
Files 82 82
Lines 10460 10539 +79
Branches 1424 1450 +26
==========================================
+ Hits 9554 9634 +80
+ Misses 866 864 -2
- Partials 40 41 +1 ☔ View full report in Codecov by Sentry. |
At first, I thought this should be implemented in another way. Finding helper functions like This PR can be merged, and we can have another one that adds these helpers into the module scanning, and use the minified name from the module scanning result. |
I see. We can wait for implementing helper functions detecting before merging this PR. |
Helper functions like How can we detect them? |
@g-plane While I don't know the specific answer to that off the top of my head, here are the relevant issues/references related to it:
Also:
|
Based on what I know, helpers can be inlined or extracted. Currently, the module scanning is based on regex matching (see babel reference) which also works for inlined helpers. These examples have been updated to external-helper mode. |
Babel runtime helpers detection is added. |
Seems like these helpers can also be imported from the runtime helpers. import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _createSuper from "@babel/runtime/helpers/createSuper"; |
Oh, |
This PR only handles extending class (
class C extends B {}
) but doesn't handlesuper()
call.super()
call should be solved in separated PR.