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)!: generate preflights after utilties #1617

Merged
merged 5 commits into from Oct 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 0 additions & 22 deletions test/generate-async.test.ts
Expand Up @@ -23,26 +23,4 @@ describe('generate-async', () => {
await uno.generate('rule')
expect(order).eql([1, 2])
})

test('preflight-first', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Why?

Copy link
Member Author

Choose a reason for hiding this comment

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

Now parseToken first

Copy link
Member

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?

Copy link
Member Author

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

const order: number[] = []
const uno = createGenerator({
rules: [
[/^rule$/, () => new Promise(resolve => setTimeout(() => {
order.push(2)
resolve('/* rule */')
}, 20))],
],
preflights: [
{
getCSS: () => new Promise(resolve => setTimeout(() => {
order.push(1)
resolve('/* preflight */')
}, 10)),
},
],
})
await uno.generate('rule')
expect(order).eql([1, 2])
})
})