-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add Script alias #6237
Add Script alias #6237
Conversation
What was the reason for this? |
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.
Should we rename ScriptType
to Script
in that module, and export it as ScriptType
for compatibility?
Yeah, because otherwise, the API ref will continue to show |
@willeastcott are we happy to simply rename the class and keep the |
Rename filename as well, we keep those in sync. |
Maybe do:
|
BTW, we should consider deprecating and hiding |
We also need to consider the impact in the Editor. Will the Editor be able to still use at least few previous engine versions? Do we need to add some type checking to it or similar? Maybe it all just works, but we need to check. |
Makes sense, although strictly speaking this would be a breaking change right?
Yeah it should be fine, editor only uses ScriptType when parsing and |
Actually maybe not a breaking change since we haven't yet published the ESM build . Mainly thinking about `import { Script } from 'playcanvas/framework/script/script-type.js' |
You would never do this normally it would be |
PR needs more work based on feedback.
This has now been updated
*Note that now ScriptType does not exist, it does not generate a corresponding url. It would be great to retain the original, to indicated to users that it has been renamed |
Any more updates on this @willeastcott? Keen to get this merged |
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.
Nice! LGTM.
This reverts commit dd65f24.
This reverts commit dd65f24.
Having some discussions with @willeastcott, with the new ESM Script, we want to keep the default script boilerplate as clean as possible. This PR exports an alias for
ScriptType
namedScript
UPDATE:
ScriptType has been added to the deprecation.js file
Improved dicunmentation for Script to include ESM example
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.