-
Notifications
You must be signed in to change notification settings - Fork 449
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
Deprecate %external
extension
#6906
Conversation
%exteranl
in favor of %global
and %define
%external
in favor of %global
and %define
Ok It seems having And having For example |
I would prefer getting rid of @scope("globalThis")
external window: option<Dom.window> = "window" @cristianoc @zth what do you think? |
Agreed for |
In our projects I am using a binding type t = [#development | #production]
@scope(("process", "env")) external env: t = "NODE_ENV" which works fine for me. if NodeEnv.env === #development { ... } is compiled to if (process.env.NODE_ENV === "development") { ... } |
Ok then, I will change this PR to adding |
I think you will need to wait for a new rescript-react release without |
Ok then just deprecation warnings for v12.0 |
%external
in favor of %global
and %define
%external
extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it deprecated or entirely removed?
Currently just print a deprecation warning ( Because there are some actual usage. Particularly it is used inside some official libraries like |
@cknitt any comment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks!
Resolves #6905
Added new extensions that can replace undocumented feature
%external
.Added-> separated into AddJs.globalThis
APIJs.globalThis
object binding #6909%global
to makeglobalThis
referencing easy and replaces most of the existing%external
use cases.%define
is compatible with bundlers' define plugin, but with a guard condition. (same behavior with existing%external
, but with sensible semantic)%external
.Does this change make sense?