Skip to content

Commit

Permalink
Update design
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx authored Nov 4, 2023
1 parent 9b681bb commit 35b7531
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions design.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# The Plan

1. Run `Preprocessor.process` from content-tag to convert gjs files with `<template>` tags into valid JS. The `<template>` tag gets converted into something like `[__GLIMMER_TEMPLATE('<h1> Hello </h1>', { strictMode: true })]`.
1. Run `Preprocessor.parse` from content-tag to get template locations. manually convert gjs files with `<template>` tags into valid JS, which doesn't change location. The `<template>` tag gets converted into empty strings.
2. convert empty string to a custom `Template` Ast node, which holds the template content.
1. Run the `estree` Prettier printer, which formats the valid JS above.
1. Grab template contents from `GLIMMER_TEMPLATE` AST node described above.
1. Grab template contents from `Template` AST node described above.
1. Run the hbs Prettier printer against the template contents.
1. Replace the `GLIMMER_TEMPLATE` AST node with the results from above, wrapped in `<template>`, like so:
1. Replace the `Template` AST node with the results from above, wrapped in `<template>`, like so:

```gts
<template>
Expand Down

0 comments on commit 35b7531

Please sign in to comment.