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

fix: optimizer is now better at recognizing constProp #7316

Merged

Conversation

JerryWu1234
Copy link
Contributor

@JerryWu1234 JerryWu1234 commented Feb 6, 2025

What is it?

fixes: #7216

Optimize the Optimize, has been better at recognizing constProp

Description

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

Copy link

changeset-bot bot commented Feb 6, 2025

🦋 Changeset detected

Latest commit: 82d24fa

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

This PR includes changesets to release 5 packages
Name Type
@qwik.dev/core Patch
eslint-plugin-qwik Patch
@qwik.dev/react Patch
@qwik.dev/router 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

Copy link

pkg-pr-new bot commented Feb 6, 2025

Open in Stackblitz

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@7316
npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@7316
npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@7316
npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@7316

commit: 82d24fa

Copy link
Contributor

github-actions bot commented Feb 6, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

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

Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

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

Good start, but it looks like _create_synthetic_qsegment is returning is_const=false because it's a simple identifier, and it doesn't know if the identifier is const.

So we need to pass the const identifiers to that function.

It's important to get this right because putting a handler in a variable before passing it as a handler is very common.

@JerryWu1234 JerryWu1234 changed the title fix: a bug #7216, that const prop was putted in the var fix: optimizer is now better at recognizing constProp Feb 8, 2025
@JerryWu1234 JerryWu1234 marked this pull request as ready for review February 8, 2025 02:13
@JerryWu1234 JerryWu1234 requested a review from a team as a code owner February 8, 2025 02:13
Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

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

LGTM

@wmertens wmertens merged commit ef18cce into QwikDev:build/v2 Feb 10, 2025
22 checks passed
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.

2 participants