Skip to content

Commit 691ed02

Browse files
authored
Remove AOT (tailwindlabs#5340)
* make `jit` mode the default when no mode is specified * unify JIT and AOT codepaths * ensure `Object.entries` on undefined doesn't break It could be that sometimes you don't have values in your config (e.g.: `presets: []`), this in turn will break some plugins where we assume we have a value. * drop AOT specific tests These tests are all covered by JIT mode already and were AOT specific. * simplify tests, and add a few Some of the tests were written for AOT specifically, some were missing. We also updated the way we write those tests, essentially making Tailwind a blackbox, by testing against the final output. Now that JIT mode is the default, this is super fast because we only generate what is used, instead of partially testing in a 3MB file or building it all, then purging. * add some todo's to make sure we warn in a few cases * make `darkMode: 'media'`, the default This also includes moving dark mode tests to its own dedicated file. * remove PostCSS 7 compat mode * update CLI to be JIT-first * fix integration tests This is not a _real_ fix, but it does solve the broken test for now. * warn when using @Responsive or @Variants * remove the JIT preview warning * remove AOT-only code paths * remove all `mode: 'jit'` blocks Also remove `variants: {}` since they are not useful in `JIT` mode anymore. * drop unused dependencies * rename `purge` to `content` * remove static CDN builds * mark `--purge` as deprecated in the CLI This will still work, but a warning will be printed and it won't show up in the `--help` output. * cleanup nesting plugin We don't have to duplicate it anymore since there is no PostCSS 7 version anymore. * make sure integration tests run in band * cleanup folder structure * make sure nesting folder is available * simplify resolving of purge/content information
1 parent 911e755 commit 691ed02

File tree

141 files changed

+1959
-10577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1959
-10577
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,8 @@ index.html
1010
yarn.lock
1111
yarn-error.log
1212

13-
# "External" plugins
14-
/nesting
15-
1613
# Perf related files
1714
isolate*.log
1815

1916
# Generated files
20-
/src/corePluginList.js
17+
/src/corePluginList.js

dist/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/.npmignore

Whitespace-only changes.

integrations/parcel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"build": "parcel build ./src/index.html --no-cache",
77
"dev": "parcel watch ./src/index.html --no-cache",
8-
"test": "jest"
8+
"test": "jest --runInBand"
99
},
1010
"jest": {
1111
"displayName": "parcel",

integrations/parcel/tailwind.config.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
module.exports = {
2-
purge: ['./src/index.html'],
3-
mode: 'jit',
4-
darkMode: false, // or 'media' or 'class'
2+
content: ['./src/index.html'],
53
theme: {
64
extend: {},
75
},
8-
variants: {
9-
extend: {},
10-
},
116
corePlugins: {
127
preflight: false,
138
},

integrations/parcel/tests/integration.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ describe.skip('watcher', () => {
127127
'../tailwind.config.js',
128128
javascript`
129129
module.exports = {
130-
purge: ['./src/index.html'],
131-
mode: 'jit',
132-
darkMode: false, // or 'media' or 'class'
130+
content: ['./src/index.html'],
133131
theme: {
134132
extend: {
135133
screens: {
@@ -140,9 +138,6 @@ describe.skip('watcher', () => {
140138
}
141139
},
142140
},
143-
variants: {
144-
extend: {},
145-
},
146141
corePlugins: {
147142
preflight: false,
148143
},

integrations/postcss-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.0.0",
55
"scripts": {
66
"build": "NODE_ENV=production postcss ./src/index.css -o ./dist/main.css",
7-
"test": "jest"
7+
"test": "jest --runInBand"
88
},
99
"jest": {
1010
"displayName": "PostCSS CLI",

integrations/postcss-cli/tailwind.config.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
module.exports = {
2-
purge: ['./src/index.html'],
3-
mode: 'jit',
4-
darkMode: false, // or 'media' or 'class'
2+
content: ['./src/index.html'],
53
theme: {
64
extend: {},
75
},
8-
variants: {
9-
extend: {},
10-
},
116
corePlugins: {
127
preflight: false,
138
},

integrations/postcss-cli/tests/integration.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ describe('watcher', () => {
109109
'../tailwind.config.js',
110110
javascript`
111111
module.exports = {
112-
purge: ['./src/index.html'],
113-
mode: 'jit',
114-
darkMode: false, // or 'media' or 'class'
112+
content: ['./src/index.html'],
115113
theme: {
116114
extend: {
117115
screens: {
@@ -122,9 +120,6 @@ describe('watcher', () => {
122120
}
123121
},
124122
},
125-
variants: {
126-
extend: {},
127-
},
128123
corePlugins: {
129124
preflight: false,
130125
},

integrations/rollup/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"version": "0.0.0",
55
"scripts": {
66
"build": "rollup -c",
7-
"test": "jest"
7+
"test": "jest --runInBand"
88
},
99
"jest": {
1010
"displayName": "rollup.js",

0 commit comments

Comments
 (0)