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

feat(core, preset-mini): generate preflights on demand #4252

Merged
merged 19 commits into from
Nov 30, 2024
Merged

feat(core, preset-mini): generate preflights on demand #4252

merged 19 commits into from
Nov 30, 2024

Conversation

zyyv
Copy link
Member

@zyyv zyyv commented Nov 6, 2024

resolve #3521

In Rulemeta, specify the preflight key you need to depend on and generate preflights on demand. This will reduce irrelevant CSS output.

@zyyv zyyv requested a review from antfu as a code owner November 6, 2024 05:21
Copy link

netlify bot commented Nov 6, 2024

Deploy Preview for unocss ready!

Name Link
🔨 Latest commit f8dbb2f
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/674a9a63bd4b2200082ec7df
😎 Deploy Preview https://deploy-preview-4252--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

pkg-pr-new bot commented Nov 6, 2024

Open in Stackblitz

commit: f8dbb2f

packages/core/src/types.ts Outdated Show resolved Hide resolved
@zyyv zyyv marked this pull request as draft November 6, 2024 06:10
@zyyv zyyv marked this pull request as ready for review November 25, 2024 16:17
@zyyv zyyv requested a review from antfu November 25, 2024 16:17
@zyyv zyyv marked this pull request as draft November 28, 2024 16:30
@zyyv zyyv marked this pull request as ready for review November 29, 2024 11:21
})
// delete static rules so we can't skip them in matching
// but keep the order
return undefined
}
return [i, ...rule]
return [i, rule[0], rule[1], rule[2], rule]
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we can just return [i, rule], or even the i is not needed?

Copy link
Member

Choose a reason for hiding this comment

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

I made a PR to this branch with #4304

Seems to work fine?

@zyyv zyyv added this pull request to the merge queue Nov 30, 2024
Merged via the queue into main with commit 882ce87 Nov 30, 2024
12 checks passed
@zyyv zyyv deleted the pf branch November 30, 2024 05:07
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.

Let preflight-base variables be generated on-demand and reusable.
2 participants