-
Notifications
You must be signed in to change notification settings - Fork 664
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
fix(tailwind): Head component minification issue #1352
Merged
gabrielmfern
merged 6 commits into
canary
from
fix/tailwind-head-component-minification-issue
Mar 13, 2024
Merged
fix(tailwind): Head component minification issue #1352
gabrielmfern
merged 6 commits into
canary
from
fix/tailwind-head-component-minification-issue
Mar 13, 2024
Conversation
This file contains 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
…ed for any arbitrarily deep <head> element
…be as clear as possible
…n a normal mathcing snapshot instead of an inline one
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
vcapretz
approved these changes
Mar 12, 2024
github-merge-queue bot
referenced
this pull request
in dotkom/monoweb
Aug 20, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@react-email/tailwind](https://togithub.com/resend/react-email) ([source](https://togithub.com/resend/react-email/tree/HEAD/packages/tailwind)) | [`^0.0.12` -> `^0.0.19`](https://renovatebot.com/diffs/npm/@react-email%2ftailwind/0.0.12/0.0.19) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@react-email%2ftailwind/0.0.19?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@react-email%2ftailwind/0.0.19?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@react-email%2ftailwind/0.0.12/0.0.19?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@react-email%2ftailwind/0.0.12/0.0.19?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>resend/react-email (@​react-email/tailwind)</summary> ### [`v0.0.19`](https://togithub.com/resend/react-email/blob/HEAD/packages/tailwind/CHANGELOG.md#0019) [Compare Source](https://togithub.com/resend/react-email/compare/@react-email/tailwind@0.0.18...@react-email/tailwind@0.0.19) ##### Patch Changes - [`dfb55ce`](https://togithub.com/resend/react-email/commit/dfb55ce): Changed it so children of a component are only processed after the component is done with them - Add forward ref ### [`v0.0.18`](https://togithub.com/resend/react-email/releases/tag/%40react-email/tailwind%400.0.18): @​react-email/tailwind 0.0.18 [Compare Source](https://togithub.com/resend/react-email/compare/@react-email/tailwind@0.0.17...@react-email/tailwind@0.0.18) #### What's Changed - Fixes relatively complex media queries not being parsed properly by [@​gabrielmfern](https://togithub.com/gabrielmfern) on [#​1475](https://togithub.com/resend/react-email/issues/1475) **Full Changelog**: https://github.com/resend/react-email/compare/[@​react-email/tailwind](https://togithub.com/react-email/tailwind)[@​0](https://togithub.com/0).0.17...[@​react-email/tailwind](https://togithub.com/react-email/tailwind)[@​0](https://togithub.com/0).0.18 ### [`v0.0.17`](https://togithub.com/resend/react-email/releases/tag/%40react-email/tailwind%400.0.17): @​react-email/tailwind 0.0.17 [Compare Source](https://togithub.com/resend/react-email/compare/@react-email/tailwind@0.0.16...@react-email/tailwind@0.0.17) #### What's Changed - Treat React as a peer dependency by [@​eps1lon](https://togithub.com/eps1lon) on [#​1463](https://togithub.com/resend/react-email/issues/1463) - Fixes the inlining of the JSX runtime by [@​eps1lon](https://togithub.com/eps1lon) on [#​1462](https://togithub.com/resend/react-email/issues/1462) - Fixes types for `TailwindConfig` being basically a `Record<string, any>` by [@​gabrielmfern](https://togithub.com/gabrielmfern) on [#​1439](https://togithub.com/resend/react-email/issues/1439) - Fixes children always being transformed into an array by [@​gabrielmfern](https://togithub.com/gabrielmfern) on [#​1397](https://togithub.com/resend/react-email/issues/1397) - Fixes `React.forwardRef` components not working by [@​nzben](https://togithub.com/nzben) on [#​1335](https://togithub.com/resend/react-email/issues/1335) **Full Changelog**: https://github.com/resend/react-email/compare/[@​react-email/tailwind](https://togithub.com/react-email/tailwind)[@​0](https://togithub.com/0).0.16...[@​react-email/tailwind](https://togithub.com/react-email/tailwind)[@​0](https://togithub.com/0).0.17 ### [`v0.0.16`](https://togithub.com/resend/react-email/compare/@react-email/tailwind@0.0.15...@react-email/tailwind@0.0.16) [Compare Source](https://togithub.com/resend/react-email/compare/@react-email/tailwind@0.0.15...@react-email/tailwind@0.0.16) ### [`v0.0.15`](https://togithub.com/resend/react-email/releases/tag/%40react-email/tailwind%400.0.15): @​react-email/tailwind 0.0.15 [Compare Source](https://togithub.com/resend/react-email/compare/v0.0.14...@react-email/tailwind@0.0.15) #### What's Changed - Fixed media query selectors being escaped, which caused issues for some email clients ([https://github.com/resend/react-email/pull/1114](https://togithub.com/resend/react-email/pull/1114)) - Improved internal code readability and fixed key warnings ([https://github.com/resend/react-email/pull/1351](https://togithub.com/resend/react-email/pull/1351)) - Fixed missing head errors being thrown after minification of the Email's component code ([https://github.com/resend/react-email/pull/1352](https://togithub.com/resend/react-email/pull/1352)) - Fixed not being able to use Tailwind classes on the `<html>` element ([https://github.com/resend/react-email/pull/1352](https://togithub.com/resend/react-email/pull/1352)) ### [`v0.0.14`](https://togithub.com/resend/react-email/releases/tag/v0.0.14) [Compare Source](https://togithub.com/resend/react-email/compare/v0.0.13...v0.0.14) #### Patches - Fix lint [#​660](https://togithub.com/resend/react-email/issues/660) ### [`v0.0.13`](https://togithub.com/resend/react-email/releases/tag/v0.0.13) [Compare Source](https://togithub.com/resend/react-email/compare/v0.0.12...v0.0.13) #### Patches - Support external file imports inside of email components [#​615](https://togithub.com/resend/react-email/issues/615) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/dotkom/monoweb). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.
Background
After the Tailwind performance improvements, we changed things so that the
requirement for the
<head>
element being there — when using Tailwind classes thathad media queries — went from being
to being
This change was for two reasons mostly:
elements were included
This ended up causing two issues:
<Html>
tag anymore<Head>
component would be changedto something other than "Head" which ended up breaking our check for the
<Head>
componentHow does this fix the issue?
This fixes the issue by keeping track of whether the
<head>
element was foundand if the non-inlinable styles — currently Tailwind classes with media
queries — were applied to it. The solution also required that I changed
the current error message, as it just didn't apply anymore, and make it a bit more
detailed to whoever is having it.
This solution is also not a breaking change, actually it's more backwards compatible
than the one after the performance improvements.
How can I make sure that it's fixed?
I've added in a unit test with a detailed comment to the code that ensures
that the Tailwind component still applies the styles without throwing
the error. It tests for a custom component that contains the
<head>
element,and it tests with it inside a
<html>
inside the<Tailwind>
component.