Overview

Welcome to the December 22 RokuCommunity update. Here are some of the key highlights:

Debugging

SceneGraph Inspector properly orders ArrayGrid children

The VSCode extension has a built-in node viewer (similar to RALE) called SceneGraph Inspector. In past releases, SceneGraph Inspector was able to show the children of ArrayGrid nodes (MarkupList, RowList, etc…), but these child nodes were loaded in seemingly random order. As of v2.38.4, these children are now ordered properly.

scenegraph inspector children

Focus ArrayGrid child in Scenegraph Inspector’s “Show Focused Node” action

Historically the “Show Focused Node” logic in the Scenegraph Inspector would focus the ArrayGrid itself. As part of v2.38.4, that action will now dig deeper into the ArrayGrid child and focus the actual focused node.

focus node

Improved Roku Registry panel functionality

We’ve added “refresh” and “clear” buttons to the Roku Registry panel. The import/export functionalty has also been fixed.

refresh and clear Roku Registry buttons

Fix continue repeat bug for debug protocol

We’ve fixed a debug session bug where a breakpoint would be replayed several times. This was only present when enableDebugProtocol was set to true and the developer issued a continue command. This was mostly caused by an underlying bug in the Roku OS when using the ADD_CONDITIONAL_BREAKPOINTS command, so to mitigate the problem we now only use that command when a user has actually defined a conditional breakpoint.

breakpoint-stepping

Better component library postfixing

A popular feature of the BrightScript Language extension for VSCode is the ability to host/sideload component libraries directly through the editor instead of needing to manually run an http server. (you can read more about component library support here). The telnet debugger truncates file paths after a certain length (i.e. ...ource/main.brs), which means there are situations where we can’t tell if the path references a file in the main app or a component library. To work around this, all .brs files in the comonent library are renamed with a suffix. (i.e. pkg:/source/networking.brs -> pkg:/source/networking__lib1.brs). Then, when we receive a path from the server, we unravel that path and do an .endsWith() check to find the referenced path.

However, this rewrite logic was a little too aggressive, and would rewrite every script import regardless of whether it actually existed in the project, including things like: common:/LibCore/v30/bslCore.brs. #112 fixes this issue by restricting that rewrite logic to only relative, pkg:/, and libpkg:/ paths.

image

Formatting

Better continue indentation

The brighterscript-formatter has been enhanced to properly handle the new continue while and continue for keywords that were added in 11.5

format-continue

BrighterScript

More stable watch mode

We’ve fixed an issue that would crash brighterscript when running in watch mode. This was happening because we weren’t guarding the transpile flow, so if a 5 second transpile kicked off, and then a file changed, it would try to run another transpile. Since brighterscript modifies the AST during transpile, this could cause very strange behaviour. We fixed the issue by queueing transpile requests and running them one at a time instead of in parallel.

Discard function parameter types

We’ve added a new performace-focused flag to BrighterScript that will remove all types from function parameters when transpiling the project. This should give your app a small performance boost since there is a runtime cost to running those checks.

image

Preventing incorrectly nested statements

We’ve added a new diagnostic that flags top-level statements (like namespaces, classes, etc…) whenever they are incorrectly defined inside of nested blocks (like function bodies, if statements, etc). image

Miscellaneous BrighterScript fixes

  • We fixed a crash caused when validating continue statements (#752)
  • For plugin authors, we’ve added missing visitor params for DottedSetStatement (#748)
  • Ensure enums and interfaces are included in type definition files (#757)

bslint

Fix false positive for missing return

Bslint 0.7.6 includes a fix to account for throw statements when detecting missing return statements

Before:

image

After:

image

Add new aa-comma-style option all-except-single-line

bslint’s aa-comma-style rule has been given a new option, all-except-single-line, which will enforce that every line in an associative array, except for single-line statements.

image

Notable bug fixes

  • vscode-brightscript-language: Make vsix smaller by excluding unneeded files (#454)
  • roku-debug: stability around breakpoint verification (#117)

Thank you

Last but certainly not least, a big Thank You to the following people who contributed this month:

Contributions to vscode-brightscript-language:

Contributions to brighterscript:

Contributions to roku-debug:

Contributions to brighterscript-formatter:

Contributions to bslint:

Home What's new Slack channel Newsletter Edit this website on Github

Legal notice

The views and opinions expressed in this website and all of its pages are those from within our open source community and do not represent the views or positions of Roku, Inc. or any entities they represent.

Designed with favorite by @arturocuya, powered by Astro