Skip to content

Conversation

@kennsippell
Copy link
Member

@kennsippell kennsippell commented Apr 29, 2025

Introduces typed view models #270

Example:

This adds ViewModels for anything which is rendered directly by a route.

This is an example view model in liquid/auth/index.ts:

export type AuthFormViewModel = {
  domains: AuthenticationInfo[];
  error?: string;
};

export type AuthViewModel = {
  logo: string;
} & AuthFormViewModel;

And the route looks like this:

    const viewModel: AuthFormViewModel = {
      domains: Config.getDomains(),
      error
    };
    return resp.view('src/liquid/auth/authentication_form.liquid', viewModel);
  • Renames html to liquid Rename all template extensions to .liquid #280
  • Consolidates include and render to use render for everything
  • Moves view and routes from /new and /edit to be under /multiplace/new and /multiplace/edit
  • Component which are rendered by routes and not by views are moved out of the components folder
  • Add documentation of expected information at the top of all components which don't have a viewmodel

@kennsippell
Copy link
Member Author

I didn't see #290 when I approached this work. I'll rebase this to be based off that work.

@kennsippell kennsippell changed the base branch from main to 280_templates May 1, 2025 06:40
Base automatically changed from 280_templates to main May 6, 2025 16:58
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