rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
152 stars 47 forks source link

Support user-defined overridden native components #1200

Open TwitchBronBron opened 1 month ago

TwitchBronBron commented 1 month ago

Users can override built-in components. Here are some findings. We should eventually support this.

Implementation in brighterscript:

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" ?>