feat: modernize email templates with Svelte 5 + Tailwind + Storybook#2258
Open
niemyjski wants to merge 3 commits into
Open
feat: modernize email templates with Svelte 5 + Tailwind + Storybook#2258niemyjski wants to merge 3 commits into
niemyjski wants to merge 3 commits into
Conversation
Replace the legacy Foundation for Emails (Gulp/Inky/Panini/SCSS) toolchain with Svelte 5 + @better-svelte-email + Tailwind CSS. - Migrate all 8 email templates to Svelte components - Add shared EmailLayout, ActionsFooter, SocialFooter components - New build system: Vite SSR + @better-svelte-email/server renderer - Output maintains identical visual appearance and Handlebars tokens - All 25 mailer tests pass with new template output - Remove old build tooling (Gulp, Babel, SCSS, Panini, Inky) The compiled HTML templates preserve Handlebars syntax for runtime rendering by HandlebarsDotNet in the .NET backend (unchanged). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Migrate 8 email templates from Foundation for Emails / Gulp / Inky / Panini / SCSS
to @better-svelte-email/server 2.1.1 + Tailwind CSS
- Security audit: Svelte upgraded 5.34.7 → 5.55.9 (patched 6 XSS SSR CVEs)
- Pixel-perfect visual parity: all 8 templates verified with before/after screenshots
- Centralized design tokens in src/theme.ts (named Tailwind colors: text-primary,
bg-dark, text-alert, etc.) — no more hardcoded hex in .svelte sources
- Fixed XSS: preheader was {@html preheader}, now plain {preheader} text binding
- Add Storybook 10 with stories for all 8 templates + sample data with fillTokens()
- Add ESLint (flat config), Prettier, svelte-check — 0 errors, 25/25 tests pass
- Add @types/node, vite/client types, skipLibCheck for clean type checking
- Fix build script: typed Component, parseInt radix, HTML comment stripping
- Fix JSON-LD '}\n}' → '}}' Handlebars parse collision in cleanHtml
- Remove compilerOptions.generate from vite.config.ts (Svelte 5 no longer supports it)
- Remove old Gulp/Babel/SCSS/Panini/Inky/Foundation toolchain entirely
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Rewrite fillTokens in sample-data.ts as a proper Handlebars evaluator
supporting if/else/each blocks, nested depth tracking, @index and
{{../parent}} scope resolution — fixes token concatenation bug where all
{{#if}} branches were showing simultaneously
- Fix cleanHtml() to replace newlines in text nodes with a space instead of
removing them (was causing 'fromwhich', 'yourapplication', etc.)
- Fix text typos in organization-notice.svelte: 'to to continue' → 'to continue',
'to to see' → 'to see', 'being counting' → 'counting'
- Add Storybook (port 6006) and EmailStorybook (port 6008) as AddJavaScriptApp
resources in Aspire AppHost for integrated development dashboard
- Change email Storybook port to 6008 to avoid conflict with Svelte app (6006)
- Rebuild all 8 generated HTML templates with whitespace fixes applied
- 25/25 mailer tests pass
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
✅ Rendering Bug Fixes — VerifiedLatest commit (b5cd6e6) fixes all rendering/formatting issues found in review: Fixed Issues
Screenshots (after fixes, with realistic sample data)Event Notice — single clean message, no branch concatenation, no extra HR before first field TestsLint/Type Check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Modernizes the 8 Exceptionless email templates from a decade-old Foundation for Emails / Gulp / Inky / Panini / SCSS toolchain to Svelte 5 +
@better-svelte-email+ Tailwind CSS, with zero visual regressions, Storybook for live preview, and a comprehensive security audit.What Changed
Architecture
@better-svelte-email/server+ Tailwind CSS (inlined)npm run buildinsrc/Exceptionless.EmailTemplatesrenders all 8 templates tosrc/Exceptionless.Core/Mail/Templates/*.htmlMailer.csandHandlebarsDotNetrendering pipeline untouchedSecurity Fixes
{@html preheader}→{preheader}text bindingSecurity audit result for
@better-svelte-email: SAFE TO ADOPT. Clean dependency tree (parse5, postcss, tailwindcss). SLSA provenance verified. Single-maintainer bus factor noted; versions pinned exactly.Code Quality (Staff Engineer Review Fixes)
@ts-nocheckfrom components — proper TypeScript throughoutimport type { Snippet } from 'svelte'src/theme.ts)parseIntcalls to include radix argument{@html}inSocialFooterinto single blockcompilerOptions.generatefrom vite.config.ts (dropped in Svelte 5)Critical Bug Fixed
cleanHtml's whitespace collapsing would turn JSON-LD}\n}→}}, which HandlebarsDotNet parsed as a Handlebars closing token. Fix: extract<script type="application/ld+json">blocks before whitespace collapse, restore with newlines after.New Tooling
npm run storybook)src/theme.ts: centralized design tokens (primary, dark, alert, muted colors)build,dev,check,lint,format,storybook,build-storybookVisual Parity
All 8 templates verified pixel-perfect via Mailpit + browser screenshots (before/after).
Storybook Screenshots
Password Reset
Email Verify | renders identically to password reset layout
Event Notice — shows error detail, user info, actions
Daily Summary — stats grid, project breakdown
Organization Added
Payment Failed
How to Run
Tests
All 25 mailer tests pass:
Breaking Changes
None. C#
Mailer.csand all Handlebars templates are fully backward-compatible. The compiled.htmloutput format is identical to the old toolchain.