You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Faster startup time, especially for automated tests
Reduce memory usage
Background
Barrel files (files that import and then re-export a large number of things) have often been discussed as contributing to larger runtimes and larger memory usage in contexts such as automated test suites.
Proposal
I'm in the process of updating from the old individual @react-email/components 0.x to current react-email and noticed that one of our Jest test suites that exercises our email functionality takes ~60% longer to run.
As I understand it, the problem is that I used to be able to import from @react-email/head, @react-email/html, etc., and only pay for what I need. However, now that the only documented import path is import { Head } from 'react-email', then any react-email usage, no matter how simple, has to pay for loading, parsing, and executing the JS code for prism.js, Tailwind, etc., even if it doesn't use any of those features.
Could you please enable (i.e., document and support) the use of imports such as import Head from 'react-email/components/head' or similar, to alleviate this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Goals
Background
Barrel files (files that import and then re-export a large number of things) have often been discussed as contributing to larger runtimes and larger memory usage in contexts such as automated test suites.
Proposal
I'm in the process of updating from the old individual @react-email/components 0.x to current react-email and noticed that one of our Jest test suites that exercises our email functionality takes ~60% longer to run.
As I understand it, the problem is that I used to be able to import from @react-email/head, @react-email/html, etc., and only pay for what I need. However, now that the only documented import path is
import { Head } from 'react-email', then any react-email usage, no matter how simple, has to pay for loading, parsing, and executing the JS code for prism.js, Tailwind, etc., even if it doesn't use any of those features.Could you please enable (i.e., document and support) the use of imports such as
import Head from 'react-email/components/head'or similar, to alleviate this?I can submit a PR if there's interest. Thank you.
All reactions