Debugging

New Device View with interactive node inspector

We introduced a new “Device View” panel in vscode extension version v2.39.0 that can be used while debugging to view the current video output of the active Roku. We achive this by capturing screenshots as fast as the Roku will provide them (roughly 1 image per second). Perhaps the coolest feature of this new panel is the interactive node inspector which is similar to the “inspect element” feature in modern web based developer tools. When activated, you can hover over any part of the screenshot and it will show the current SGNode and focus that node in the tree view. (#465)

device view

Formatting

Fix formatting for indenting optional chaining expressions inside arrays (#71)

We fixed a bug in the indent formatter that would incorrectly de-indent whenever the ?[ token was encountered.

Before:

image

After:

image

Language Features

Flag using optional chaining in left-hand-side of assignments

The vscode extension (and BrighterScript) now properly flags when using optional chaining in the left-hand-side of assignments since doing that will cause a runtime error on-device. (#782) image

New severityOverride option

BrighterScript v0.62.0 added a new ‘severityOverride’ option that can be used to increase or decrease the severity of diagnostics. (#725)

For example, consider the bs1013 warning which says "This file is not referenced by any other file in the project". If you wanted to turn that warning into an error, update the bsconfig as follows:

{
    "diagnosticSeverityOverrides": {
        "1013": "error"
    }
}

Here’s a quick demo showing it in action:

diagnostic-severity-override

BrighterScript

Fixed transpile bug with optional chaining

When transpiling optional chaining expressions, there was a bug where the final ?. in the chain would lose the ? when used in an assignment statement. As of brighterscript@0.62.0, the bsc compiler will now produce proper output. (PR #781). However, keep in mind that this is not valid syntax and the device will throw a runtime error if this syntax is used. To help with that, brighterscript will flag whenever optional chaining is used in assignments.

Before: image

After: image

Safer template string output

BrighterScript@0.63.0 fixed a bug in the template string transpiler where trailing function attached to the last chunk of the template string instead of the full transpiled string. That has been fixed by wrapping the entire template string output in parentheses. (#788)

Before fix:

image

After fix:

image

  • brighterscript: Wrap transpiled template strings in parens

Changes for BrighterScript plugin authors

  • fix crash when func has no block (#774)
  • move not-referenced check into ProgramValidator (#773)
  • simplify the ast range logic (#784)

Misc

roku-deploy now uses micromatch instead of picomatch

roku-deploy internally uses fast-glob for file discovery (which uses micromatch for glob logic), but for some reason was using picomatch for the path filtering logic.

roku-deploy#109 aligns on micromatch for path filtering logic, meaning that now all glob logic within roku-deploy is handled using the same library.

@rokucommunity/logger BigInt crash fix

Fixed a crash in @rokucommunity/logger (used by all our RokuCommunity projects) when trying to serialize bigint (@rokucommunity/logger#3)

Build status badges

All of our “build status” badges stopped working in December 2022 because shields.io change the URL format for the badge. This month we spent a little time to fix them all (1b31d04, 9df64c6, 248a853, fc087d8, cf63684, a9573f1 b3f0b0d )

We turned this: build status

back into this: build status

Contributing

Exclude node_modules when debugging roku-debug in Node.js

When debugging the typescript code in roku-debug, breakpoints should work a lot better now. There was a bug that was incorrectly resolving the sourcemaps in the wrong locations, which often meant that contributors had to fall back to using hardcoded debugger; statements in their typescript code. (a4a3de2)

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-deploy:

Contributions to logger:

Contributions to roku-debug:

Contributions to brighterscript-formatter:

Contributions to bslint:

Contributions to ropm:

Contributions to roku-report-analyzer:

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