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

OS Architecture: Layouts / Templates / Sections #216

Closed
7 tasks
benjaminsehl opened this issue Nov 19, 2022 · 1 comment
Closed
7 tasks

OS Architecture: Layouts / Templates / Sections #216

benjaminsehl opened this issue Nov 19, 2022 · 1 comment
Assignees
Labels

Comments

@benjaminsehl
Copy link
Member

benjaminsehl commented Nov 19, 2022

Description
@juanpprieto proposed an idea to support a similar structure to OS2.0 in Hydrogen, with layouts, templates, and sections.

Without breaking API compatibility of Remix, it may be worth considering if this is intuitive and helpful for developers — especially as we evaluate whether or not there's a future that may support a 1P content play with OSE.

image

  • .hydrogen/entry-x — hidden away, but still accessible to the user. We could scaffold on each build (users wouldn't be able to modify) or we could scaffold once and allow overwrites inline.
  • .hydrogen/routes — All magic routes and full-stack components would be scaffolded/copied on each build/dev from our npm package. User can disable certain features. User can copy paste them into src/template if they want to overwrite them. Any of these routes are merged with what's on the same path in /templates (/templates/x beats /.hydrogen/routes/x )
  • /templates/* behaves exactly like /routes/* can add remove change. it essentially extends /routes — e.g /.hydrogen/cart/x and /src/templates/cart/y both work.
  • /layouts/password — auto wraps /template/password (just added this to test parity with Dawn)
  • /layouts/storefront — auto wraps all other templates
  • /src/root is exposed (basically provides the exports to /.hydrogen/root. we could keep it hidden inside /.hydrogen/root by default and just show how it can be overwritten.

Requirements

  • 100% compatibility with Remix APIs
  • Support for the "Theme template" dropdown in the admin
  • There's a green path to support OSE

#216 (comment)

@juanpprieto
Copy link
Contributor

Routes printout

Screenshot 2022-11-14 at 7 59 36 AM

@benjaminsehl benjaminsehl closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants