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

refactor: optimize async and await in code #9854

Merged
merged 1 commit into from Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion packages/vite/src/node/optimizer/optimizer.ts
Expand Up @@ -232,7 +232,7 @@ async function createDepsOptimizer(
}
}

async function startNextDiscoveredBatch() {
function startNextDiscoveredBatch() {
newDepsDiscovered = false

// Add the current depOptimizationProcessing to the queue, these
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/importAnalysis.ts
Expand Up @@ -87,7 +87,7 @@ function markExplicitImport(url: string) {
return url
}

async function extractImportedBindings(
function extractImportedBindings(
id: string,
source: string,
importSpec: ImportSpecifier,
Expand Down
2 changes: 1 addition & 1 deletion playground/assets/__tests__/assets.spec.ts
Expand Up @@ -272,7 +272,7 @@ describe.runIf(isBuild)('encodeURI', () => {
test('img src with encodeURI', async () => {
const img = await page.$('.encodeURI')
expect(
await (await img.getAttribute('src')).startsWith('data:image/png;base64')
(await img.getAttribute('src')).startsWith('data:image/png;base64')
).toBe(true)
})
})
Expand Down
2 changes: 1 addition & 1 deletion playground/ssr-vue/src/entry-server.js
Expand Up @@ -6,7 +6,7 @@ export async function render(url, manifest) {
const { app, router } = createApp()

// set the router to the desired URL before rendering
router.push(url)
await router.push(url)
await router.isReady()

// passing SSR context object which will be available via useSSRContext()
Expand Down
2 changes: 1 addition & 1 deletion playground/vitestGlobalSetup.ts
Expand Up @@ -42,7 +42,7 @@ export async function setup(): Promise<void> {
}

export async function teardown(): Promise<void> {
browserServer?.close()
await browserServer?.close()
if (!process.env.VITE_PRESERVE_BUILD_ARTIFACTS) {
fs.removeSync(path.resolve(__dirname, '../playground-temp'))
}
Expand Down
2 changes: 1 addition & 1 deletion playground/vitestSetup.ts
Expand Up @@ -171,7 +171,7 @@ beforeAll(async (s) => {
serverLogs.length = 0
await page?.close()
await server?.close()
watcher?.close()
await watcher?.close()
if (browser) {
await browser.close()
}
Expand Down