Open Bug 1881507 Opened 1 year ago Updated 1 year ago

Allow editing messages and other data in about:asrouter as YAML

Categories

(Firefox :: Messaging System, task, P3)

task

Tracking

()

ASSIGNED

People

(Reporter: aminomancer, Assigned: aminomancer)

References

(Blocks 3 open bugs)

Details

(Whiteboard: [omc])

Attachments

(1 file)

JSON is really frustrating to edit in about:asrouter due to its strictness about commas. Without linting and formatting, it's totally impractical to use about:asrouter for its intended purpose of editing messages. Instead, 90% of the time I edit the message in a code editor and copy and paste it into about:asrouter. I only edit in the page when I'm changing like a single tiny string or something. In all other cases I do this back and forth between vscode and about:asrouter. Which still isn't ideal, because even in vscode, JSON still doesn't support comments or multi-line strings, it's very unreadable, the quotations add a lot of extra crap on screen, etc. And of course switching between the browser and vscode is a big papercut.

All these problems would be resolved by using YAML instead, or at least adding a toggle so you can choose JSON or YAML. Now that we own about:asrouter, importing an extra module here would not have any impact on users. It's pretty stable, so we wouldn't be updating it any more often than our other vendored modules like React.

The same goes for our message/experiment schemas. Ironically, jsonschema schemas are way easier to read and write in YAML.

TOML might be worth considering, but I think we should stick to YAML just for the sake of getting this over with ASAP.

NI?emily to add to skylight

Flags: needinfo?(rfambro)
Flags: needinfo?(emcminn)

Thanks for the visibility here Shane. I have a follow up question. I was chatting earlier this week with Punam about incremental Skylight capabilities. An eventual hope is that we'd be able to provide the ability to create new messages...but a first and more reasonable step would be to provide the ability to edit an existing message (seems like this is actually a pretty popular use case).

Would there be any potential limitations on either side if we implemented YAML in ASRouter vs doing it in Skylight? Would it be faster to set this up in ASRouter?

Flags: needinfo?(rfambro) → needinfo?(dmosedale)

(In reply to Ray Fambro from comment #2)

Would there be any potential limitations on either side if we implemented YAML in ASRouter vs doing it in Skylight? Would it be faster to set this up in ASRouter?

I suspect it would be equal or faster to add YAML to Skylight, since it definitely won't require a vendoring step, whereas about:asrouter might. I think we should ideally support YAML anywhere messages can be written, so I would support adding it to Skylight too. If Skylight is eventually going to replace about:asrouter (e.g. if we add a JSActor that 'escalates' the page scripts to directly show messages), then I imagine some of the code can be reused too.

Agreed that raw JSON is a huge papercut, and there's a lot to like about doing better. In the past, I've thought about using JSON 5, but we already have experience in the team using yaml for this and other stuff, and JSON5 is easy to confuse with JSON (since they recommend transcoding JSON5 back to JSON for interchange, since that's what (eg) Node & the browsers support).

As far as where this makes sense to do, since we're heavily focussing our (limited) resources on the dashboard piece of Skylight right now, it might well make sense to carefully structure the code for reuse, but use it in ASRouter devtools first, since that's where the existing workflow is.

Flags: needinfo?(dmosedale)
Flags: needinfo?(emcminn)
Priority: -- → P3
Assignee: nobody → shughes
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: