Skip to content
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

Add @tailwindcss/browser package #15558

Merged
merged 10 commits into from
Jan 7, 2025
Merged

Add @tailwindcss/browser package #15558

merged 10 commits into from
Jan 7, 2025

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Jan 6, 2025

We're going to publish the CDN / browser build of v4 as an npm package so it can be loaded from things like unpkg. This sets up the package for that. The CDN is still intended only for development use. Please do not use it in production.

Note: like the v3 CDN, since it reacts to changes in the DOM, some things like transitions can break if the transition relies on the class being defined before being added to the DOM for correct behavior.

@thecrypticace thecrypticace marked this pull request as ready for review January 6, 2025 19:12
@thecrypticace thecrypticace requested a review from a team as a code owner January 6, 2025 19:12
@thecrypticace
Copy link
Contributor Author

thecrypticace commented Jan 6, 2025

@RobinMalfait Is there anything special I need to do to make sure publishing will work?

@thecrypticace thecrypticace changed the title Add @tailwindcss/cdn package Add @tailwindcss/browser package Jan 6, 2025
@RobinMalfait
Copy link
Member

@RobinMalfait Is there anything special I need to do to make sure publishing will work?

Nope should be good! We publish via pnpm which uses the workspaces, so as long as they are setup it should be good. The only other thing is if we publish additional packages that need to be in sync with the @tailwindcss/browser version, but that's not the case so should also be fine. Otherwise we would've to edit the version-packages script.

You can run pnpm --recursive publish --tag next --no-git-checks --dry-run to test it (note: this only results in output for packages that need to be published. Already published packages will not show up and will be a no-op)

Copy link
Member

@philipp-spiess philipp-spiess left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty impressive how simple the code for this is. 👏

packages/@tailwindcss-browser/src/index.ts Outdated Show resolved Hide resolved
packages/@tailwindcss-browser/src/index.ts Show resolved Hide resolved
packages/@tailwindcss-browser/src/index.ts Outdated Show resolved Hide resolved
packages/@tailwindcss-browser/tests/ui.spec.ts Outdated Show resolved Hide resolved
Copy link
Member

@RobinMalfait RobinMalfait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice, I like the performance marks as well
image

@@ -39,7 +39,7 @@
"dev": "turbo dev --filter=!./playgrounds/*",
"test": "cargo test && vitest run --hideSkippedTests",
"test:integrations": "vitest --root=./integrations",
"test:ui": "pnpm run --filter=tailwindcss test:ui",
"test:ui": "pnpm run --filter=tailwindcss test:ui && pnpm run --filter=@tailwindcss/browser test:ui",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can/should we merge these? I think we can use --filter twice 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you do that it does some super super weird stuff to the console output

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tried it, that is … interesting 😂

CHANGELOG.md Outdated Show resolved Hide resolved
thecrypticace and others added 2 commits January 7, 2025 09:48
Co-authored-by: Philipp Spiess <[email protected]>
Co-authored-by: Philipp Spiess <[email protected]>
@thecrypticace thecrypticace merged commit dcf116b into next Jan 7, 2025
5 checks passed
@thecrypticace thecrypticace deleted the feat/v4-cdn branch January 7, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants