You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To support a way for users to declare the schema easily. We take JSX as the interface. And canner-script is the pragma of JSX. If you're not familiar with how JSX transform to Javascript, please check out @babel/plugin-transform-react-jsx first since this page only explain the concepts of canner-script.
The Pragma
The default export function builder is the pragma of JSX. It finally returns a JSON.
Model
Basically, a type tag generates a model instance, and the method toJson is called immediately to return the JSON object of the tag.
Layout and Visitors
<Layout> is the tag which is used to rearrange the Layout of fields in Canner. It doesn't represent any data.
To separate the <Layout> information and data schema, we don't embed the layout information in the data schema. Instead, each <Layout> tag creates a Visitor that is used to change the component tree.