-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Removing "implements Dynamic" (and implements Dynamic<T>) #6191
Comments
Kill it! :) |
I never needed it for Haxe code, however for crazy dynamic language extern it sometimes make sense, e.g. https://github.com/nadako/hxnodejs-commander/blob/master/src/js/npm/commander/Command.hx. Maybe make it an extern-only feature? (although maybe an |
If it was really renamed to dynamite then it would make users feel more guilty when using, I think that it would reduce it's use, and make Simns life simpler, but Haxe is pragmatic and that's really good... but probably extremely annoying to the implementation, I don't use Dynamic but it's really important for new users - and they all stop using, it once they have properly transitioned, but to make Haxe less accessible is not productive. |
Let's rename |
Untyped is more accurate but Unsafe seems ideal and if you just changed it for Haxe 4 users would be prompted to check codebases. |
It was mostly used for Flash 8 interaction so yes I'm ok to remove it for Haxe 4 . I guess that also stands for |
And no renaming Dynamic is out of question, it would break a lot of code for no valid reason. |
Yeah, This issue is about implementing Dynamic which indeed seems like a weird feature nowadays. I'm all for removing it (though we should think of some kind of replacement for externs like I linked above). |
I +1 |
Let's restrict it for externs for now then, and then maybe remove in favor of some good solution for externs. If you wish I can make a PR for this. |
Removing Dynamic will break a lot of libraries, this seems really problematic suggestion when I look at it from the perspective of developers using Haxe for real projects. For instance git version of polygonal-ds has 181 uses in 110 *.hx files, I am sure he can work round but larger projects like OpenFL, Flambe etc... ecosystems that is going to take quite an effort Actuate is full of Dynamic. When I search my haxelib folder through only *.hx files for the word "Dynamic". That's about 1.3 uses of 'Dynamic' per current haxe library class perhaps more, to remove the feature will kill many haxelib projects even with fazed introduction, that's worse than just renaming it! Loosing libraries that are used rarely, will reduce the possible soution space which already small compared to some languages. Not sure on best approach, but I think that such a change needs to include an audit of current haxelib and larger community... or you might end up alienating some users, including comercial ones. I am all for removing Dynamic in theory... but it in practice it could be a real worry, I would be up for banning use for new libraries but historic ones that's harder. Playing devils advocate, just airing my worry - removing Dynamic to make the compiler more robust but force significant changes in hundreds of Haxelibs, broken libraries has as much of negative effect on Haxe as obscure compiler bugs, any PR needs to address this possible problem. |
Summary 1.3 Dynamics per average haxelib class feel free to add your own local stats. |
Guys please, this is about |
oh sorry. |
To use a MovieClip in flash you use implements Dynamic, guess flash is less relevant now. |
|
so this would still be allowed? |
Yes, but how is this related to |
The removal of |
Can you not make |
Maybe, I don't know. :) I don't really want to mess with haxe.remoting myself, in part because I have 0 test cases for it. |
I think it's safe to say that if you remove |
Removing this feature will break these features in OpenFL:
Here is an example from ActionScript: // The first method passes the string to be decoded to the URLVariables class constructor:
var urlVariables:URLVariables = new URLVariables("firstName=Tom&lastName=Jones");
lbl.text = urlVariables.lastName + "," + urlVariables.firstName;
// The second method uses the decode() method to parse the URL encoded string:
var urlVariables:URLVariables = new URLVariables();
urlVariables.decode("firstName=Tom&lastName=Jones");
lbl.text = urlVariables.lastName + "," + urlVariables.firstName; Workaround: Using
var shader = new Shader ();
shader.glFragmentSource = "...";
shader.glVertexSource = "...";
shader.data.myAttribute.value = [ 1, 0, 0, 1 ]; Workaround: Using
var example = Assets.getMovieClip ("library:UIDemo");
example.header.title.text = "Hello World";
trace (example.footer.width); Workaround: There is no workaround for this behavior without breaking significant code. cast (cast (example.getChildByName ("header"), DisplayObjectContainer).getChildByName ("title"), TextField).text = "Hello World";
trace (example.getChildByName ("footer").width);
Workaround: This might not be significant. Without So I guess we have some work to do, but the MovieClip class is most painful |
@jgranick thanks for taking the time to report the usages openfl is making of it |
We've made the changes on our end, for some of the types, we are using the following pattern: @:forward() abstract CustomType(Dynamic) from Dynamic to Dynamic {
public function new () {
this = {};
}
} If there are any issues with this pattern (or ways we could better emulate the previous behavior) please let me know. I understand the motivation |
Closing this in favor of #6586 which is pretty much a superset. |
Just found this in the unit tests:
So it should probably be implemented. Or we take the opportunity and remove this annoying feature.
The text was updated successfully, but these errors were encountered: