Skip to content

Replace __OXIDE__ at build time to prevent @tailwindcss/oxide leaks in the stable engine #10988

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

Merged
merged 8 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"parser": {
"syntax": "typescript",
"tsx": false
},
"minify": {
"compress": {
"unused": true
}
}
}
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Don’t move unknown pseudo-elements to the end of selectors ([#10943](https://github.com/tailwindlabs/tailwindcss/pull/10943), [#10962](https://github.com/tailwindlabs/tailwindcss/pull/10962))
- Inherit gradient stop positions when using variants ([#11002](https://github.com/tailwindlabs/tailwindcss/pull/11002))
- Honor default `to` position of gradient when using implicit transparent colors ([#11002](https://github.com/tailwindlabs/tailwindcss/pull/11002))
- Replace `__OXIDE__` at build time to prevent `@tailwindcss/oxide` leaks in the stable engine ([#10988](https://github.com/tailwindlabs/tailwindcss/pull/10988))

## [3.3.1] - 2023-03-30

Expand Down
20 changes: 10 additions & 10 deletions integrations/parcel/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production' },
})

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.bg-primary {
Expand All @@ -85,7 +85,7 @@ describe('static build', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.bg-primary {
Expand Down Expand Up @@ -138,7 +138,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production' },
})

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.bg-primary {
Expand All @@ -149,7 +149,7 @@ describe('static build', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.bg-primary {
Expand Down Expand Up @@ -202,7 +202,7 @@ describe('watcher', () => {
await appendToInputFile('index.html', html`<div class="bg-red-500"></div>`)
})

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.bg-red-500 {
Expand All @@ -219,7 +219,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.bg-red-500 {
Expand Down Expand Up @@ -274,7 +274,7 @@ describe('watcher', () => {
await appendToInputFile('glob/index.html', html`<div class="bg-red-500"></div>`)
})

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.bg-red-500 {
Expand All @@ -291,7 +291,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.bg-red-500 {
Expand Down Expand Up @@ -445,7 +445,7 @@ describe('watcher', () => {
)
})

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.btn {
Expand All @@ -461,7 +461,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile(/index\.\w+\.css$/)).toIncludeCss(
css`
.btn {
Expand Down
12 changes: 6 additions & 6 deletions integrations/postcss-cli/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('watcher', () => {
await appendToInputFile('index.html', html`<div class="bg-red-500"></div>`)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.bg-red-500 {
Expand All @@ -78,7 +78,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.bg-red-500 {
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('watcher', () => {
await appendToInputFile('glob/index.html', html`<div class="bg-red-500"></div>`)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.bg-red-500 {
Expand All @@ -145,7 +145,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.bg-red-500 {
Expand Down Expand Up @@ -284,7 +284,7 @@ describe('watcher', () => {
)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.btn {
Expand All @@ -303,7 +303,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('main.css')).toIncludeCss(
css`
/* prettier-ignore */
Expand Down
16 changes: 8 additions & 8 deletions integrations/rollup-sass/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('watcher', () => {
await appendToInputFile('index.html', html`<div class="bg-red-500"></div>`)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-red-500 {
Expand All @@ -78,7 +78,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-red-500 {
Expand Down Expand Up @@ -128,7 +128,7 @@ describe('watcher', () => {
await appendToInputFile('glob/index.html', html`<div class="bg-red-500"></div>`)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-red-500 {
Expand All @@ -145,7 +145,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-red-500 {
Expand Down Expand Up @@ -282,7 +282,7 @@ describe('watcher', () => {
)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.btn {
Expand All @@ -298,7 +298,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.btn {
Expand Down Expand Up @@ -377,7 +377,7 @@ describe('watcher', () => {
)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.btn {
Expand All @@ -393,7 +393,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.btn {
Expand Down
20 changes: 10 additions & 10 deletions integrations/rollup/tests/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production' },
})

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-primary {
Expand All @@ -73,7 +73,7 @@ describe('static build', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-primary {
Expand Down Expand Up @@ -120,7 +120,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production' },
})

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-primary {
Expand All @@ -131,7 +131,7 @@ describe('static build', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-primary {
Expand Down Expand Up @@ -175,7 +175,7 @@ describe('watcher', () => {
await appendToInputFile('index.html', html`<div class="bg-red-500"></div>`)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-red-500 {
Expand All @@ -192,7 +192,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-red-500 {
Expand Down Expand Up @@ -242,7 +242,7 @@ describe('watcher', () => {
await appendToInputFile('glob/index.html', html`<div class="bg-red-500"></div>`)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-red-500 {
Expand All @@ -259,7 +259,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.bg-red-500 {
Expand Down Expand Up @@ -396,7 +396,7 @@ describe('watcher', () => {
)
await runningProcess.onStderr(ready)

if (!env.OXIDE) {
if (env.ENGINE === 'stable') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.btn {
Expand All @@ -415,7 +415,7 @@ describe('watcher', () => {
)
}

if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('index.css')).toIncludeCss(
css`
.btn {
Expand Down
Loading