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

Remove AOT #5340

Merged
merged 23 commits into from
Sep 1, 2021
Merged

Remove AOT #5340

merged 23 commits into from
Sep 1, 2021

Conversation

RobinMalfait
Copy link
Contributor

@RobinMalfait RobinMalfait commented Aug 30, 2021

The start of something beautiful. Let's remove AOT mode!

@RobinMalfait RobinMalfait changed the title remove aot Remove aot Aug 30, 2021
@RobinMalfait RobinMalfait changed the title Remove aot Remove AOT Aug 30, 2021
@RobinMalfait RobinMalfait changed the title Remove AOT [WIP] Remove AOT Aug 30, 2021
@TrySound
Copy link
Contributor

TrySound commented Sep 1, 2021

Does it mean we don't need large bundles inside dist anymore?

@adamwathan
Copy link
Member

@TrySound Yeah we are removing the CDN builds from this package for v3.0, whatever we make available CDN-wise we'll put in a separate package so we stop wasting everyone's bandwidth 👀

@RobinMalfait
Copy link
Contributor Author

For people interested, this basically has a 10x reduction in size...

Before After
34.6 MB 3.7 MB

image

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.
These tests are all covered by JIT mode already and were AOT specific.
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.
This also includes moving dark mode tests to its own dedicated file.
This is not a _real_ fix, but it does solve the broken test for now.
Also remove `variants: {}` since they are not useful in `JIT` mode
anymore.
This will still work, but a warning will be printed and it won't show up
in the `--help` output.
We don't have to duplicate it anymore since there is no PostCSS 7
version anymore.
@RobinMalfait RobinMalfait changed the title [WIP] Remove AOT Remove AOT Sep 1, 2021
@RobinMalfait RobinMalfait merged commit 691ed02 into master Sep 1, 2021
@RobinMalfait RobinMalfait deleted the remove-aot branch September 1, 2021 15:14
content: args['--purge'].split(/(?<!{[^}]+),/),
log.warn(['The `--purge` flag has been deprecated.', 'Please use `--content` instead.'])
if (!args['--content']) {
args['--content'] = ['--purge']

Choose a reason for hiding this comment

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

This should probably be args['--content'] = args['--purge']

The current version will just assign an array with --purge as an element

Copy link

@binaryoverload binaryoverload Sep 29, 2021

Choose a reason for hiding this comment

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

Whoops, just realised I commented on a merged branch 🤦‍♂️

This issue is still present on the master branch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries, and thanks for notifying! I've fixed it here: #5646

@lightyen
Copy link
Contributor

lightyen commented Oct 2, 2021

How can I get all available classname from tailwind.config after this change?

@RobinMalfait
Copy link
Contributor Author

@lightyen you cannot get all the available classes because there will be millions of those. We do have a way to get all the base classes, so that means something like bg-red-500 without all variants but the API is a bit complex right now and you do require an internal context to access these.

However, I'm more interested in your use case, can you talk more about that and maybe open an issue/discussion so that we can talk about the use case and find solutions?

@lightyen
Copy link
Contributor

lightyen commented Oct 2, 2021

@RobinMalfait I just need all variants and utilities(or components) for list, if there is a way, it is good!

@RobinMalfait
Copy link
Contributor Author

@lightyen can you open a discussion, then we can move the conversation to its dedicated spot. Thanks! https://github.com/tailwindlabs/tailwindcss/discussions/new

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.

None yet

5 participants