Skip to content

feat: add templating mode selector #1214

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

Merged
merged 13 commits into from
May 23, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
tweak
  • Loading branch information
Rich-Harris committed May 23, 2025
commit d765f6ce5f6fc5a4953760ae83a982b91cb0707f
13 changes: 7 additions & 6 deletions packages/repl/src/lib/Output/CompilerOptions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,22 @@
<label for={generate}><span class="string">"{generate}"</span></label>
{/each},
</div>

{#if is_fragments_available}
<div class="option">
<span class="key">fragments:</span>

{#each ['html', 'tree'] as const as templating_mode}
{#each ['html', 'tree'] as const as fragments}
<input
id={templating_mode}
id={fragments}
type="radio"
checked={(workspace.compiler_options.fragments ?? 'html') === templating_mode}
value={templating_mode}
checked={(workspace.compiler_options.fragments ?? 'html') === fragments}
value={fragments}
onchange={() => {
workspace.update_compiler_options({ fragments: templating_mode });
workspace.update_compiler_options({ fragments });
}}
/>
<label for={templating_mode}><span class="string">"{templating_mode}"</span></label>
<label for={fragments}><span class="string">"{fragments}"</span></label>
{/each},
</div>
{/if}
Expand Down