-
Notifications
You must be signed in to change notification settings - Fork 7
displayName #31
Comments
Thoughts @marionettejs/marionette-core ? |
I have thought quite a lot about giving my constructors names. I forget the use case atm. But the line of thinking usually goes.. 'Oh man that would be SO useful.' 'but oh so gross, so no.' I will think about what that use case was and post another comment. fwiw it did not have to deal with stack traces : D |
Oh I think it may have had to do with some magic, like...
I pretty much do those 2 things for every view. Ikno,ikno, gross. |
So what made me think of this is Babel's support for It will transform: var Cool = React.createClass({}); To: var Cool = React.createClass({
displayName: "Cool"
}); I was thinking I could do something similar. |
I think we should. It's an Mn issue too. Also chrome DevTools has done this for awhile with scope variables |
Tbqh I don't think the stack trace solution is super useful. Not enough to warrant some build step magic, at least. |
That's the thing about build step magic, it only has to be slightly useful because it's simple as hell to add ;P Also, this is useful enough that we manually do it at work with a |
I'm a 👍 marionettejs/backbone.marionette#2425 It seems that people are finding alternate ways of solving this. At least this is perhaps the most-best standard-ish way of doing it. |
I have an initial version hacked together, this is the difference in the call stack: Before Metal.Class.extend.foo
Metal.Class.extend.constructor
MyClass.extend.constructor
(anonymous function)
MyClass.extend.baz After: MyClass.prototype.foo
MyClass
SubClass
superWrapper(SubClass)
SubClass.baz 🔥 However, this change adds a bit of perf weight to subclassing. I'm wondering if we can create a "debug" version of this library to include? And we can use If anyone wants to try out this version of the library, try this out. |
Note to self: I need to make the |
With a little bit of love Metal.Class could support (the somewhat controversial)
displayName
Which could take stack items like these:
And replace them with
The text was updated successfully, but these errors were encountered: