Skip to content

preloader: remove unused top-level timestamp initialization in constants#8644

Merged
wmertens merged 2 commits into
build/v2from
copilot/fix-performance-now-guard
May 19, 2026
Merged

preloader: remove unused top-level timestamp initialization in constants#8644
wmertens merged 2 commits into
build/v2from
copilot/fix-performance-now-guard

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

The preloader constants module executed a top-level performance.now() call (loadStart) that is unused and can interfere with compile-time analysis environments (e.g. Wizer).
This change removes that eager runtime access while preserving existing preloader behavior.

  • Problem scope

    • packages/qwik/src/core/preloader/constants.ts exported loadStart = performance.now() at module load time.
    • loadStart is not consumed anywhere in the preloader/core codepath.
  • Change made

    • Removed the unused loadStart export from preloader constants.
    • Kept all other constants and preloader logic unchanged.
  • Behavioral impact

    • Eliminates an unnecessary top-level high-resolution timer read.
    • No runtime behavior changes expected, since the removed symbol had no references.
// before
export const loadStart = performance.now();

// after
// removed (unused)

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

⚠️ No Changeset found

Latest commit: 8919a1e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI changed the title [WIP] Fix performance.now() guard issue in Qwik Rollup preloader: remove unused top-level timestamp initialization in constants May 19, 2026
Copilot AI requested a review from wmertens May 19, 2026 08:54
@wmertens wmertens marked this pull request as ready for review May 19, 2026 09:10
Copilot AI review requested due to automatic review settings May 19, 2026 09:10
@wmertens wmertens requested a review from a team as a code owner May 19, 2026 09:11
@wmertens wmertens enabled auto-merge May 19, 2026 09:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes the unused top-level loadStart = performance.now() export from the preloader constants module. Eliminates an eager runtime timer read that has no consumers and can interfere with compile-time analysis tools like Wizer.

Changes:

  • Delete the loadStart export and its // Global state comment from packages/qwik/src/core/preloader/constants.ts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 19, 2026

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8644

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8644

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8644

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8644

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8644

commit: 8919a1e

@wmertens wmertens merged commit 28b5f0d into build/v2 May 19, 2026
35 checks passed
@wmertens wmertens deleted the copilot/fix-performance-now-guard branch May 19, 2026 09:29
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.

[🐞] v2: Top-level performance.now() should be guarded by isBrowser or removed

3 participants