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)!: generate preflights after utilties #1617
Conversation
✅ Deploy Preview for unocss canceled.Built without sensitive environment variables
|
@@ -23,26 +23,4 @@ describe('generate-async', () => { | |||
await uno.generate('rule') | |||
expect(order).eql([1, 2]) | |||
}) | |||
|
|||
test('preflight-first', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now parseToken first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a breaking change - Can we still keep the test but instead update the order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a breaking change - Can we still keep the test but instead update the order?
Yes, updated
This reverts commit cc11fe6.
test/generate-async.test.ts
Outdated
resolve('/* rule */') | ||
}, 20))], | ||
}, 1000))], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the timeout to be this long?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to make it look like it was at the end.
As @chris-zhu said in #1695, there are another way to wait until either tokens or preflights are all processed before doing the other. Try to get access to the
You can combine both calls. Token generation uses cache until you update the config with |
I am actually fine with this PR since it doesn't add extra complexity. @chu121su12 What's your opinion on that? Do you mean you prefer a more general solution? |
@antfu Just with the async behavior as I commented above. With this changes the whole test file could be removed since it was added to ensure the racing behavior. |
Motivation
PR: #1407
I want to collect the used theme in postprocess and return it in preflights. But preflights will be executed faster.
Purpose
Add theme variables collected by
postprocess
to preflight