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(qwikVite): show build/[name].js output in preview with debug mode #7293

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

maiieul
Copy link
Contributor

@maiieul maiieul commented Jan 28, 2025

What is it?

  • Feature / enhancement

Description

To be able to debug production-only bugs more easily, instead of checking each q-[hash] manually to figure out what code it refers to.

Checklist

  • My code follows the developer guidelines of this project
  • I performed a self-review of my own code
  • I added a changeset with pnpm change
  • I made corresponding changes to the Qwik docs
  • I added new tests to cover the fix / functionality

@maiieul maiieul requested a review from a team as a code owner January 28, 2025 20:55
Copy link

changeset-bot bot commented Jan 28, 2025

🦋 Changeset detected

Latest commit: 9f95854

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@builder.io/qwik Patch
eslint-plugin-qwik Patch
@builder.io/qwik-city Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

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

@maiieul maiieul marked this pull request as draft January 28, 2025 20:57
gioboa
gioboa previously approved these changes Jan 28, 2025
Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

It sounds reasonable to me 👏
Nice @maiieul

Copy link

pkg-pr-new bot commented Jan 28, 2025

Open in Stackblitz

npm i https://pkg.pr.new/@builder.io/qwik@7293
npm i https://pkg.pr.new/@builder.io/qwik-city@7293
npm i https://pkg.pr.new/eslint-plugin-qwik@7293
npm i https://pkg.pr.new/create-qwik@7293

commit: 87bc744

Copy link
Contributor

github-actions bot commented Jan 28, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview e60bd6d

@maiieul
Copy link
Contributor Author

maiieul commented Jan 28, 2025

Thanks @gioboa!

The output is not perfect but it's still quite helpful imo.
image
For example here index.qwik.mjs_GetForm_component_sJBBtCodZQs.js is related to Service Worker code. And index.qwik.mjs_Form_form_onSubmit_JzkFo0mD8j4.js is the core code.

Also I have some files generated in the client dist output called index2 which isn't very useful.
image

I think it's Rollup manually generating the names with some of our generic instructions.

Perhaps it would be worth manually changing the names of those core files to make it more intuitive.

@maiieul maiieul force-pushed the build-name-instead-of-q-hash-in-preview branch from e60bd6d to 9f95854 Compare January 28, 2025 21:26
@maiieul
Copy link
Contributor Author

maiieul commented Jan 28, 2025

image

I tried my PR on 1.5.6... It was a quite a bit more cleaner haha. It shows that the index.qwik.mjs_GetForm_component_sJBBtCodZQs.js is actually preload-helper.js.

I'll see if I can prevent rollup from assigning it a weird name.

@gioboa
Copy link
Member

gioboa commented Jan 28, 2025

The optimizer changed a lot between these versions

@wmertens
Copy link
Member

Since chunks are merged, the name only indicates one thing it does. Why not look at the q-manifest with a server$ call and list the origins?

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.

3 participants