-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
[js] move standard library types to js.lib #7390
Conversation
@Simn by the way, do you think we could auto-generate a nicer deprecation message for |
How exactly would that be better? To the user it only matters what he should use instead. |
At the moment it outputs the default |
Ah, I thought it said something like that. In that case I agree we can maybe improve the message. |
That seems like a lot of breaking changes. I would prefer we rename js.Map to js.NativeMap instead, that's what we do with other platforms as well. |
All of the types except
On some we do, on others we don't. I personally find the approach with separate package and the same names as native cleaner, because they are easier to find, and also I don't like mixing "support" classes like But anyway, I don't have that strong position on this, maybe some js target power users want to comment here? (cc @elsassph @back2dos) |
On TypedArrays: it's safe to move them out of Then we just need to add typedefs to html-externs/haxe/js/html so that they don't get lost when externs are generated |
Not a fan of |
Not sure what "lib" is supposed to mean. Seems like "global" would be a better choice of name (it's how JavaScript people would call it). Perhaps "native" would work too (it's how Haxe people would call it). Other than that I pretty much like these changes. I too prefer to keep the names close to what the native stuff is, as that makes porting easier. |
Breaking js.Promise seems like a bad idea. |
It's not breaking, there are backward-compatibility typedefs. |
with a deprecated warning, which might trigger hundreds of warnings in code using it. |
A quick github search: There's a few false positives in the latter result set, but I think it's still blatantly clear that we have far more serious breaking changes, that by the way don't result in a warning, but an error. So let's be consistent. Personally, I think the best solution is to put the typedefs into hx3compat and add the deprecation warnings there behind a flag to turn them on. This will provide a single gradual migration strategy that can be communicated clearly. |
This sounds good to me, I totally forgot about hx3compat! |
hx3compat idea is good for projects - libraries will have a harder time but that's manageable. |
What's the status here? |
I'm still against changing that. Renaming js.Map to js.NativeMap should solve the original problem. |
Having |
I'm conflicted because the Additionally, the js typedarrays need moving out of |
I'm still against |
I am fine with any name as long as they are moved. Because |
Agreed, we should do this for 4.0 final. |
Conflicts have been resolved. |
Please remove, it breaks all libraries that reside in the |
I'd remove them, but what about @ncannasse ? :) |
Good for me with removal |
CI failure is not related. |
as I mentioned in #7260, it makes sense to have all "standard library" classes in
js.lib
sub-package so it doesn't interfere with standard types (e.g.Map
) resolution from within otherjs
packages (e.g.js.node.*
). we do similar thing forpython.lib
, and I think it looks nicer this way.also, as mentioned by @haxiomic in #6586 (comment), typed array classes don't really belong to
js.html
and probably should also be moved tojs.lib
(IMO notjs.lib.typedarray
, becausejs.lib
conveniently represents "top-level" js standard types and typed arrays are also available as top-level)