Skip to content
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 support for relative URIs in <script> tags #471

Closed
sjbarag opened this issue Jul 24, 2020 · 3 comments · Fixed by #474
Closed

Add support for relative URIs in <script> tags #471

sjbarag opened this issue Jul 24, 2020 · 3 comments · Fixed by #474
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser scenegraph Affects this project's implementation of the SceneGraph framework

Comments

@sjbarag
Copy link
Owner

sjbarag commented Jul 24, 2020

SGDEX uses relative paths for the uri attribute of its <script> tags, which is perfectly valid in RBI! We should support that here as well.

Example error, from hulu/roca#35

Interpreter found an error:  Error: Encountered an error when parsing component ButtonBar: TypeError [ERR_INVALID_URL]: Invalid URL: ButtonBar.brs
    at componentDefinitions.forEach (/Users/user/Projects/roca-test-roku/nod_modules/brs/lib/index.js:66:19)

Parsing through https://github.com/rokudev/SceneGraphDeveloperExtensions/blob/master/extensions/SGDEX/ButtonBar/ButtonBar.xml with https://github.com/rokudev/SceneGraphDeveloperExtensions/blob/master/extensions/SGDEX/ButtonBar/ButtonBar.brs next to it should be enough to repro this bug

@sjbarag sjbarag added bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser scenegraph Affects this project's implementation of the SceneGraph framework labels Jul 24, 2020
@sjbarag
Copy link
Owner Author

sjbarag commented Jul 24, 2020

@adheus feel free to track this issue for notifications!

@adheus
Copy link

adheus commented Jul 24, 2020

Sure. Thank you!

@adheus
Copy link

adheus commented Jul 24, 2020

In case anyone wants to quickly port a project. I've created a Python script Gist to patch this(don't run this unless you can revert any changes):

https://gist.github.com/adheus/aed5d859da761f4f36e89998c4354b35

sjbarag added a commit that referenced this issue Jul 25, 2020
RBI allows relative paths in <script/> tags, resolved relative to the
XML file that contains the element.  We should support that too, because
SGDEX makes heavy use of relative paths (also it's really handy :D)

fixes #471
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Any difference between this BrightScript implementation and RBI, or otherwise unexpected behavior parser Affects this project's token parser scenegraph Affects this project's implementation of the SceneGraph framework
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants