Replies: 5 comments 11 replies
-
The JSON model is a good first pass. We were hoping that eventually Diplomat can have a way to do this, but that's a much trickier project. |
Beta Was this translation helpful? Give feedback.
-
Hey @ashu26jha @ayushkoli772 @man-myth @yatigautam and anyone else interested in WASM: I realized that a few days ago we merged a PR that broke the WASM Demo build, which I just fixed in #4737. Also see #4738 for a potential fix if you are running Node 18 (note that in CI we use Node 16). |
Beta Was this translation helpful? Give feedback.
-
I think firstly we need to discuss about the annotation model / schema. For now let's currently not focus on how these annotations will be generated. The annotation schema can be broken down into two pieces:
We will add special tags ( Lets take FixedDecimal for example: #[demo(
title = "Decimal Format",
description = "Demonstrates formatting numbers with different grouping strategies"
)]
pub struct DecimalFormatDemo {
// Default Annotations
#[auto_update] // Changes to this will call update_formatter and re-render the output
#[demo(input(label = "Locale", type = "dropdown")]
locale: ICU4XLocale,
// Specific Annotations
#[demo(input(label = "Number"))]
number: f64
#[auto_update] // Changes to this will call update_formatter and re-render the output
#[demo(
input(label = "Grouping Strategy", type = "dropdown", options = "Default, OnDigit, Min2")
)]
grouping_strategy: ICU4XNumberGroupingStrategy,
#[demo(formatter(inputs = ["data_provider", "locale", "grouping_strategy"]))]
#[formater_function] // #[auto_update] should call these function in case those values are changed
formatter: Result<ICU4XNumberFormat>,
#[demo(output(type = "text"))]
formatted_value: Result<ICU4XFixedDecimal> | null,
} If this looks good enough, I think about how can we generate these and eventually have parsing algorithms in place |
Beta Was this translation helpful? Give feedback.
-
What I had in mind was basically a web interface to drive the whole ICU4X FFI. Every API would be generated with UI elements for controlling it, like dropdowns for enums, text boxes for strings, etc. I think one of the more interesting challenges would be figuring out how to pass opaques into functions and also how to set the receiver ( |
Beta Was this translation helpful? Give feedback.
-
This is going to be a long one:
I think we should start by building UI for basic (easier) components like When this project will be completed, the final JSON model would act as foundation stone for adding this feature in the Diplomat itself (using Here is the canva link, (I am on my way to learn Figma 🙂) |
Beta Was this translation helpful? Give feedback.
-
Originally suggested by @QnnOkabayashi, also present in GSoC Project Ideas.
There is an actual need to have the demo be auto generated, currently we only have 3 demos which is not a good coverage. Here is how I could think about it:
Also discuss with: @sffc @Manishearth @robertbastian
Beta Was this translation helpful? Give feedback.
All reactions