Open TwitchBronBron opened 1 month ago
Users can override built-in components. Here are some findings. We should eventually support this.
Implementation in brighterscript:
Button
roSGNodeButton
scenegraph.Button
We have discovered that it is possible to override the native SceneGraph components by defining an XML component with the same name.
Questions:
Why does this work?
Is this intentional?
Could Roku please provide an official stance on whether this can be safely used or should never be used in our apps?
For example:
pkg:/components/Button.xml:
pkg:/components/MainScene.xml
<?xml version="1.0" encoding="utf-8" ?>
Screenshot of the above example:
Cannot extend native component with same name.
Users can override built-in components. Here are some findings. We should eventually support this.
Implementation in brighterscript:
Button
should now makeroSGNodeButton
point to the user's instance.scenegraph.Button
).We have discovered that it is possible to override the native SceneGraph components by defining an XML component with the same name.
Questions:
Why does this work?
Is this intentional?
Could Roku please provide an official stance on whether this can be safely used or should never be used in our apps?
For example:
pkg:/components/Button.xml:
pkg:/components/MainScene.xml
<?xml version="1.0" encoding="utf-8" ?>
Screenshot of the above example:
Cannot extend native component with same name.![image](https://github.com/rokucommunity/brighterscript/assets/2544493/0f81cc6d-4b78-4401-9cec-863511cb3e3b)