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(optimizer): remove using resolvePackageData API from Vite #5312

Merged
merged 5 commits into from
Oct 19, 2023
Merged

refactor(optimizer): remove using resolvePackageData API from Vite #5312

merged 5 commits into from
Oct 19, 2023

Conversation

bluwy
Copy link
Contributor

@bluwy bluwy commented Oct 13, 2023

Overview

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests / types / typos

Description

Remove resolvePackageData usage to use findDepPkgJsonPath from vitefu instead.

I'm not sure if my change is correct as I'm not sure of the use of sys.strictDynamicImport here. Let me know if I did something wrong!

Use cases and why

Vite 5 is removing the resolvePackageData API to help improve future performance and bug fixes. (vitejs/vite#14584) The API is not used widely so making a PR here to refactor it away.

I'm using vitefu which I maintain on the side and implements the same heuristic, and is also used by frameworks like Svelte, Solid, and Astro today.

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

@netlify
Copy link

netlify bot commented Oct 13, 2023

👷 Deploy request for qwik-insights pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 98dc6da

@gioboa gioboa added COMP: qwik-city WAITING FOR: team Waiting for one of the core team members to review and reply labels Oct 13, 2023
@gioboa
Copy link
Member

gioboa commented Oct 13, 2023

Thanks for your contribution, this PR needs a review from the core team.

Copy link
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

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

Thank you for the PR. This seems reasonable. Waiting for the tests to pass

@bluwy
Copy link
Contributor Author

bluwy commented Oct 14, 2023

Seems like it has trouble bundling the library, I can check it later today.

@wmertens
Copy link
Member

@bluwy it looks like vitefu is more precise about node versions, we're targeting at least 16.8 (and actually 16 just left LTS so maybe we should target 18)

@bluwy

This comment was marked as outdated.

@mhevery
Copy link
Contributor

mhevery commented Oct 15, 2023

But I'm not really sure if no1-3 are safe changes for qwik currently. Or maybe something you'd want to do a later time when supporting Vite 5?

What specifically would this change do? How will the output be changed? Can you give it a try and see what happens to the build?

@bluwy
Copy link
Contributor Author

bluwy commented Oct 16, 2023

Aight with a little grease I'm actually able to make it work without my mentioned changes above, except no2. 6d91050 (#5312) shows the build change needed to make it work. I used an esbuild plugin to remove the TLA manually for now.

Copy link
Contributor

@mhevery mhevery left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution. ❤️

@mhevery mhevery merged commit ec53ef7 into QwikDev:main Oct 19, 2023
20 checks passed
@bluwy bluwy deleted the remove-resolve-package-data branch October 20, 2023 03:43
kodiakhq bot referenced this pull request in ascorbic/unpic-img Oct 29, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@builder.io/qwik](https://qwik.builder.io/) ([source](https://togithub.com/BuilderIO/qwik)) | [`1.2.14` -> `1.2.15`](https://renovatebot.com/diffs/npm/@builder.io%2fqwik/1.2.14/1.2.15) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@builder.io%2fqwik/1.2.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@builder.io%2fqwik/1.2.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@builder.io%2fqwik/1.2.14/1.2.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@builder.io%2fqwik/1.2.14/1.2.15?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>BuilderIO/qwik (@&#8203;builder.io/qwik)</summary>

### [`v1.2.15`](https://togithub.com/BuilderIO/qwik/releases/tag/v1.2.15)

[Compare Source](https://togithub.com/BuilderIO/qwik/compare/v1.2.14...v1.2.15)

#### What's Changed

-   fix(vercel): \[vercel-edge adapter] allow to use the `node` target by [@&#8203;Schniz](https://togithub.com/Schniz) in [https://github.com/BuilderIO/qwik/pull/4361](https://togithub.com/BuilderIO/qwik/pull/4361)
-   refactor(optimizer): remove using resolvePackageData API from Vite by [@&#8203;bluwy](https://togithub.com/bluwy) in [https://github.com/BuilderIO/qwik/pull/5312](https://togithub.com/BuilderIO/qwik/pull/5312)
-   feat: add outDir support to qwikInsights by [@&#8203;intellix](https://togithub.com/intellix) in [https://github.com/BuilderIO/qwik/pull/5335](https://togithub.com/BuilderIO/qwik/pull/5335)
-   fix(cli): set args on interactive cli by [@&#8203;mpeg](https://togithub.com/mpeg) in [https://github.com/BuilderIO/qwik/pull/5334](https://togithub.com/BuilderIO/qwik/pull/5334)
-   chore: ts-ignore vite 5 types issue by [@&#8203;bluwy](https://togithub.com/bluwy) in [https://github.com/BuilderIO/qwik/pull/5341](https://togithub.com/BuilderIO/qwik/pull/5341)
-   chore(docs): remove warnings by [@&#8203;gioboa](https://togithub.com/gioboa) in [https://github.com/BuilderIO/qwik/pull/5345](https://togithub.com/BuilderIO/qwik/pull/5345)
-   style(eslint): convey a stricter restriction from `just` to `only` (examples) by [@&#8203;uceumice](https://togithub.com/uceumice) in [https://github.com/BuilderIO/qwik/pull/5340](https://togithub.com/BuilderIO/qwik/pull/5340)
-   feat(vite): allow disabling dev SSR server in vite by [@&#8203;mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5347](https://togithub.com/BuilderIO/qwik/pull/5347)
-   chore(docs): Small fix of file to edit by [@&#8203;nelsonprsousa](https://togithub.com/nelsonprsousa) in [https://github.com/BuilderIO/qwik/pull/5348](https://togithub.com/BuilderIO/qwik/pull/5348)
-   docs: Update index.mdx by [@&#8203;runarj](https://togithub.com/runarj) in [https://github.com/BuilderIO/qwik/pull/5351](https://togithub.com/BuilderIO/qwik/pull/5351)
-   fix: action redirect accidentally stripped searchparams by [@&#8203;mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5349](https://togithub.com/BuilderIO/qwik/pull/5349)
-   fix: remove cf pages stream polyfill by [@&#8203;mpeg](https://togithub.com/mpeg) in [https://github.com/BuilderIO/qwik/pull/5352](https://togithub.com/BuilderIO/qwik/pull/5352)
-   chore: updated twitter logo to X by [@&#8203;Kaushik080](https://togithub.com/Kaushik080) in [https://github.com/BuilderIO/qwik/pull/5357](https://togithub.com/BuilderIO/qwik/pull/5357)
-   docs: update React cheat sheet title by [@&#8203;mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5358](https://togithub.com/BuilderIO/qwik/pull/5358)
-   chore: 1.2.15 by [@&#8203;mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5359](https://togithub.com/BuilderIO/qwik/pull/5359)

#### New Contributors

-   [@&#8203;Schniz](https://togithub.com/Schniz) made their first contribution in [https://github.com/BuilderIO/qwik/pull/4361](https://togithub.com/BuilderIO/qwik/pull/4361)
-   [@&#8203;bluwy](https://togithub.com/bluwy) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5312](https://togithub.com/BuilderIO/qwik/pull/5312)
-   [@&#8203;intellix](https://togithub.com/intellix) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5335](https://togithub.com/BuilderIO/qwik/pull/5335)
-   [@&#8203;nelsonprsousa](https://togithub.com/nelsonprsousa) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5348](https://togithub.com/BuilderIO/qwik/pull/5348)
-   [@&#8203;Kaushik080](https://togithub.com/Kaushik080) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5357](https://togithub.com/BuilderIO/qwik/pull/5357)

**Full Changelog**: QwikDev/qwik@v1.2.14...v1.2.15

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9pm on sunday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/ascorbic/unpic-img).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMS41IiwidXBkYXRlZEluVmVyIjoiMzcuMzEuNSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
mhevery added a commit that referenced this pull request Oct 31, 2023
mhevery added a commit that referenced this pull request Oct 31, 2023
… Vite" (#5379)

Revert "refactor(optimizer): remove using resolvePackageData API from Vite (#5312)"

This reverts commit ec53ef7.
wmertens pushed a commit to wmertens/qwik that referenced this pull request Nov 17, 2023
wmertens pushed a commit to wmertens/qwik that referenced this pull request Nov 17, 2023
mhevery added a commit that referenced this pull request Dec 7, 2023
* add created/updated date to docs frontmatter

* read the frontmatter (#1)

* feat: show updated docs

showing the updated docs with a circle next to the title, in this commit I added the circles.

* chore(docs): remove warnings (#5345)

* style(eslint): convey a stricter restriction from `just` to `only` (examples) (#5340)

* feat(vite): allow disabling dev SSR server in vite (#5347)

* chore(docs): Small fix of file to edit (#5348)

* docs: Update index.mdx (#5351)

* Update index.mdx

Correct mistake. The original was:

Both pages are created by adding ...

Changed to:

 Pages are created by adding ...

* trigger GH checks

---------

Co-authored-by: gioboa <[email protected]>

* fix: action redirect accidentally stripped searchparams (#5349)

Fix #5342

* fix: remove cf pages stream polyfill (#5352)

* chore: updated twitter logo to X (#5357)

* docs: update React cheat sheet title (#5358)

* 1.2.15 (#5359)

* docs: improve SEO with descriptions (#5360)

* fix(cli): parseTemplatePath doesn't work in windows (#5339)

* fix(cli) parseTemplatePath doesn't work in windows

* refactor use path.sep

---------

Co-authored-by: Yale <[email protected]>

* docs: fix typo (#5361)

* chore(qwik-insights): use clientOutDir if provided (#5366)

* docs: remove soundy.cloud (#5374)

* chore: clean up release script (#5376)

* fix(qwik): Incorrect module reference in inlinedQrl (#5375)

* fix(qwik): Incorrect module reference in inlinedQrl

Fix #5368

* fixup! fix(qwik): Incorrect module reference in inlinedQrl

* docs: Alex Russell Approved javascript framework (#5364)

* docs: Alex Russell Approved

Alex Russell Approved JavaScript framework

* docs(faq): wording

* chore: improved README.md for build artifacts (#5377)

* fix(qwik-city): parseBody should not clone Request (#5353)

fix(qwik-city): parseBody should not clone requests

* docs(eslint-rules): refactor use-method-usage to reflect current qwik… (#5344)

* docs(eslint-rules): refactor use-method-usage to reflect current qwik API

* refactored unit tests

* re-add TSAsExpression

* word change: just -> only, to reflect latest PR

---------

Co-authored-by: Miško Hevery <[email protected]>

* fix: Yarn 3/4 PnP compatibility (#5042)

* CI

* revert

---------

Co-authored-by: Roman Zanettin <[email protected]>

* Revert "refactor(optimizer): remove using resolvePackageData API from Vite" (#5379)

Revert "refactor(optimizer): remove using resolvePackageData API from Vite (#5312)"

This reverts commit ec53ef7.

* docs: update Alex Russell (#5381)

* chore: 1.2.16 (#5382)

* fix(labs): Better handling and visibility of q-insights.json (#5384)

* feat(insights): Add new route visibility (#5385)

* fix(vite): resolution of nested dependencies

Co-authored-by: Manu MA <[email protected]>

* docs: fix incorrect escaping in URL (#5387)

* fix(insights): improve files per cluster (#5388)

Increase clustering distance which should result in creation of fewer clusters.
Fewer clusters means that less files should be downloaded to the client
(each file will have more symbols.) This should improve performance.

* fix(qwik): Improve logging of vite plugin (#5389)

fix(qwik): Improve logging of vite plugin

The log now includes file location and code snippet.

* fix(core): parent component lookup during pause

the parentCtx attribute was optimized to point directly to parents with
$contexts$ defined, but that broke pausing which needs the immediate parent.

Co-authored-by: Jesse Zhang <[email protected]>

* chore: clean up docs site build warnings (#5391)

* docs: explain custom event props and detail when PropFunction is needed (#5386)

* docs: don't index demos; don't duplicate meta descriptions (#5392)

* docs: add custom 404 page (#5393)

* chore(docs): small improvements to routing/index.mdx

* refactor(package.json): add docs.dev & docs.preview

Add pnpm docs.dev & pnpm docs.preview commands to improve the DX for contributors.

* chore: 1.2.17 (#5397)

* fix(insight): use relative path (#5399)

* docs: Update media page with new YouTube video links (#5401)

Update media page with new YouTube video links

* chore(starters): add VSCode debug setting (#5408)

* docs(integrations): astro integration docs (#5409)

* docs(integrations): astro integration docs

* docs(integration): typo

* docs(docs): updated docs changes

* docs(menu): Add Astro integration to menu (#5410)

* Add Astro integration to menu

* Add description and keywords to Astro integration
page, and update contributor list.

* chore(docs): update node integration page (#5413)

Bold statement regarding `ORIGIN` env var.

* fix(qwik-city): vercel adapter default to `webworker` target (#5414)

* docs: correct broken image (#5415)

* docs(astro): Qwik + Astro doc improvements (#5416)

* Qwik astro doc improvements

* typo fix

* fix(propfunctionprops): prevent 'undefined', 'null', 'never' conversion to PropFnInterface (#5363)

* fix(propfunctionprops): prevent 'undefined', 'null', 'never' conversion to PropFnInterface

fix #4946

* improve PropFunctionProps readability and edge-cases

* fix never becoming undefined

* fixup! fix never becoming undefined

* refine tests

---------

Co-authored-by: Miško Hevery <[email protected]>

* fix(qwik-city): better type for svg?jsx imports (#5420)

* fix(qwik-city): fix rendered svg?jsx component closing tag (#5423)

* fix: fix optimized svg closing tag

* test: add svg optimizer test

* fix: cache max-age vite.config for dev mode (#5427)

* fix(cli): casing for component and mdx route creation (#5430)

* docs: fix broken image (#5432)

* docs: fixed small typo (#5434)

* docs: add missing contributors (#5435)

* fix: 3rd party imports of libs during build (#5431)

Co-authored-by: Miško Hevery <[email protected]>

* fix(docs): improve SEO  (#5439)

* feat(core): auto px addition to css properties for unitless numbers (#5426)

* feat(core): auto px addition to css properties for unitless numbers

This adds support for auto-addition of 'px' to css properties

* add tests to check styles in both ssr and csr

* docs: Add link to create new Qwik Insights app as self-serve (#5443)

* fix: Pass the missing props for Spinner component (#5437)

Pass the missing props for Spinner component

As the `growing` props is missing in the bootstrap starter template `Spinner` component it is causing the issue in production build while testing after adding the bootstrap.

* fix(docs): Wrap function in cleanup function instead of returning it (#5440)

Wrap function in cleanup function instead of returning it

* fix(docs): typo in qwikcity -> Validator docs (#5444)

---------

Co-authored-by: gioboa <[email protected]>

* fix(docs): typo in qwik city -> middleware page (#5446)

---------

Co-authored-by: gioboa <[email protected]>

* fix(docs): update links for Edit this page button (#5445)

---------

Co-authored-by: gioboa <[email protected]>

* chore: 1.2.18 (#5449)

* docs: Add Component library `ionic-qwik` to community projects on docs. (#5429)

Add Component library `ionic-qwik`.

* chore(docs): advanced usage of Slot, visibleTask (#5424)

chore(docs): advanced Slot, visibleTask, Context

* chore(core): update `QwikKeyboardEvent` type (#5433)

chore(core): update keyboardevent to have code attr and update deprecated attrs

* fix(docs): remove `inline-code` and `link` in tag `<a />` (#5450)

---------

Co-authored-by: wangyipeng <[email protected]>
Co-authored-by: Giorgio Boa <[email protected]>

* docs(ssg): fix shell command (#5459)

* docs(auth.js): add credentials example (#5462)

* chore: 1.2.19 (#5466)

* chore(all): Vite 5 upgrade

* chore(core): remove resolvePackageData (#5312)

* chore: pnpm api.update

* feat(playground): remove broken versions

* feat: add qwik/no-use-visible-task eslint rule (#5455)

* feat: add qwik/no-use-visible-task eslint rule
----
Co-authored-by: Matteo Pietro Dazzi <[email protected]>
Co-authored-by: Pasquale De Lucia <[email protected]>
Co-authored-by: Gloria Giannascoli <[email protected]>
Co-authored-by: pietrodev07 <[email protected]>

* linter 🧽

* feat: add extra tips

* fix: change message

* docs: add missing eslint recap

* chore(insights): remove unnecessary log (#5461)

* fix: add example context to docs (#5467)

* feat(qwik-city): allow customizing SVGO options of image plugin (#5407)

* docs: fix typo

* docs: fix typo (#5481)

* fix(core): Support JSX in signals (#5442)

Fix #4966
Fix #3530

* docs(FAQ): - lazy-loading on user interaction & speculative module fetching (#5488)

docs: FAQ - lazy-loading on user interaction & speculative module fetching

* docs(faq): add link to typescript (#5487)

* fix: disable Vite modulepreload (#5493)

* fix: disable Vite modulePreload

Fixed: #5478

* chore: use cleaner option

* docs(faq): fix typos and improve the wording of some sentences (#5490)

* docs: make the distinction between module-prefetching and <Link prefetch> (#5485)

docs(module-prefetching): make the distinction between module-prefetching and <Link prefetch>

* docs(showcase): add `index.app` and `wiza.co` (#5484)

Update pages.json

* fix(docs): mdx interpreting title as component (#5499)

* docs: cleanup the vdom section (#5500)

* fix: revert "fix: remove cf pages stream polyfill" (#5502)

* fix(qwik-city): prefix ids of SVGs based on their path when loaded as qwik nodes (#5497)

Enable the prefixIds SVGO plugin by default, while still allowing customization. This is a follow up
on #5407. Here's a discussion on why it makes sense when
optimizing SVG files for the web: svg/svgo#674.

* fix: cf pages polyfill only if needed (#5507)

fix: polyfill only if needed

* refactor: extract group type

* docs: add QwikCityMockProvider explanation (#5505)

* Extend index.mdx to include QwikCityMockProvider

* docs: add links between vitest integration page and qwikcity api page

* docs(glob-import): add documentation for import.meta.glob (#5504)

* docs(glob-import): add documentation for import.meta.glob

* docs(glob-imports): add Glob Import link to /cookbook/index.mdx

* docs(glob-import): refactor type any to Record<string, any>

* docs: add Record<string, any> to mdx as well

* fix: CF pages polyfill also when shimmed (#5512)

* fix: polyfill also when shimmed

* chore: add comment to explain polyfill

* chore: Giorgio's feedback

* refactor: made the renderUpdate as a const

put the mardown update in a const which made the code cleaner and better to understand

* fix: fixed build

* docs: api update

* refactor: build

* chore: fix pnpm-locke file

* chore: build

* chore: pnpm fmt

* refactor: removed style-system

---------

Co-authored-by: Marcos Perona <[email protected]>
Co-authored-by: Giorgio Boa <[email protected]>
Co-authored-by: Alex Tocar <[email protected]>
Co-authored-by: Miško Hevery <[email protected]>
Co-authored-by: Nelson Sousa <[email protected]>
Co-authored-by: Runar Jordahl <[email protected]>
Co-authored-by: gioboa <[email protected]>
Co-authored-by: Kaushik080 <[email protected]>
Co-authored-by: Yoav Ganbar <[email protected]>
Co-authored-by: yale.yu <[email protected]>
Co-authored-by: Yale <[email protected]>
Co-authored-by: Bonny87 <[email protected]>
Co-authored-by: D <[email protected]>
Co-authored-by: PatrickJS <[email protected]>
Co-authored-by: Maïeul <[email protected]>
Co-authored-by: Ian Létourneau <[email protected]>
Co-authored-by: Roman Zanettin <[email protected]>
Co-authored-by: Wout Mertens <[email protected]>
Co-authored-by: Manu MA <[email protected]>
Co-authored-by: Jesse Zhang <[email protected]>
Co-authored-by: maieulchevalier <[email protected]>
Co-authored-by: Jack Shelton <[email protected]>
Co-authored-by: Erik Eng <[email protected]>
Co-authored-by: Steve Sewell <[email protected]>
Co-authored-by: Riccardo Perra <[email protected]>
Co-authored-by: Pasquale De Lucia <[email protected]>
Co-authored-by: Sidharth Mohanty <[email protected]>
Co-authored-by: Daniela Bonvini <[email protected]>
Co-authored-by: Shai Reznik <[email protected]>
Co-authored-by: Lucas Stahl <[email protected]>
Co-authored-by: John Prem Kumar S <[email protected]>
Co-authored-by: Thomas Deinhamer <[email protected]>
Co-authored-by: Harish Krishnan <[email protected]>
Co-authored-by: Juer Genie Whang <[email protected]>
Co-authored-by: Juer Genie Whang <[email protected]>
Co-authored-by: wangyipeng <[email protected]>
Co-authored-by: Bjorn Lu <[email protected]>
Co-authored-by: Arjun <[email protected]>
Co-authored-by: Bendegúz Hajnal <[email protected]>
Co-authored-by: ulic75 <[email protected]>
Co-authored-by: Youssef Adbib <[email protected]>
Co-authored-by: Necati <[email protected]>
Co-authored-by: Leo <[email protected]>
Co-authored-by: mulztob <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP: qwik-city WAITING FOR: team Waiting for one of the core team members to review and reply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants