-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix typo #3
Merged
Merged
Fix typo #3
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks @thecrypticace! ❤️ |
RobinMalfait
added a commit
that referenced
this pull request
Mar 9, 2024
- We already know a set of candidates from previous runs. - We also already know a set of candidates that are invalid and don't produce anything. This means that an incremental rebuild could give us a new set of candidates that either already exist or are invalid. If nothing changes, then we can re-use the compiled CSS. This actually happens more often than you think, and the bigger your project is the better this optimization will be. For example: ``` // Imagine file A exists: <div class="flex items-center justify-center"></div> <button class="text-red-500">Delete</button> ``` ``` // Now you add a second file B: <div class="text-red-500 flex"></div> ``` You just created a brand new file with a bunch of HTML elements and classes, yet all of the candidates in file B already exist in file A, so nothing changes to the actual generated CSS. Now imagine the other hundreds of files that already contain hundreds of classes. The beauty of this optimization is two-fold: - On small projects, compiling is very fast even without this check. This means it is performant. - On bigger projects, we will be able to re-use existing candidates. This means it stays performant.
philipp-spiess
added a commit
that referenced
this pull request
Jul 31, 2024
RobinMalfait
added a commit
that referenced
this pull request
Sep 20, 2024
A bit of a vague commit message, but this does a lot of things. I could split it up, but not sure if it's worth it. Instead, let's talk about it. While working on keeping track of comment locations I was running into some issues. Not the end of the world, but we could make things better. Paired with Jordan on this to rework the algorithm. The idea is that we now do multiple passes which is technically slower, but now we can work on separate units of work. - Step #1 is to prepare the at-rule. This means that rules with multiple selectors will be split in multiple nodes with the their own single selector. - Step #2 is to collect all the classes we want to create an `@utility` for. - Step #3 is to create a clone of the main `@layer utilities` for all the non-`@utility` leftover nodes (E.g.: rules with element and ID selectors). - Step #4 is to create a clone of the main `@layer utilities` node for every single `@utility <name>` we want to create. - Step #5 is to go over every clone, and eliminate everything that is not part of the `@utility` in question. So we can remove siblings (except for comments near it) and go up the chain. - Step #6 is now to go over the initial `@layer utilities` clone we set aside, and remove everything that's not part of any of the clones. - Step #7 is cleanup work, where empty nodes are removed, and rules with a selector of `&` are replaced by its children. This is done in a depth-first traversal instead of breadth first. Co-authored-by: Jordan Pittman <jordan@cryptica.me>
RobinMalfait
added a commit
that referenced
this pull request
Sep 20, 2024
A bit of a vague commit message, but this does a lot of things. I could split it up, but not sure if it's worth it. Instead, let's talk about it. While working on keeping track of comment locations I was running into some issues. Not the end of the world, but we could make things better. Paired with Jordan on this to rework the algorithm. The idea is that we now do multiple passes which is technically slower, but now we can work on separate units of work. - Step #1 is to prepare the at-rule. This means that rules with multiple selectors will be split in multiple nodes with the their own single selector. - Step #2 is to collect all the classes we want to create an `@utility` for. - Step #3 is to create a clone of the main `@layer utilities` for all the non-`@utility` leftover nodes (E.g.: rules with element and ID selectors). - Step #4 is to create a clone of the main `@layer utilities` node for every single `@utility <name>` we want to create. - Step #5 is to go over every clone, and eliminate everything that is not part of the `@utility` in question. So we can remove siblings (except for comments near it) and go up the chain. - Step #6 is now to go over the initial `@layer utilities` clone we set aside, and remove everything that's not part of any of the clones. - Step #7 is cleanup work, where empty nodes are removed, and rules with a selector of `&` are replaced by its children. This is done in a depth-first traversal instead of breadth first. Co-authored-by: Jordan Pittman <jordan@cryptica.me>
RobinMalfait
added a commit
that referenced
this pull request
Sep 21, 2024
A bit of a vague commit message, but this does a lot of things. I could split it up, but not sure if it's worth it. Instead, let's talk about it. While working on keeping track of comment locations I was running into some issues. Not the end of the world, but we could make things better. Paired with Jordan on this to rework the algorithm. The idea is that we now do multiple passes which is technically slower, but now we can work on separate units of work. - Step #1 is to prepare the at-rule. This means that rules with multiple selectors will be split in multiple nodes with the their own single selector. - Step #2 is to collect all the classes we want to create an `@utility` for. - Step #3 is to create a clone of the main `@layer utilities` for all the non-`@utility` leftover nodes (E.g.: rules with element and ID selectors). - Step #4 is to create a clone of the main `@layer utilities` node for every single `@utility <name>` we want to create. - Step #5 is to go over every clone, and eliminate everything that is not part of the `@utility` in question. So we can remove siblings (except for comments near it) and go up the chain. - Step #6 is now to go over the initial `@layer utilities` clone we set aside, and remove everything that's not part of any of the clones. - Step #7 is cleanup work, where empty nodes are removed, and rules with a selector of `&` are replaced by its children. This is done in a depth-first traversal instead of breadth first. Co-authored-by: Jordan Pittman <jordan@cryptica.me>
RobinMalfait
added a commit
that referenced
this pull request
Sep 23, 2024
A bit of a vague commit message, but this does a lot of things. I could split it up, but not sure if it's worth it. Instead, let's talk about it. While working on keeping track of comment locations I was running into some issues. Not the end of the world, but we could make things better. Paired with Jordan on this to rework the algorithm. The idea is that we now do multiple passes which is technically slower, but now we can work on separate units of work. - Step #1 is to prepare the at-rule. This means that rules with multiple selectors will be split in multiple nodes with the their own single selector. - Step #2 is to collect all the classes we want to create an `@utility` for. - Step #3 is to create a clone of the main `@layer utilities` for all the non-`@utility` leftover nodes (E.g.: rules with element and ID selectors). - Step #4 is to create a clone of the main `@layer utilities` node for every single `@utility <name>` we want to create. - Step #5 is to go over every clone, and eliminate everything that is not part of the `@utility` in question. So we can remove siblings (except for comments near it) and go up the chain. - Step #6 is now to go over the initial `@layer utilities` clone we set aside, and remove everything that's not part of any of the clones. - Step #7 is cleanup work, where empty nodes are removed, and rules with a selector of `&` are replaced by its children. This is done in a depth-first traversal instead of breadth first. Co-authored-by: Jordan Pittman <jordan@cryptica.me>
RobinMalfait
added a commit
that referenced
this pull request
Sep 23, 2024
A bit of a vague commit message, but this does a lot of things. I could split it up, but not sure if it's worth it. Instead, let's talk about it. While working on keeping track of comment locations I was running into some issues. Not the end of the world, but we could make things better. Paired with Jordan on this to rework the algorithm. The idea is that we now do multiple passes which is technically slower, but now we can work on separate units of work. - Step #1 is to prepare the at-rule. This means that rules with multiple selectors will be split in multiple nodes with the their own single selector. - Step #2 is to collect all the classes we want to create an `@utility` for. - Step #3 is to create a clone of the main `@layer utilities` for all the non-`@utility` leftover nodes (E.g.: rules with element and ID selectors). - Step #4 is to create a clone of the main `@layer utilities` node for every single `@utility <name>` we want to create. - Step #5 is to go over every clone, and eliminate everything that is not part of the `@utility` in question. So we can remove siblings (except for comments near it) and go up the chain. - Step #6 is now to go over the initial `@layer utilities` clone we set aside, and remove everything that's not part of any of the clones. - Step #7 is cleanup work, where empty nodes are removed, and rules with a selector of `&` are replaced by its children. This is done in a depth-first traversal instead of breadth first. Co-authored-by: Jordan Pittman <jordan@cryptica.me>
RobinMalfait
added a commit
that referenced
this pull request
Sep 23, 2024
A bit of a vague commit message, but this does a lot of things. I could split it up, but not sure if it's worth it. Instead, let's talk about it. While working on keeping track of comment locations I was running into some issues. Not the end of the world, but we could make things better. Paired with Jordan on this to rework the algorithm. The idea is that we now do multiple passes which is technically slower, but now we can work on separate units of work. - Step #1 is to prepare the at-rule. This means that rules with multiple selectors will be split in multiple nodes with the their own single selector. - Step #2 is to collect all the classes we want to create an `@utility` for. - Step #3 is to create a clone of the main `@layer utilities` for all the non-`@utility` leftover nodes (E.g.: rules with element and ID selectors). - Step #4 is to create a clone of the main `@layer utilities` node for every single `@utility <name>` we want to create. - Step #5 is to go over every clone, and eliminate everything that is not part of the `@utility` in question. So we can remove siblings (except for comments near it) and go up the chain. - Step #6 is now to go over the initial `@layer utilities` clone we set aside, and remove everything that's not part of any of the clones. - Step #7 is cleanup work, where empty nodes are removed, and rules with a selector of `&` are replaced by its children. This is done in a depth-first traversal instead of breadth first. Co-authored-by: Jordan Pittman <jordan@cryptica.me>
RobinMalfait
added a commit
that referenced
this pull request
Sep 24, 2024
A bit of a vague commit message, but this does a lot of things. I could split it up, but not sure if it's worth it. Instead, let's talk about it. While working on keeping track of comment locations I was running into some issues. Not the end of the world, but we could make things better. Paired with Jordan on this to rework the algorithm. The idea is that we now do multiple passes which is technically slower, but now we can work on separate units of work. - Step #1 is to prepare the at-rule. This means that rules with multiple selectors will be split in multiple nodes with the their own single selector. - Step #2 is to collect all the classes we want to create an `@utility` for. - Step #3 is to create a clone of the main `@layer utilities` for all the non-`@utility` leftover nodes (E.g.: rules with element and ID selectors). - Step #4 is to create a clone of the main `@layer utilities` node for every single `@utility <name>` we want to create. - Step #5 is to go over every clone, and eliminate everything that is not part of the `@utility` in question. So we can remove siblings (except for comments near it) and go up the chain. - Step #6 is now to go over the initial `@layer utilities` clone we set aside, and remove everything that's not part of any of the clones. - Step #7 is cleanup work, where empty nodes are removed, and rules with a selector of `&` are replaced by its children. This is done in a depth-first traversal instead of breadth first. Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
border color -> border width