Skip to content

Conversation

@triwav
Copy link
Owner

@triwav triwav commented Jul 30, 2025

This PR serves as the first step in moving away from storeNodeReferences in favor of using Roku's app-ui API instead. For context the vscode extension PR that is the primary use of this work is here: rokucommunity/vscode-brightscript-language#661. It is still to be determined if storeNodeReferences will completely go away with 3.0. At the very least the plan is to remove all of the custom code to try and access ArrayGrid children

@triwav triwav marked this pull request as ready for review September 8, 2025 18:22

constructor(config?: ConfigOptions) {
this.device = new RokuDevice(config);
constructor(device: RokuDevice, config?: ConfigOptions) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a breaking change for anyone constructing an ECP instance. Is there any way to combine all of this into a single config instead? Maybe something like:

config?: ConfigOptions & { device: RokuDevice}

then lift it off of the options? Not a big deal that it's included in the config downstrea, is it? Or you could remove it before setting config

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I've updated the code to be backwards compatible let me know what you think. On OnDeviceComponent I have device as a separate arg so was thinking of following the same pattern

raspFileLines = raspFileLines.concat(this.raspFileSteps);
this.raspFileSteps = undefined;
fsExtra.writeFileSync(outputPath, raspFileLines.join('\n'));
utils.getFsExtra().writeFileSync(outputPath, raspFileLines.join('\n'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the point of this? Can we just import fsExtra directly? Even if needing to mock it, if you do import * as fsExtra then you can mock that from anywhere.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is due to us using it the vscode UI and svelte failing in that case

import { utils } from './utils';
import * as ODC from './types/OnDeviceComponent';
import type { AppUIResponse, AppUIResponseChild } from '.';
import { ecp } from '.';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can cause circular references in typescript imports, so best to avoid imports from .. Can you update the import to a specific file? (should do the same for the import above this as well).

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving as is based on our talk about this being a singleton only added in index

};
}

/** deprecated will be removed in 3.0 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These would be better served with actual jsdoc annotations.

/**
   * @deprecated will be removed in 3.0
   */

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@triwav triwav merged commit 62b6b2d into master Sep 9, 2025
1 check passed
@triwav triwav deleted the getAppUi_work branch September 9, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants