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 workbench.build experimental API #690

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Previewer/Internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import GObject from "gi://GObject";
import Adw from "gi://Adw";

import { once } from "../../troll/src/async.js";
import { build } from "../../troll/src/builder.js";

// eslint-disable-next-line no-restricted-globals
const { addSignalMethods } = imports.signals;
Expand Down Expand Up @@ -80,6 +81,10 @@ export default function Internal({
dropdown_preview_align.selected = 0;
preview(object);
},
build(params) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if we should do this instead

Suggested change
build(params) {
build(interface, params) {

and use it like so:

Suggested change
build(params) {
workbench.build(workbench.interface, params);

It's a bit repetitive, but it's closer to whatever "standard" API we will get.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, what would workbench.interface resolve to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An XML string

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, for the primary demo interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for the code in the UI panel

console.warn("workbench.build is experimental");
return build(panel_ui.xml, params);
},
};

let obj;
Expand Down