react-email 3.0.3 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cli/index.js +96 -100
- package/dist/cli/index.mjs +75 -64
- package/dist/index.d.mts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +96 -0
- package/dist/index.mjs +21 -0
- package/dist/package/index.d.mts +33 -0
- package/dist/package/index.d.ts +33 -0
- package/dist/package/index.js +62 -0
- package/dist/package/index.mjs +7 -0
- package/dist/preview/.next/BUILD_ID +1 -1
- package/dist/preview/.next/app-build-manifest.json +31 -31
- package/dist/preview/.next/app-path-routes-manifest.json +1 -1
- package/dist/preview/.next/build-manifest.json +16 -15
- package/dist/preview/.next/cache/.rscinfo +1 -0
- package/dist/preview/.next/cache/eslint/.cache_1vyas3k +1 -0
- package/dist/preview/.next/cache/webpack/client-production/0.pack +0 -0
- package/dist/preview/.next/cache/webpack/client-production/index.pack +0 -0
- package/dist/preview/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/dist/preview/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dist/preview/.next/cache/webpack/server-production/0.pack +0 -0
- package/dist/preview/.next/cache/webpack/server-production/index.pack +0 -0
- package/dist/preview/.next/diagnostics/build-diagnostics.json +6 -0
- package/dist/preview/.next/diagnostics/framework.json +1 -0
- package/dist/preview/.next/images-manifest.json +1 -1
- package/dist/preview/.next/next-minimal-server.js.nft.json +1 -1
- package/dist/preview/.next/next-server.js.nft.json +1 -1
- package/dist/preview/.next/prerender-manifest.json +1 -1
- package/dist/preview/.next/required-server-files.json +1 -1
- package/dist/preview/.next/routes-manifest.json +1 -1
- package/dist/preview/.next/server/app/_not-found/page.js +1 -1
- package/dist/preview/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/preview/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/preview/.next/server/app/favicon.ico/route.js +1 -12
- package/dist/preview/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/dist/preview/.next/server/app/page.js +1 -1
- package/dist/preview/.next/server/app/page.js.nft.json +1 -1
- package/dist/preview/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/preview/.next/server/app/preview/[...slug]/page.js +6 -6
- package/dist/preview/.next/server/app/preview/[...slug]/page.js.nft.json +1 -1
- package/dist/preview/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +1 -1
- package/dist/preview/.next/server/app-paths-manifest.json +1 -1
- package/dist/preview/.next/server/chunks/300.js +13 -0
- package/dist/preview/.next/server/chunks/420.js +1 -0
- package/dist/preview/.next/server/chunks/625.js +5 -0
- package/dist/preview/.next/server/chunks/631.js +6 -0
- package/dist/preview/.next/server/chunks/720.js +10 -0
- package/dist/preview/.next/server/functions-config-manifest.json +1 -1
- package/dist/preview/.next/server/middleware-build-manifest.js +1 -1
- package/dist/preview/.next/server/next-font-manifest.js +1 -1
- package/dist/preview/.next/server/next-font-manifest.json +1 -1
- package/dist/preview/.next/server/pages/500.html +1 -1
- package/dist/preview/.next/server/pages/_app.js +1 -1
- package/dist/preview/.next/server/pages/_app.js.nft.json +1 -1
- package/dist/preview/.next/server/pages/_document.js +1 -1
- package/dist/preview/.next/server/pages/_document.js.nft.json +1 -1
- package/dist/preview/.next/server/pages/_error.js +1 -1
- package/dist/preview/.next/server/pages/_error.js.nft.json +1 -1
- package/dist/preview/.next/server/server-reference-manifest.js +1 -1
- package/dist/preview/.next/server/server-reference-manifest.json +1 -1
- package/dist/preview/.next/server/webpack-runtime.js +1 -1
- package/dist/preview/.next/static/6K68y2QEZ1dLbv-Xhi30p/_buildManifest.js +1 -0
- package/dist/preview/.next/static/chunks/12-b9450aa0845e7574.js +1 -0
- package/dist/preview/.next/static/chunks/154-69b91a0c2fd801b8.js +1 -0
- package/dist/preview/.next/static/chunks/447-886131c35ca42b91.js +1 -0
- package/dist/preview/.next/static/chunks/5fec7a0a-5179023f3f5a9421.js +1 -0
- package/dist/preview/.next/static/chunks/797-46f6c20952f0a280.js +2 -0
- package/dist/preview/.next/static/chunks/860-38d96c8819ba6f19.js +1 -0
- package/dist/preview/.next/static/chunks/app/_not-found/page-96d3eac723be3ee2.js +1 -0
- package/dist/preview/.next/static/chunks/app/layout-e1b6f1534cbbe5bd.js +1 -0
- package/dist/preview/.next/static/chunks/app/page-2c3e297e38c526ef.js +1 -0
- package/dist/preview/.next/static/chunks/app/preview/[...slug]/page-2b4988ba6daf34e1.js +1 -0
- package/dist/preview/.next/static/chunks/framework-e7cae9cecd5c9ba2.js +1 -0
- package/dist/preview/.next/static/chunks/main-app-2c7f96205a73f128.js +1 -0
- package/dist/preview/.next/static/chunks/main-df761fde212f9cda.js +1 -0
- package/dist/preview/.next/static/chunks/pages/_app-203a61b355820ccf.js +1 -0
- package/dist/preview/.next/static/chunks/pages/_error-1764ca54938748c8.js +1 -0
- package/dist/preview/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/preview/.next/static/chunks/webpack-9255716c9496e606.js +1 -0
- package/dist/preview/.next/static/css/ec5d7e66bd3b6cb8.css +1 -0
- package/dist/preview/.next/trace +20 -52
- package/dist/preview/.next/types/app/layout.ts +11 -6
- package/dist/preview/.next/types/app/preview/[...slug]/page.ts +11 -6
- package/dist/preview/.next/types/cache-life.d.ts +141 -0
- package/next-env.d.ts +1 -1
- package/package.json +12 -12
- package/src/actions/get-email-path-from-slug.ts +3 -2
- package/src/actions/get-emails-directory-metadata.spec.ts +1 -0
- package/src/actions/get-emails-directory-metadata.ts +62 -59
- package/src/actions/render-email-by-path.tsx +16 -5
- package/src/app/preview/[...slug]/page.tsx +19 -9
- package/src/app/preview/[...slug]/preview.tsx +6 -7
- package/src/contexts/emails.tsx +2 -56
- package/src/hooks/use-email-rendering-result.ts +44 -0
- package/src/hooks/use-rendering-metadata.ts +5 -5
- package/src/package/body/dist/index.d.mts +6 -0
- package/src/package/body/dist/index.d.ts +6 -0
- package/src/package/body/dist/index.js +79 -0
- package/src/package/body/dist/index.mjs +45 -0
- package/src/package/button/dist/index.d.mts +6 -0
- package/src/package/button/dist/index.d.ts +6 -0
- package/src/package/button/dist/index.js +252 -0
- package/src/package/button/dist/index.mjs +218 -0
- package/src/package/code-block/dist/index.d.mts +4906 -0
- package/src/package/code-block/dist/index.d.ts +4906 -0
- package/src/package/code-block/dist/index.js +18205 -0
- package/src/package/code-block/dist/index.mjs +18133 -0
- package/src/package/code-inline/dist/index.d.mts +11 -0
- package/src/package/code-inline/dist/index.d.ts +11 -0
- package/src/package/code-inline/dist/index.js +106 -0
- package/src/package/code-inline/dist/index.mjs +72 -0
- package/src/package/column/dist/index.d.mts +6 -0
- package/src/package/column/dist/index.d.ts +6 -0
- package/src/package/column/dist/index.js +79 -0
- package/src/package/column/dist/index.mjs +45 -0
- package/src/package/components/dist/index.d.mts +20 -0
- package/src/package/components/dist/index.d.ts +20 -0
- package/src/package/components/dist/index.js +62 -0
- package/src/package/components/dist/index.mjs +21 -0
- package/src/package/container/dist/index.d.mts +6 -0
- package/src/package/container/dist/index.d.ts +6 -0
- package/src/package/container/dist/index.js +93 -0
- package/src/package/container/dist/index.mjs +59 -0
- package/src/package/font/dist/index.d.mts +25 -0
- package/src/package/font/dist/index.d.ts +25 -0
- package/src/package/font/dist/index.js +55 -0
- package/src/package/font/dist/index.mjs +28 -0
- package/src/package/head/dist/index.d.mts +6 -0
- package/src/package/head/dist/index.d.ts +6 -0
- package/src/package/head/dist/index.js +83 -0
- package/src/package/head/dist/index.mjs +49 -0
- package/src/package/heading/dist/index.d.mts +43 -0
- package/src/package/heading/dist/index.d.ts +43 -0
- package/src/package/heading/dist/index.js +113 -0
- package/src/package/heading/dist/index.mjs +79 -0
- package/src/package/hr/dist/index.d.mts +6 -0
- package/src/package/hr/dist/index.d.ts +6 -0
- package/src/package/hr/dist/index.js +89 -0
- package/src/package/hr/dist/index.mjs +55 -0
- package/src/package/html/dist/index.d.mts +6 -0
- package/src/package/html/dist/index.d.ts +6 -0
- package/src/package/html/dist/index.js +79 -0
- package/src/package/html/dist/index.mjs +45 -0
- package/src/package/img/dist/index.d.mts +6 -0
- package/src/package/img/dist/index.d.ts +6 -0
- package/src/package/img/dist/index.js +94 -0
- package/src/package/img/dist/index.mjs +60 -0
- package/src/package/link/dist/index.d.mts +6 -0
- package/src/package/link/dist/index.d.ts +6 -0
- package/src/package/link/dist/index.js +90 -0
- package/src/package/link/dist/index.mjs +56 -0
- package/src/package/markdown/dist/index.d.mts +15 -0
- package/src/package/markdown/dist/index.d.ts +15 -0
- package/src/package/markdown/dist/index.js +92 -0
- package/src/package/markdown/dist/index.mjs +58 -0
- package/src/package/preview/dist/index.d.mts +12 -0
- package/src/package/preview/dist/index.d.ts +12 -0
- package/src/package/preview/dist/index.js +108 -0
- package/src/package/preview/dist/index.mjs +73 -0
- package/src/package/render/dist/browser/index.d.mts +24 -0
- package/src/package/render/dist/browser/index.d.ts +24 -0
- package/src/package/render/dist/browser/index.js +250 -0
- package/src/package/render/dist/browser/index.mjs +214 -0
- package/src/package/render/dist/index.d.mts +23 -0
- package/src/package/render/dist/index.d.ts +23 -0
- package/src/package/render/dist/index.js +768 -0
- package/src/package/render/dist/index.mjs +733 -0
- package/src/package/render/dist/node/index.d.mts +27 -0
- package/src/package/render/dist/node/index.d.ts +27 -0
- package/src/package/render/dist/node/index.js +212 -0
- package/src/package/render/dist/node/index.mjs +176 -0
- package/src/package/row/dist/index.d.mts +10 -0
- package/src/package/row/dist/index.d.ts +10 -0
- package/src/package/row/dist/index.js +93 -0
- package/src/package/row/dist/index.mjs +59 -0
- package/src/package/section/dist/index.d.mts +6 -0
- package/src/package/section/dist/index.d.ts +6 -0
- package/src/package/section/dist/index.js +93 -0
- package/src/package/section/dist/index.mjs +59 -0
- package/src/package/tailwind/dist/index.d.ts +19 -0
- package/src/package/tailwind/dist/index.js +48 -0
- package/src/package/tailwind/dist/index.mjs +17167 -0
- package/src/package/tailwind/dist/tailwindcss/config.d.ts +376 -0
- package/src/package/tailwind/dist/tailwindcss/generated/.gitkeep +0 -0
- package/src/package/tailwind/dist/tailwindcss/generated/colors.d.ts +298 -0
- package/src/package/tailwind/dist/tailwindcss/generated/corePluginList.d.ts +1 -0
- package/src/package/tailwind/dist/tailwindcss/generated/default-theme.d.ts +397 -0
- package/src/package/tailwind/dist/tailwindcss/index.d.ts +11 -0
- package/src/package/text/dist/index.d.mts +6 -0
- package/src/package/text/dist/index.d.ts +6 -0
- package/src/package/text/dist/index.js +89 -0
- package/src/package/text/dist/index.mjs +55 -0
- package/src/utils/types/hot-reload-event.ts +3 -6
- package/dist/preview/.next/cache/eslint/.cache_117y9un +0 -1
- package/dist/preview/.next/server/chunks/128.js +0 -7
- package/dist/preview/.next/server/chunks/176.js +0 -2
- package/dist/preview/.next/server/chunks/287.js +0 -4
- package/dist/preview/.next/server/chunks/303.js +0 -6
- package/dist/preview/.next/server/chunks/359.js +0 -10
- package/dist/preview/.next/server/chunks/6.js +0 -1
- package/dist/preview/.next/server/chunks/894.js +0 -4
- package/dist/preview/.next/server/chunks/font-manifest.json +0 -1
- package/dist/preview/.next/server/font-manifest.json +0 -1
- package/dist/preview/.next/static/9wK7iUJPUvFYJNYOqHNpo/_buildManifest.js +0 -1
- package/dist/preview/.next/static/chunks/121-c9990f9db62882f2.js +0 -2
- package/dist/preview/.next/static/chunks/262-1ec6780d76508af8.js +0 -1
- package/dist/preview/.next/static/chunks/599-b4e686757f7b900d.js +0 -1
- package/dist/preview/.next/static/chunks/732-2b6186d8c8624033.js +0 -1
- package/dist/preview/.next/static/chunks/783-41562adc25d0c844.js +0 -9
- package/dist/preview/.next/static/chunks/app/_not-found/page-02dfc5a8a0bd636e.js +0 -1
- package/dist/preview/.next/static/chunks/app/layout-62d01ca567f6fd12.js +0 -1
- package/dist/preview/.next/static/chunks/app/page-630c6c846e3efc69.js +0 -1
- package/dist/preview/.next/static/chunks/app/preview/[...slug]/page-6547e9f3ba86c271.js +0 -1
- package/dist/preview/.next/static/chunks/f38cb6f6-40e76da092bb0490.js +0 -1
- package/dist/preview/.next/static/chunks/framework-bef83a85c94ff7de.js +0 -1
- package/dist/preview/.next/static/chunks/main-app-6ed588927d8fd56c.js +0 -1
- package/dist/preview/.next/static/chunks/main-ee2ceeb6c8bf53ac.js +0 -1
- package/dist/preview/.next/static/chunks/pages/_app-02aac361ebb5625a.js +0 -1
- package/dist/preview/.next/static/chunks/pages/_error-52f603c388364756.js +0 -1
- package/dist/preview/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js +0 -1
- package/dist/preview/.next/static/chunks/webpack-cf1ab84f284a4073.js +0 -1
- package/dist/preview/.next/static/css/0a13d10225a26b9d.css +0 -1
- /package/dist/preview/.next/static/{9wK7iUJPUvFYJNYOqHNpo → 6K68y2QEZ1dLbv-Xhi30p}/_ssgManifest.js +0 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
// File: /home/gabriel/Projects/
|
|
1
|
+
// File: /home/gabriel/Projects/resend/react-email/packages/react-email/src/app/layout.tsx
|
|
2
2
|
import * as entry from '../../../src/app/layout.js'
|
|
3
3
|
import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
|
|
4
4
|
|
|
5
5
|
type TEntry = typeof import('../../../src/app/layout.js')
|
|
6
6
|
|
|
7
|
+
type SegmentParams<T extends Object = any> = T extends Record<string, any>
|
|
8
|
+
? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
|
|
9
|
+
: T
|
|
10
|
+
|
|
7
11
|
// Check that the entry is a valid entry
|
|
8
12
|
checkFields<Diff<{
|
|
9
13
|
default: Function
|
|
@@ -21,9 +25,11 @@ checkFields<Diff<{
|
|
|
21
25
|
generateMetadata?: Function
|
|
22
26
|
viewport?: any
|
|
23
27
|
generateViewport?: Function
|
|
28
|
+
experimental_ppr?: boolean
|
|
24
29
|
|
|
25
30
|
}, TEntry, ''>>()
|
|
26
31
|
|
|
32
|
+
|
|
27
33
|
// Check the prop type of the entry function
|
|
28
34
|
checkFields<Diff<LayoutProps, FirstArg<TEntry['default']>, 'default'>>()
|
|
29
35
|
|
|
@@ -41,19 +47,18 @@ if ('generateViewport' in entry) {
|
|
|
41
47
|
|
|
42
48
|
// Check the arguments and return type of the generateStaticParams function
|
|
43
49
|
if ('generateStaticParams' in entry) {
|
|
44
|
-
checkFields<Diff<{ params:
|
|
50
|
+
checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
|
|
45
51
|
checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
|
|
46
52
|
}
|
|
47
53
|
|
|
48
|
-
type PageParams = any
|
|
49
54
|
export interface PageProps {
|
|
50
|
-
params?:
|
|
51
|
-
searchParams?: any
|
|
55
|
+
params?: Promise<SegmentParams>
|
|
56
|
+
searchParams?: Promise<any>
|
|
52
57
|
}
|
|
53
58
|
export interface LayoutProps {
|
|
54
59
|
children?: React.ReactNode
|
|
55
60
|
|
|
56
|
-
params?:
|
|
61
|
+
params?: Promise<SegmentParams>
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
// =============
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
// File: /home/gabriel/Projects/
|
|
1
|
+
// File: /home/gabriel/Projects/resend/react-email/packages/react-email/src/app/preview/[...slug]/page.tsx
|
|
2
2
|
import * as entry from '../../../../../src/app/preview/[...slug]/page.js'
|
|
3
3
|
import type { ResolvingMetadata, ResolvingViewport } from 'next/dist/lib/metadata/types/metadata-interface.js'
|
|
4
4
|
|
|
5
5
|
type TEntry = typeof import('../../../../../src/app/preview/[...slug]/page.js')
|
|
6
6
|
|
|
7
|
+
type SegmentParams<T extends Object = any> = T extends Record<string, any>
|
|
8
|
+
? { [K in keyof T]: T[K] extends string ? string | string[] | undefined : never }
|
|
9
|
+
: T
|
|
10
|
+
|
|
7
11
|
// Check that the entry is a valid entry
|
|
8
12
|
checkFields<Diff<{
|
|
9
13
|
default: Function
|
|
@@ -21,9 +25,11 @@ checkFields<Diff<{
|
|
|
21
25
|
generateMetadata?: Function
|
|
22
26
|
viewport?: any
|
|
23
27
|
generateViewport?: Function
|
|
28
|
+
experimental_ppr?: boolean
|
|
24
29
|
|
|
25
30
|
}, TEntry, ''>>()
|
|
26
31
|
|
|
32
|
+
|
|
27
33
|
// Check the prop type of the entry function
|
|
28
34
|
checkFields<Diff<PageProps, FirstArg<TEntry['default']>, 'default'>>()
|
|
29
35
|
|
|
@@ -41,19 +47,18 @@ if ('generateViewport' in entry) {
|
|
|
41
47
|
|
|
42
48
|
// Check the arguments and return type of the generateStaticParams function
|
|
43
49
|
if ('generateStaticParams' in entry) {
|
|
44
|
-
checkFields<Diff<{ params:
|
|
50
|
+
checkFields<Diff<{ params: SegmentParams }, FirstArg<MaybeField<TEntry, 'generateStaticParams'>>, 'generateStaticParams'>>()
|
|
45
51
|
checkFields<Diff<{ __tag__: 'generateStaticParams', __return_type__: any[] | Promise<any[]> }, { __tag__: 'generateStaticParams', __return_type__: ReturnType<MaybeField<TEntry, 'generateStaticParams'>> }>>()
|
|
46
52
|
}
|
|
47
53
|
|
|
48
|
-
type PageParams = any
|
|
49
54
|
export interface PageProps {
|
|
50
|
-
params?:
|
|
51
|
-
searchParams?: any
|
|
55
|
+
params?: Promise<SegmentParams>
|
|
56
|
+
searchParams?: Promise<any>
|
|
52
57
|
}
|
|
53
58
|
export interface LayoutProps {
|
|
54
59
|
children?: React.ReactNode
|
|
55
60
|
|
|
56
|
-
params?:
|
|
61
|
+
params?: Promise<SegmentParams>
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
// =============
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// Type definitions for Next.js cacheLife configs
|
|
2
|
+
|
|
3
|
+
declare module 'next/cache' {
|
|
4
|
+
export { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache'
|
|
5
|
+
export {
|
|
6
|
+
revalidateTag,
|
|
7
|
+
revalidatePath,
|
|
8
|
+
unstable_expireTag,
|
|
9
|
+
unstable_expirePath,
|
|
10
|
+
} from 'next/dist/server/web/spec-extension/revalidate'
|
|
11
|
+
export { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store'
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Cache this `"use cache"` for a timespan defined by the `"default"` profile.
|
|
16
|
+
* ```
|
|
17
|
+
* stale: 300 seconds (5 minutes)
|
|
18
|
+
* revalidate: 900 seconds (15 minutes)
|
|
19
|
+
* expire: never
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* This cache may be stale on clients for 5 minutes before checking with the server.
|
|
23
|
+
* If the server receives a new request after 15 minutes, start revalidating new values in the background.
|
|
24
|
+
* It lives for the maximum age of the server cache. If this entry has no traffic for a while, it may serve an old value the next request.
|
|
25
|
+
*/
|
|
26
|
+
export function unstable_cacheLife(profile: "default"): void
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Cache this `"use cache"` for a timespan defined by the `"seconds"` profile.
|
|
30
|
+
* ```
|
|
31
|
+
* stale: 0 seconds
|
|
32
|
+
* revalidate: 1 seconds
|
|
33
|
+
* expire: 60 seconds (1 minute)
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* This cache may be stale on clients for 0 seconds before checking with the server.
|
|
37
|
+
* If the server receives a new request after 1 seconds, start revalidating new values in the background.
|
|
38
|
+
* If this entry has no traffic for 1 minute it will expire. The next request will recompute it.
|
|
39
|
+
*/
|
|
40
|
+
export function unstable_cacheLife(profile: "seconds"): void
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Cache this `"use cache"` for a timespan defined by the `"minutes"` profile.
|
|
44
|
+
* ```
|
|
45
|
+
* stale: 300 seconds (5 minutes)
|
|
46
|
+
* revalidate: 60 seconds (1 minute)
|
|
47
|
+
* expire: 3600 seconds (1 hour)
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* This cache may be stale on clients for 5 minutes before checking with the server.
|
|
51
|
+
* If the server receives a new request after 1 minute, start revalidating new values in the background.
|
|
52
|
+
* If this entry has no traffic for 1 hour it will expire. The next request will recompute it.
|
|
53
|
+
*/
|
|
54
|
+
export function unstable_cacheLife(profile: "minutes"): void
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Cache this `"use cache"` for a timespan defined by the `"hours"` profile.
|
|
58
|
+
* ```
|
|
59
|
+
* stale: 300 seconds (5 minutes)
|
|
60
|
+
* revalidate: 3600 seconds (1 hour)
|
|
61
|
+
* expire: 86400 seconds (1 day)
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* This cache may be stale on clients for 5 minutes before checking with the server.
|
|
65
|
+
* If the server receives a new request after 1 hour, start revalidating new values in the background.
|
|
66
|
+
* If this entry has no traffic for 1 day it will expire. The next request will recompute it.
|
|
67
|
+
*/
|
|
68
|
+
export function unstable_cacheLife(profile: "hours"): void
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Cache this `"use cache"` for a timespan defined by the `"days"` profile.
|
|
72
|
+
* ```
|
|
73
|
+
* stale: 300 seconds (5 minutes)
|
|
74
|
+
* revalidate: 86400 seconds (1 day)
|
|
75
|
+
* expire: 604800 seconds (1 week)
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* This cache may be stale on clients for 5 minutes before checking with the server.
|
|
79
|
+
* If the server receives a new request after 1 day, start revalidating new values in the background.
|
|
80
|
+
* If this entry has no traffic for 1 week it will expire. The next request will recompute it.
|
|
81
|
+
*/
|
|
82
|
+
export function unstable_cacheLife(profile: "days"): void
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Cache this `"use cache"` for a timespan defined by the `"weeks"` profile.
|
|
86
|
+
* ```
|
|
87
|
+
* stale: 300 seconds (5 minutes)
|
|
88
|
+
* revalidate: 604800 seconds (1 week)
|
|
89
|
+
* expire: 2592000 seconds (30 days)
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* This cache may be stale on clients for 5 minutes before checking with the server.
|
|
93
|
+
* If the server receives a new request after 1 week, start revalidating new values in the background.
|
|
94
|
+
* If this entry has no traffic for 30 days it will expire. The next request will recompute it.
|
|
95
|
+
*/
|
|
96
|
+
export function unstable_cacheLife(profile: "weeks"): void
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Cache this `"use cache"` for a timespan defined by the `"max"` profile.
|
|
100
|
+
* ```
|
|
101
|
+
* stale: 300 seconds (5 minutes)
|
|
102
|
+
* revalidate: 2592000 seconds (30 days)
|
|
103
|
+
* expire: never
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* This cache may be stale on clients for 5 minutes before checking with the server.
|
|
107
|
+
* If the server receives a new request after 30 days, start revalidating new values in the background.
|
|
108
|
+
* It lives for the maximum age of the server cache. If this entry has no traffic for a while, it may serve an old value the next request.
|
|
109
|
+
*/
|
|
110
|
+
export function unstable_cacheLife(profile: "max"): void
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Cache this `"use cache"` using a custom timespan.
|
|
114
|
+
* ```
|
|
115
|
+
* stale: ... // seconds
|
|
116
|
+
* revalidate: ... // seconds
|
|
117
|
+
* expire: ... // seconds
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* This is similar to Cache-Control: max-age=`stale`,s-max-age=`revalidate`,stale-while-revalidate=`expire-revalidate`
|
|
121
|
+
*
|
|
122
|
+
* If a value is left out, the lowest of other cacheLife() calls or the default, is used instead.
|
|
123
|
+
*/
|
|
124
|
+
export function unstable_cacheLife(profile: {
|
|
125
|
+
/**
|
|
126
|
+
* This cache may be stale on clients for ... seconds before checking with the server.
|
|
127
|
+
*/
|
|
128
|
+
stale?: number,
|
|
129
|
+
/**
|
|
130
|
+
* If the server receives a new request after ... seconds, start revalidating new values in the background.
|
|
131
|
+
*/
|
|
132
|
+
revalidate?: number,
|
|
133
|
+
/**
|
|
134
|
+
* If this entry has no traffic for ... seconds it will expire. The next request will recompute it.
|
|
135
|
+
*/
|
|
136
|
+
expire?: number
|
|
137
|
+
}): void
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
export { cacheTag as unstable_cacheTag } from 'next/dist/server/use-cache/cache-tag'
|
|
141
|
+
}
|
package/next-env.d.ts
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
3
|
|
|
4
4
|
// NOTE: This file should not be edited
|
|
5
|
-
// see https://nextjs.org/docs/app/
|
|
5
|
+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-email",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "A live preview of your emails right in your browser.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"email": "./dist/cli/index.js"
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"@babel/core": "7.24.5",
|
|
23
23
|
"@babel/parser": "7.24.5",
|
|
24
24
|
"chalk": "4.1.2",
|
|
25
|
-
"chokidar": "
|
|
25
|
+
"chokidar": "4.0.3",
|
|
26
26
|
"commander": "11.1.0",
|
|
27
27
|
"debounce": "2.0.0",
|
|
28
28
|
"esbuild": "0.19.11",
|
|
29
29
|
"glob": "10.3.4",
|
|
30
30
|
"log-symbols": "4.1.0",
|
|
31
31
|
"mime-types": "2.1.35",
|
|
32
|
-
"next": "
|
|
32
|
+
"next": "15.1.2",
|
|
33
33
|
"normalize-path": "3.0.0",
|
|
34
34
|
"ora": "5.4.1",
|
|
35
35
|
"socket.io": "4.8.0"
|
|
@@ -45,25 +45,25 @@
|
|
|
45
45
|
"@types/babel__core": "7.20.5",
|
|
46
46
|
"@types/fs-extra": "11.0.1",
|
|
47
47
|
"@types/mime-types": "2.1.4",
|
|
48
|
-
"@types/node": "
|
|
48
|
+
"@types/node": "22.10.2",
|
|
49
49
|
"@types/normalize-path": "3.0.2",
|
|
50
|
-
"@types/react": "^
|
|
51
|
-
"@types/react-dom": "^
|
|
50
|
+
"@types/react": "^19",
|
|
51
|
+
"@types/react-dom": "^19",
|
|
52
52
|
"@types/webpack": "5.28.5",
|
|
53
53
|
"@vercel/style-guide": "5.1.0",
|
|
54
|
-
"autoprefixer": "10.4.
|
|
54
|
+
"autoprefixer": "10.4.20",
|
|
55
55
|
"clsx": "2.1.0",
|
|
56
56
|
"eslint": "8.50.0",
|
|
57
57
|
"eslint-config-prettier": "9.0.0",
|
|
58
58
|
"eslint-config-turbo": "2.1.0",
|
|
59
|
-
"framer-motion": "12.0.0-alpha.
|
|
59
|
+
"framer-motion": "12.0.0-alpha.2",
|
|
60
60
|
"postcss": "8.4.40",
|
|
61
61
|
"prism-react-renderer": "2.1.0",
|
|
62
|
-
"react": "
|
|
63
|
-
"react-dom": "
|
|
62
|
+
"react": "^19",
|
|
63
|
+
"react-dom": "^19",
|
|
64
64
|
"sharp": "0.33.3",
|
|
65
65
|
"socket.io-client": "4.8.0",
|
|
66
|
-
"sonner": "1.
|
|
66
|
+
"sonner": "1.7.1",
|
|
67
67
|
"source-map-js": "1.0.2",
|
|
68
68
|
"stacktrace-parser": "0.1.10",
|
|
69
69
|
"tailwind-merge": "2.2.0",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"tsx": "4.9.0",
|
|
73
73
|
"typescript": "5.1.6",
|
|
74
74
|
"vitest": "1.1.3",
|
|
75
|
-
"@react-email/render": "1.0.
|
|
75
|
+
"@react-email/render": "1.0.4"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|
|
78
78
|
"build": "tsup-node && node build-preview-server.mjs",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
|
+
import { cache } from 'react';
|
|
4
5
|
import { emailsDirectoryAbsolutePath } from '../utils/emails-directory-absolute-path';
|
|
5
6
|
|
|
6
7
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
7
|
-
export const getEmailPathFromSlug = async (slug: string) => {
|
|
8
|
+
export const getEmailPathFromSlug = cache(async (slug: string) => {
|
|
8
9
|
if (['.tsx', '.jsx', '.ts', '.js'].includes(path.extname(slug)))
|
|
9
10
|
return path.join(emailsDirectoryAbsolutePath, slug);
|
|
10
11
|
|
|
@@ -25,4 +26,4 @@ export const getEmailPathFromSlug = async (slug: string) => {
|
|
|
25
26
|
|
|
26
27
|
This is most likely not an issue with the preview server. It most likely is that the email doesn't exist.`,
|
|
27
28
|
);
|
|
28
|
-
};
|
|
29
|
+
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import path from 'node:path';
|
|
5
|
+
import { cache } from 'react';
|
|
5
6
|
|
|
6
7
|
const isFileAnEmail = (fullPath: string): boolean => {
|
|
7
8
|
const stat = fs.statSync(fullPath);
|
|
@@ -57,64 +58,66 @@ const mergeDirectoriesWithSubDirectories = (
|
|
|
57
58
|
return currentResultingMergedDirectory;
|
|
58
59
|
};
|
|
59
60
|
|
|
60
|
-
export const getEmailsDirectoryMetadata =
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const dirents = await fs.promises.readdir(absolutePathToEmailsDirectory, {
|
|
70
|
-
withFileTypes: true,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
const emailFilenames = dirents
|
|
74
|
-
.filter((dirent) =>
|
|
75
|
-
isFileAnEmail(path.join(absolutePathToEmailsDirectory, dirent.name)),
|
|
76
|
-
)
|
|
77
|
-
.map((dirent) =>
|
|
78
|
-
keepFileExtensions
|
|
79
|
-
? dirent.name
|
|
80
|
-
: dirent.name.replace(path.extname(dirent.name), ''),
|
|
81
|
-
);
|
|
61
|
+
export const getEmailsDirectoryMetadata = cache(
|
|
62
|
+
async (
|
|
63
|
+
absolutePathToEmailsDirectory: string,
|
|
64
|
+
keepFileExtensions = false,
|
|
65
|
+
isSubDirectory = false,
|
|
66
|
+
|
|
67
|
+
baseDirectoryPath = absolutePathToEmailsDirectory,
|
|
68
|
+
): Promise<EmailsDirectory | undefined> => {
|
|
69
|
+
if (!fs.existsSync(absolutePathToEmailsDirectory)) return;
|
|
82
70
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
71
|
+
const dirents = await fs.promises.readdir(absolutePathToEmailsDirectory, {
|
|
72
|
+
withFileTypes: true,
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const emailFilenames = dirents
|
|
76
|
+
.filter((dirent) =>
|
|
77
|
+
isFileAnEmail(path.join(absolutePathToEmailsDirectory, dirent.name)),
|
|
90
78
|
)
|
|
91
|
-
.map((dirent) =>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
dirent.name,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
79
|
+
.map((dirent) =>
|
|
80
|
+
keepFileExtensions
|
|
81
|
+
? dirent.name
|
|
82
|
+
: dirent.name.replace(path.extname(dirent.name), ''),
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
const subDirectories = await Promise.all(
|
|
86
|
+
dirents
|
|
87
|
+
.filter(
|
|
88
|
+
(dirent) =>
|
|
89
|
+
dirent.isDirectory() &&
|
|
90
|
+
!dirent.name.startsWith('_') &&
|
|
91
|
+
dirent.name !== 'static',
|
|
92
|
+
)
|
|
93
|
+
.map((dirent) => {
|
|
94
|
+
const direntAbsolutePath = path.join(
|
|
95
|
+
absolutePathToEmailsDirectory,
|
|
96
|
+
dirent.name,
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
return getEmailsDirectoryMetadata(
|
|
100
|
+
direntAbsolutePath,
|
|
101
|
+
keepFileExtensions,
|
|
102
|
+
true,
|
|
103
|
+
baseDirectoryPath,
|
|
104
|
+
) as Promise<EmailsDirectory>;
|
|
105
|
+
}),
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const emailsMetadata = {
|
|
109
|
+
absolutePath: absolutePathToEmailsDirectory,
|
|
110
|
+
relativePath: path.relative(
|
|
111
|
+
baseDirectoryPath,
|
|
112
|
+
absolutePathToEmailsDirectory,
|
|
113
|
+
),
|
|
114
|
+
directoryName: absolutePathToEmailsDirectory.split(path.sep).pop()!,
|
|
115
|
+
emailFilenames,
|
|
116
|
+
subDirectories,
|
|
117
|
+
} satisfies EmailsDirectory;
|
|
118
|
+
|
|
119
|
+
return isSubDirectory
|
|
120
|
+
? mergeDirectoriesWithSubDirectories(emailsMetadata)
|
|
121
|
+
: emailsMetadata;
|
|
122
|
+
},
|
|
123
|
+
);
|
|
@@ -21,9 +21,16 @@ export type EmailRenderingResult =
|
|
|
21
21
|
error: ErrorObject;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
const cache = new Map<string, EmailRenderingResult>();
|
|
25
|
+
|
|
24
26
|
export const renderEmailByPath = async (
|
|
25
27
|
emailPath: string,
|
|
28
|
+
invalidatingCache = false,
|
|
26
29
|
): Promise<EmailRenderingResult> => {
|
|
30
|
+
if (invalidatingCache) cache.delete(emailPath);
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
32
|
+
if (cache.has(emailPath)) return cache.get(emailPath)!;
|
|
33
|
+
|
|
27
34
|
const timeBeforeEmailRendered = performance.now();
|
|
28
35
|
|
|
29
36
|
const emailFilename = path.basename(emailPath);
|
|
@@ -36,14 +43,14 @@ export const renderEmailByPath = async (
|
|
|
36
43
|
registerSpinnerAutostopping(spinner);
|
|
37
44
|
}
|
|
38
45
|
|
|
39
|
-
const
|
|
46
|
+
const componentResult = await getEmailComponent(emailPath);
|
|
40
47
|
|
|
41
|
-
if ('error' in
|
|
48
|
+
if ('error' in componentResult) {
|
|
42
49
|
spinner?.stopAndPersist({
|
|
43
50
|
symbol: logSymbols.error,
|
|
44
51
|
text: `Failed while rendering ${emailFilename}`,
|
|
45
52
|
});
|
|
46
|
-
return { error:
|
|
53
|
+
return { error: componentResult.error };
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
const {
|
|
@@ -51,7 +58,7 @@ export const renderEmailByPath = async (
|
|
|
51
58
|
createElement,
|
|
52
59
|
render,
|
|
53
60
|
sourceMapToOriginalFile,
|
|
54
|
-
} =
|
|
61
|
+
} = componentResult;
|
|
55
62
|
|
|
56
63
|
const previewProps = Email.PreviewProps || {};
|
|
57
64
|
const EmailComponent = Email as React.FC;
|
|
@@ -82,7 +89,7 @@ export const renderEmailByPath = async (
|
|
|
82
89
|
text: `Successfully rendered ${emailFilename} in ${timeForConsole}`,
|
|
83
90
|
});
|
|
84
91
|
|
|
85
|
-
|
|
92
|
+
const renderingResult = {
|
|
86
93
|
// This ensures that no null byte character ends up in the rendered
|
|
87
94
|
// markup making users suspect of any issues. These null byte characters
|
|
88
95
|
// only seem to happen with React 18, as it has no similar incident with React 19.
|
|
@@ -90,6 +97,10 @@ export const renderEmailByPath = async (
|
|
|
90
97
|
plainText,
|
|
91
98
|
reactMarkup,
|
|
92
99
|
};
|
|
100
|
+
|
|
101
|
+
cache.set(emailPath, renderingResult);
|
|
102
|
+
|
|
103
|
+
return renderingResult;
|
|
93
104
|
} catch (exception) {
|
|
94
105
|
const error = exception as Error;
|
|
95
106
|
|
|
@@ -16,7 +16,12 @@ export interface PreviewParams {
|
|
|
16
16
|
slug: string[];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
const Page = async ({
|
|
19
|
+
const Page = async ({
|
|
20
|
+
params: paramsPromise,
|
|
21
|
+
}: {
|
|
22
|
+
params: Promise<PreviewParams>;
|
|
23
|
+
}) => {
|
|
24
|
+
const params = await paramsPromise;
|
|
20
25
|
// will come in here as segments of a relative path to the email
|
|
21
26
|
// ex: ['authentication', 'verify-password.tsx']
|
|
22
27
|
const slug = decodeURIComponent(params.slug.join('/'));
|
|
@@ -43,14 +48,14 @@ This is most likely not an issue with the preview server. Maybe there was a typo
|
|
|
43
48
|
throw exception;
|
|
44
49
|
}
|
|
45
50
|
|
|
46
|
-
const
|
|
51
|
+
const serverEmailRenderingResult = await renderEmailByPath(emailPath);
|
|
47
52
|
|
|
48
53
|
if (
|
|
49
|
-
'
|
|
50
|
-
|
|
54
|
+
process.env.NEXT_PUBLIC_IS_BUILDING === 'true' &&
|
|
55
|
+
'error' in serverEmailRenderingResult
|
|
51
56
|
) {
|
|
52
|
-
throw new Error(
|
|
53
|
-
cause:
|
|
57
|
+
throw new Error(serverEmailRenderingResult.error.message, {
|
|
58
|
+
cause: serverEmailRenderingResult.error,
|
|
54
59
|
});
|
|
55
60
|
}
|
|
56
61
|
|
|
@@ -62,15 +67,20 @@ This is most likely not an issue with the preview server. Maybe there was a typo
|
|
|
62
67
|
<Preview
|
|
63
68
|
emailPath={emailPath}
|
|
64
69
|
pathSeparator={path.sep}
|
|
65
|
-
|
|
70
|
+
serverRenderingResult={serverEmailRenderingResult}
|
|
66
71
|
slug={slug}
|
|
67
72
|
/>
|
|
68
73
|
</Suspense>
|
|
69
74
|
);
|
|
70
75
|
};
|
|
71
76
|
|
|
72
|
-
export function generateMetadata({
|
|
73
|
-
|
|
77
|
+
export async function generateMetadata({
|
|
78
|
+
params,
|
|
79
|
+
}: {
|
|
80
|
+
params: Promise<PreviewParams>;
|
|
81
|
+
}) {
|
|
82
|
+
const { slug } = await params;
|
|
83
|
+
return { title: `${path.basename(slug.join('/'))} — React Email` };
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
export default Page;
|
|
@@ -8,22 +8,22 @@ import type { EmailRenderingResult } from '../../../actions/render-email-by-path
|
|
|
8
8
|
import { CodeContainer } from '../../../components/code-container';
|
|
9
9
|
import { Shell } from '../../../components/shell';
|
|
10
10
|
import { Tooltip } from '../../../components/tooltip';
|
|
11
|
-
import { useEmails } from '../../../contexts/emails';
|
|
12
11
|
import { useRenderingMetadata } from '../../../hooks/use-rendering-metadata';
|
|
12
|
+
import { useEmailRenderingResult } from '../../../hooks/use-email-rendering-result';
|
|
13
13
|
import { RenderingError } from './rendering-error';
|
|
14
14
|
|
|
15
15
|
interface PreviewProps {
|
|
16
16
|
slug: string;
|
|
17
17
|
emailPath: string;
|
|
18
18
|
pathSeparator: string;
|
|
19
|
-
|
|
19
|
+
serverRenderingResult: EmailRenderingResult;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const Preview = ({
|
|
23
23
|
slug,
|
|
24
24
|
emailPath,
|
|
25
25
|
pathSeparator,
|
|
26
|
-
|
|
26
|
+
serverRenderingResult,
|
|
27
27
|
}: PreviewProps) => {
|
|
28
28
|
const router = useRouter();
|
|
29
29
|
const pathname = usePathname();
|
|
@@ -31,17 +31,16 @@ const Preview = ({
|
|
|
31
31
|
|
|
32
32
|
const activeView = searchParams.get('view') ?? 'desktop';
|
|
33
33
|
const activeLang = searchParams.get('lang') ?? 'jsx';
|
|
34
|
-
const { useEmailRenderingResult } = useEmails();
|
|
35
34
|
|
|
36
35
|
const renderingResult = useEmailRenderingResult(
|
|
37
36
|
emailPath,
|
|
38
|
-
|
|
37
|
+
serverRenderingResult,
|
|
39
38
|
);
|
|
40
39
|
|
|
41
40
|
const renderedEmailMetadata = useRenderingMetadata(
|
|
42
41
|
emailPath,
|
|
43
42
|
renderingResult,
|
|
44
|
-
|
|
43
|
+
serverRenderingResult,
|
|
45
44
|
);
|
|
46
45
|
|
|
47
46
|
if (process.env.NEXT_PUBLIC_IS_BUILDING !== 'true') {
|
|
@@ -90,7 +89,6 @@ const Preview = ({
|
|
|
90
89
|
<RenderingError error={renderingResult.error} />
|
|
91
90
|
) : null}
|
|
92
91
|
|
|
93
|
-
{/* If this is undefined means that the initial server render of the email had errors */}
|
|
94
92
|
{hasNoErrors ? (
|
|
95
93
|
<>
|
|
96
94
|
{activeView === 'desktop' && (
|
|
@@ -135,6 +133,7 @@ const Preview = ({
|
|
|
135
133
|
)}
|
|
136
134
|
</>
|
|
137
135
|
) : null}
|
|
136
|
+
|
|
138
137
|
<Toaster />
|
|
139
138
|
</div>
|
|
140
139
|
</Shell>
|