-
Notifications
You must be signed in to change notification settings - Fork 30k
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
flag/deprecate global
- recommend globalThis
#47784
Comments
Pull request welcome.
|
wasn't really counting on making runtime warning and having a getter method that warns ppl. |
I'm ok with doc deprecation as well. |
I am interested on fixing this issue. Should the doc consider Stability index also, and mark that as |
better to ask someone else. |
I think you can write something like this |
Legacy seems more appropriate than a deprecation given that it isn't causing any problems and the fact that we might never be able to remove |
@tniessen a doc deprecation dose not mean that we would remove it or dispatch some runtime warning for using it. As other have put it
I'm okey with doc deprecation as well. |
@jimmywarting I am familiar with our history of deprecations, which is how I know that some doc-only deprecations have had virtually zero benefits while causing a significant amount of friction. But ignoring the past, I based my opinion on the Node.js documentation, which says: Deprecated: The feature may emit warnings. Backward compatibility is not guaranteed. Legacy: Although this feature is unlikely to be removed and is still covered by semantic versioning guarantees, it is no longer actively maintained, and other alternatives are available. Based on these definitions, I personally believe that legacy better matches your concerns related to |
PR-URL: nodejs#47819 Fixes: nodejs#47784 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Affected URL(s)
https://nodejs.org/dist/latest-v20.x/docs/api/globals.html#global
Description of the problem
global
should really not be used anymore... it's too nodejs specific. and should be marked as legacyglobalThis
works everywhere and is the "preferred" way for cross compatibilityThe text was updated successfully, but these errors were encountered: