Commit graph

110 commits

Author SHA1 Message Date
depfu[bot]
fbb86a2ac3 Update sass to version 1.69.7 2024-01-05 11:23:49 +00:00
depfu[bot]
144cc5f175 Update rollup to version 4.9.1 2023-12-24 06:42:18 +00:00
depfu[bot]
2fddd06c17 Update vite to version 5.0.10 2023-12-22 19:27:31 +00:00
depfu[bot]
b3242e99ed
Update postcss-cli to version 11.0.0 (#12583)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-12-13 09:33:26 -05:00
depfu[bot]
5e115e7a46 Update vite to version 5.0.5 2023-12-06 00:12:12 +00:00
depfu[bot]
dac9cf23a2 Update parcel to version 2.10.3 2023-11-30 05:27:38 +00:00
depfu[bot]
9c70df1539
Update vite to version 5.0.2 (#12477)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-11-27 13:05:59 +01:00
depfu[bot]
eb2fe9494b
Update rollup to version 4.5.0 (#12458)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-11-21 06:46:44 -05:00
depfu[bot]
a42354c743 Update sass to version 1.69.5 2023-11-14 23:58:10 +00:00
depfu[bot]
1648b864c1 Update parcel to version 2.10.2 2023-11-09 05:32:22 +00:00
depfu[bot]
a8ab341f1e Update vite to version 4.5.0 2023-11-02 08:43:21 +00:00
depfu[bot]
e13ae7b725
Update rollup to version 4.1.4 (#12295)
Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
2023-10-26 09:15:27 -04:00
depfu[bot]
4e1a26aad0 Update sass to version 1.69.4 2023-10-20 01:59:33 +00:00
depfu[bot]
d26a51fae8 Update parcel to version 2.10.0 2023-10-18 07:15:32 +00:00
Jordan Pittman
0b0862b20c
Fix crash when watching renamed files on FreeBSD (#12193)
* Fix file watching bug when renaming files on FreeBSD

* Update changelog

* Add delay to test

* Bump delay

* Update test
2023-10-17 09:50:35 -04:00
depfu[bot]
edfb51c5ed Update vite to version 4.4.11 2023-10-10 19:00:57 +00:00
depfu[bot]
5f00c18bd9 Update rollup to version 3.29.4 2023-10-08 06:20:06 +00:00
depfu[bot]
0d205f9376 Update postcss to version 8.4.31 2023-10-03 16:26:45 +00:00
depfu[bot]
61dc99f4ad Update postcss to version 8.4.30 2023-09-26 22:37:03 +00:00
depfu[bot]
bd970d03f3 Update sass to version 1.67.0 2023-09-21 01:59:04 +00:00
depfu[bot]
91e91e067d Update rollup to version 3.29.1 2023-09-14 07:47:42 +00:00
depfu[bot]
87d7b91ac7 Update postcss to version 8.4.29 2023-09-12 22:22:06 +00:00
depfu[bot]
8f1987567b Update sass to version 1.66.1 2023-08-25 23:29:56 +00:00
depfu[bot]
73272faaa8 Update postcss to version 8.4.28 2023-08-23 14:02:19 +00:00
depfu[bot]
12b670cc6b Update vite to version 4.4.9 2023-08-14 09:43:00 +00:00
Viktor Szépe
77ae72402e
Fix typos (#11805) 2023-08-12 08:17:41 -04:00
depfu[bot]
ff26372570 Update rollup to version 3.28.0 2023-08-11 13:59:49 +00:00
depfu[bot]
cfc853b741 Update postcss to version 8.4.27 2023-08-03 14:03:56 +00:00
depfu[bot]
5e24f8e08a Update sass to version 1.64.1 2023-07-27 22:58:48 +00:00
depfu[bot]
88316a18e5 Update vite to version 4.4.4 2023-07-18 17:02:16 +00:00
depfu[bot]
adadf807fa Update postcss to version 8.4.25 2023-07-13 14:01:01 +00:00
depfu[bot]
3664fd5e02 Update rollup to version 3.26.2 2023-07-13 13:43:32 +00:00
depfu[bot]
ceba1321ec Update sass to version 1.63.6 2023-07-12 02:28:39 +00:00
depfu[bot]
2bfdbce964 Update parcel to version 2.9.3 2023-07-06 22:14:53 +00:00
depfu[bot]
c6370e15f9 Update parcel to version 2.9.2 2023-06-25 11:28:59 +00:00
Robin Malfait
9f591a5586
Always prepend the license comment (#11476)
* always prepend the Tailwind License

Even when you are not using preflight.

* drop the Tailwind License from the preflight plugin

* drop the license in the tests

This allows us to focus on the actual generated CSS without the license.
The license also includes the version number which we would have to
update every time we release a new version.

* update the source maps snapshots

* always prepend the license when using the CLI

* update Tailwind CLI integration test
2023-06-22 16:41:37 -04:00
depfu[bot]
776d5bf614 Update rollup to version 3.25.1 2023-06-19 06:30:22 +00:00
depfu[bot]
a7a1f9347c Update sass to version 1.63.4 2023-06-16 17:58:29 +00:00
Robin Malfait
ef2ebb28d5
Explicitly configure Lightning CSS features, and prefer user browserslist over default browserslist (#11402)
* exclude `Features.LogicalProperties` lightningcss feature

We don't want this to automatically apply since we have dedicated
logical property based utilities already.

We also have a feature flag to toggle some utilities to make use of
logical property based ones.

This feature should be opt-in to prevent backwards compatibility (e.g.:
RTL sites that _did_ use a mr-4 explicitly).

* update default browserslist

* explicitly include/exclude Lightning CSS features

* update tests based on new browserslist and include/exclude features from Lightning CSS

* update integration tests

* prefer user browserslist, fallback to built-in browserslist

* always include Nesting

If a custom browserslist config is used, then we don't explicitly set
the include/exclude features from Lightning CSS (except for nesting, we
always want to process nesting)

* ensure to fallback to the current working directory

* update changelog
2023-06-09 20:37:36 +02:00
Robin Malfait
e572dc645a
Bump lightningcss dependency (#11388)
* bump `lightningcss`

* allow for non-standard selector combinators such as `::deep`

* just use Prettier when comparing CSS results

We were using 2 different engines where the stable one was not using
Lightning CSS and the Oxide one was using Lightning CSS.

To ensure that we didn't have to rewrite every single test expectation,
the `toMatchFormattedCss` parsed both the actual and expected value
using Lightning CSS (to make the result similar), then it used Prettier
to make it... pretty.

Right now we _only_ use Lightning CSS, which means that we can drop the
additional lightningcss format step and just use Prettier on both the
actual and expected values.

Pretty also only prettifies the CSS, it doesn't rewrite it. E.g.:
`@media (min-width: 768px)` will not be optimized to `@media (width >=
768px)`, that's something that Lightning CSS does for us.

This will require some changes in our test output, but it will be
consistent afterwards because there won't be hidden transformation steps
anymore. Because up until now it could be that the actual result was
`color: black` but the tests showed `color: #000` (because it is
shorter).

This change will reflect reality.

* update tests based on previous commit

* only use `toMatchFormattedCss` instead of `toMatchCss`

They both do the exact same thing right now. While `toMatchCss` is
shorter, `toMatchFormattedCss` makes a bit more sense since we are
comparing the Prettier results.

* update integration tests
2023-06-07 15:56:32 +02:00
depfu[bot]
fd74f04437 Update vite to version 4.3.9 2023-06-06 04:12:11 +00:00
depfu[bot]
729dafeb82 Update postcss to version 8.4.24 2023-06-04 10:00:20 +00:00
depfu[bot]
9794b83985 Update parcel to version 2.9.1 2023-06-02 08:44:39 +00:00
depfu[bot]
8719be3944 Update rollup to version 3.23.0 2023-05-29 06:30:31 +00:00
Robin Malfait
04c4de1997
Deprecate --no-autoprefixer flag in the CLI (#11280)
* enable `--no-autoprefixer` test

* handle `--no-autoprefixer` using lightningcss

* bump default chrome version for lightningcss plugin

* handle `map` being nullable

* add `--no-autoprefixer` test including nesting

* set Chrome to version 111 as a default value

* resolve the output message when resolving the promise

* deprecate `--no-autoprefixer` for the CLI

* update changelog
2023-05-25 16:06:00 +02:00
Robin Malfait
581cf6abcc
Merge engines (#11275)
* Simplify CI, make oxide engine the default (#11281)

* remove integration tests for the `stable` engine

* make `integration-tests-oxide` the default integration tests workflow

* remove unnecessary CACHE_PREFIX

* drop `ci-stable.yml` workflow

* make `CI — Oxide` the default

+ drop testing against 3.3 branch (since this is stable only)
+ remove unnecessary CACHE_PREFIX

* drop `release-insiders-stable.yml` workflow

* make `Release Insiders — Oxide` the default

+ change release channel to just `insiders` instead of `oxide-insders`

* drop 3.3 branch from integration tests

* change job name for insiders release

This makes it consistent with the other job names

* prep `release-oxide.yml` workflow to be the default workflow

* add Tailwind Play update

Currently commented out until we figure out how this will work exactly.

* use `env.VERSION` for the version we want to release

* drop `release-stable.yml` workflow

* make `release-oxide.yml` the default `release.yml` workflow

* inline "Calculate environment variables" step

* cache node_modules and cargo related files/folders in the release step

* always use the default CLI

* drop oxide specific implementation

* ensure we test `--postcss` in the CLI

Even for the Oxide engine

* always process `@import` rules

* remove `generalizedModifiers` flag

This was already enabled by default. This commits removes some of the
outstanding references to it.

* remove built-in peer dependencies for the CLI

* drop unused esbuild dependency

* fix type for `configBag`

* setup Lightning CSS for the CLI

* drop `cssnano` dependency

We only used this in the CLI and we now use Lighting CSS which has this
built in already. Therefore we can get rid of this as a dependency.

* ensure `imported.css` file exists in integration tests

* passthrough `options` to lightningcss

Ideally we can read this from `result.map` instead. However this doesn't
get filled in for whatever reason even though we use `map: {inline:true}`.

You can run the `tests/cli.test.js`, and more specifically the
`--postcss supports process options with custom config` test.

* Always process CSS with Lightning CSS

Some tests temporarily skipped. Autoprefixer removed from `postcss.config.js` stubs since vendor prefixing handled by Lightning.

* Remove code for normalizing `@import "tailwindcss/*"` statements

* ensure tailwind doesn't crash when a `tailwind.config.js` file is not present

* add `log.group` to group multiple messages together with different types

* remove engine specific checks in integration tests

* remove unused imports/variables

Make linting check happy

* support `content: ['auto']`

This will allow us to still use auto content detection, but since this
is part of the `content` array, it also allows you to add custom paths
if you want.

E.g.:
```js
content: ['auto', './node_modules/my-library/*.{jsx,tsx}']
```

* ensure `content.files` is always an array

This allows us to simplify some checks because 'auto' will now be part
of the array instead of checking if `content.files` is auto or if it is
an array containing 'auto'.

* fix tests, ensure default config is not injected

* simplify `auto` normalization

* always use the defaultFullConfig

No need to override the defaultFullConfig with `{content: 'auto'}`
because this will be included in the default config already.

* drop condition which ensured `files` was an empty array

This is not needed anymore because when `content` is omitted it behaves
as if it was set to `auto`.

* drop removal of `content`

We used to remove the `content` from the actual configuration files when
using `tailwindcss init` for the oxide engine. This was to ensure that
`auto content detection` was used instead (by default).

But now it is always enabled by default therefore this is not needed
anymore.

* ensure setting `content: 'auto'` works

* improve file cache handling

We have to make sure that we get into the previous state whenver a test
is done.
We were using some `!fileCache[filePath]` checks, however we also used
`null` as a sentinel value when something wasn't found. But, `null` is
falsey as well so some checks where incorrect.

Using a dedicated value and a `Map` makes this safer and more correct
because we can now use `.has()`.

* drop `cleanupFile`, `removeFile` will already take care of it

* drop oxide check in `resolvedChangedContent`

At this point the `context.tailwindConfig.content.files` is already
fully resolved regardless of the engine we are in.

* refactor `parseCandidateStringsFromFiles` strategy, to make use of a proper feature flag

* use feature flag for sorting classes

Once the Oxide engine is the default default, then we can drop this
entirely because the result from the Rust parser will already be sorted.

* drop `crosscheck` from tests where it is safe

First pass of deleting `crosscheck`. These are all the places where we
didn't have any differences between the Oxide and Stable engine.

* replace `__OXIDE__` in corePlugins with feature flag

* use `globalThis.__OXIDE__ ?? false`

This will ensure that in places where we don't have `__OXIDE__` that we
can still properly fallback to `false`.

* use `flex` as the go-to utility when testing features

* prefer `space-utilities` tests instead of `oxide` test

* drop crosscheck check

Since the `oxideParser` is disabled by default, all the tests can use
the `stable` output.

* use simple `false` default values for feature flag defaults

* drop `__OXIDE__` injections in build scripts

* use stable `flex` and `z-{...}` utilities instead of color utilities

flex and z-index related utilities are more stable than the color
utilities right now because the color utilities will use a raw color
value or a combination with a css variable depending on a feature flag.

* drop unused `ENGINE` environment variable

* drop stable engine manifest files

* drop `swap-engines` tooling

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2023-05-24 22:10:00 -04:00
Adam Wathan
dce8280d76
[Oxide] Automatic content detection (#11173)
* resolve all _existing_ content paths

* pin `@napi-rs/cli`

* WIP: Log all resolved content files/globs

* only filter out raw changed content in non-auto mode

* skip parseCandidateFiles cache in `auto` mode

* improve algorithm of detecting content paths

1. Files in the root should be listed statically instead of using globs.
2. Files and folders in special known direct child folders should be
   listed statically instead of using globs (e.g.: `public`). This is
   because these special folders are often used to store generated AND
   source files at the same time. Using globs could trigger infinite
   loops because we are watching and acting upon dist files.
3. All file extensions found in the project, should be used in the globs
   in addition to a known set of extensions.
4. Direct folders seen from the root, can use the glob syntax
   `<root>/src/**/*.{...known-extensions}`

* inline wanted-extensions

Not 100% convinced yet, but seems cleaner so far.

* ensure writing an file also makes the parent folder(s)

* add integration tests for the auto content feature

* add pnpm and bun lock files

* Revert "inline wanted-extensions"

This reverts commit 879c1248524e84216125f4a24e0160b40736333a.

* sort binary-extensions and add lockb

* sort + add `lock` to ignored extensions

* drop `yarn.lock`, because lock extensions are already covered

* group template extensions

This will make it a bit easier to organize in the future.

* drop empty lines and commented lines from template-extensions

* skip the config path when resolving template files

The config file will automatically trigger a rebuild when this file is
changed. However, this should not be part of the template files because
that could cause additional css that's not being used.

* make `auto content` the default in the oxide engine

- In the oxide engine, the default `content: []` will be dropped from
  the default configuration (config.simple.js, config.full.js).
- If you have `content: []` or `content: { files: [] }` then the auto
  content feature won't be active. However if those arrays are empty a
  warning will still be shown. Adding files/globs or dropping the
  `content` section completely will enable auto content.

* only test the auto content integration test in the oxide engine

* set `content.files` to `auto` instead of using `auto: boolean`

This way we don't run into the issue where the `config.content.files` is
set and the `config.content.auto` is set to true.

* drop log

* ensure we validate the config in the CLI

* show experimental warning for automatic content detection

* use cached version of the getCandidateFiles instead of bypassing it

* use `is_empty()` shorthand

Thanks, Clippy!

* add test to ensure nested ignored folders are not scanned

* add `tempfile` for tests

* add auto content tests in Rust

* refactor auto content detection

This will also make sure that if we have (deeply) nested ignored
folders, then we won't use deeply nested globs (**/*.{js,html}) for the
parent(s) of the nested ignored folders but instead use a shallow glob
for each directory (*/*.{js,html}).

Then each sibling directory of the parent can use deeply nested globs
again except for the direct parent.

* use consistent comments

* ensure ignored static listed files are not present

* improve performance by ~30x

On a big test project this goes from ~6s to ~200ms

* improve performance by ~5x

We started with a ~6s duration
Then in the previous commit, we improved it by ~30x and it went down to
~200ms
Now with this change, it takes about ~40ms. That's another ~5x
improvement.

Or in total a ~150x improvement.

* ensure nested folders in `public/` are also explicitly listed

* add shortcut for normalizing files

This is only called once so won't do anything to the main performance of
Tailwind CSS. But always nice to make small performance improvements!

* run Rust tests in CI

* fix lint warnings

* update changelog

* Update CHANGELOG.md

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2023-05-12 18:49:35 +02:00
depfu[bot]
ae5d746226
Update sass to version 1.62.1 2023-05-12 18:49:35 +02:00
depfu[bot]
9b6047d639
Update vite to version 4.3.4 2023-05-12 18:49:33 +02:00
Robin Malfait
bd0497fc5d
Drop support for Node.js v12 (#11089)
* bump `postcss-load-config` in the oxide engine

* bump `postcss-load-config` in the stable engine

* update changelog

* Switch to stable

* Update Node to v14

* Update to latest dependency versions

* Update test helper for new version of `rimraf`

Co-Authored-By: Jordan Pittman <jordan@cryptica.me>

* Downgrade `lightningcss` to `v1.18.0`

Co-Authored-By: Jordan Pittman <jordan@cryptica.me>

* Switch back to oxide

* Update Github actions from Node 12 to Node 14

* Update oxide dependencies

* Update stable dependencies

* Update `content-resolution` integration test dependencies

* Update `postcss-cli` integration test dependencies

* Update `rollup` integration test dependencies

* Update `rollup-sass` integration test dependencies

* Update `vite` integration test dependencies

* Update `webpack-5` integration test dependencies

* Update changelog

* Remove `color-name` dependency

* Replace `quick-lru` dependency with `@alloc/quick-lru`

* Replace `quick-lru` dependency with `@alloc/quick-lru` in stable

* Fix standalone CLI test

---------

Co-authored-by: Jonathan Reinink <jonathan@reinink.ca>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
2023-04-25 16:28:20 -04:00