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

* replace `env.OXIDE` with global `__OXIDE__`

This will allow us to replace the `__OXIDE__` at build time, and fully
remove the branches from the final code so that there is not even any
reference to `@tailwindcss/oxide` on the stable engine.

* update changelog

* use `env.ENGINE` in integration tests

* drop oxide branching for the PostCSS plugin for now

This is currently a redirect to the same file, so doesn't hurt.

* Enable better dead-code elimination

* Update CLI tests

Fix indentation

* Fix indentation

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
This commit is contained in:
Robin Malfait 2023-04-18 12:19:20 +02:00 • committed by GitHub
parent 9f860197c9
commit 72bc31867b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 193 additions and 167 deletions

View file

@ -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 {
@ -78,7 +78,7 @@ describe('watcher', () => {
)
}
if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.bg-red-500 {
@ -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 {
@ -145,7 +145,7 @@ describe('watcher', () => {
)
}
if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.bg-red-500 {
@ -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 {
@ -303,7 +303,7 @@ describe('watcher', () => {
)
}
if (env.OXIDE) {
if (env.ENGINE === 'oxide') {
expect(await readOutputFile('main.css')).toIncludeCss(
css`
/* prettier-ignore */