shellscape / jsx-email

Build emails with a delightful DX
https://jsx.email
MIT License
961 stars 31 forks source link

fix(cli): use vite builtins for perf improvement in preview #28

Closed shellscape closed 11 months ago

shellscape commented 11 months ago

Component / Package Name:

This PR contains:

Are tests included?

Breaking Changes?

If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

This improves performance of load time for the preview tool in the CLI by using some vite builtins (which were discovered as the fix to preview issues outside of the repo in a prior PR). Also injects the source code of the target templates into the bundle before bundling, thus avoiding a costly fetch in client-side code.

Still need someone with a keen React eye to help improve rendering on these pages, since there are some obvious refreshes, but that can come later.