-
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
ESM Script base class #6367
ESM Script base class #6367
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
What would be the impact to users in terms of migrations or API changes? |
|
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.
Approving with a final round of comments.
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
* Cherry pick -> ESM Script base class #6367 * Ensure ScriptType members are initialized correctly (#6908) * Fix initialization of __attributes in ScriptType class * Refactor ScriptType class and add constructor * Remove empty line in ScriptType class definition * Adds @Alpha flag to Script Class * merge fixes + update to v1 linting requirements
This PR proposes a new
Script
base class for ESM Scripts. Attributes are declared via jsdoc tags as opposed toScript.attributes.add()
.ScriptType
class persists for legacy support. The newScript
base class:ScriptAttributes
classAPI Changes
New ESM
Script
ClassA new minimal base. Attributes are declared via jsdoc tags. Runtime attributes via
Script.attributes.add()
is removed. Fixes ScriptType does not support class syntax #6316assignRawToValue
- New method that takes a script instance, a schema and value and assigns a new value on the script instance`ScriptRegistry.addSchema
/getSchema
- Stores and fetches an attributes schema from it's associated asset<scriptName, schema>
Files renaming
For consistency, the following files have been renamed
script.js
->script-create.js
- Contains legacypc.createScript()
andpc.registerScript()
script.js
contains newScript
base classscript-type.js
contains legacyScriptType
classTests
npm run test:karma