-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(types): more precision #5531
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for qwik-insights canceled.
|
wmertens
force-pushed
the
types-refinements
branch
4 times, most recently
from
December 6, 2023 19:12
b27462a
to
e1a0e21
Compare
wmertens
force-pushed
the
types-refinements
branch
from
December 6, 2023 19:15
e1a0e21
to
88f72ae
Compare
Specifics: - piggyback on TS HTML types as much as possible (now automatically supports new props like popover) - Remove QwikEvents and SyntheticEvents, they are really just DOM events - improve QRL and QRLInternal types for better matching - useOn* now can infer type and the passed element is also typed - move the QRL AbortSignal to server$, the only place where it's supported - generic parameter to useDocumentHead for the frontmatter - DOM ref={} functions get the type of the element Generic: - add some tests for the types - use `unknown` or actual type instead of `any` where possible - if not used as part of an `extends` test, it's probably ok to change `any` to `unknown`. It will surface type mismatches. - fix function signatures so they can match extends ( `(...args: any) => any` instead of `(...args: any[]) => any` - change some interfaces to types if they're not meant to be merge-extended and they're not extending (interfaces have a performance advantage there) - add jsdoc comments Actual code changes: - In use-task.ts, allow `track(signal)` inside a task - in docs, remove useless filtering from class array - changed some hardcoded strings to constants
for some reason it is not visible unless it's a dev dependency
wmertens
force-pushed
the
types-refinements
branch
from
December 6, 2023 19:49
88f72ae
to
357dd2c
Compare
mhevery
approved these changes
Dec 6, 2023
🤯 what a great work. you rock |
kodiakhq bot
referenced
this pull request
in ascorbic/unpic-img
Dec 10, 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/tree/HEAD/packages/qwik)) | [`1.2.19` -> `1.3.0`](https://renovatebot.com/diffs/npm/@builder.io%2fqwik/1.2.19/1.3.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@builder.io%2fqwik/1.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@builder.io%2fqwik/1.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@builder.io%2fqwik/1.2.19/1.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@builder.io%2fqwik/1.2.19/1.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>BuilderIO/qwik (@​builder.io/qwik)</summary> ### [`v1.3.0`](https://togithub.com/BuilderIO/qwik/releases/tag/v1.3.0) [Compare Source](https://togithub.com/BuilderIO/qwik/compare/v1.2.19...v1.3.0) #### Breaking Changes - When passing a `Signal` into `track()` directly (instead of passing a function), it returns the signal value instead of the signal itself. This behavior was already present when running inside a `useResource$` callback, and now it is consistent across all Tasks. #### What's Changed - chore: Vite 5 by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5451](https://togithub.com/BuilderIO/qwik/pull/5451) - feat: add qwik/no-use-visible-task eslint rule by [@​gioboa](https://togithub.com/gioboa) in [https://github.com/BuilderIO/qwik/pull/5455](https://togithub.com/BuilderIO/qwik/pull/5455) - chore(insights): remove unnecessary log by [@​gioboa](https://togithub.com/gioboa) in [https://github.com/BuilderIO/qwik/pull/5461](https://togithub.com/BuilderIO/qwik/pull/5461) - fix: add example context to docs by [@​dotarjun](https://togithub.com/dotarjun) in [https://github.com/BuilderIO/qwik/pull/5467](https://togithub.com/BuilderIO/qwik/pull/5467) - feat(qwik-city): allow customizing SVGO options of image plugin by [@​hbendev](https://togithub.com/hbendev) in [https://github.com/BuilderIO/qwik/pull/5407](https://togithub.com/BuilderIO/qwik/pull/5407) - docs: fix typo by [@​ulic75](https://togithub.com/ulic75) in [https://github.com/BuilderIO/qwik/pull/5472](https://togithub.com/BuilderIO/qwik/pull/5472) - docs: fix typo by [@​Adbib](https://togithub.com/Adbib) in [https://github.com/BuilderIO/qwik/pull/5481](https://togithub.com/BuilderIO/qwik/pull/5481) - fix(core): Support JSX in signals by [@​mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5442](https://togithub.com/BuilderIO/qwik/pull/5442) - docs(FAQ): - lazy-loading on user interaction & speculative module fetching by [@​maiieul](https://togithub.com/maiieul) in [https://github.com/BuilderIO/qwik/pull/5488](https://togithub.com/BuilderIO/qwik/pull/5488) - docs(faq): add link to typescript by [@​maiieul](https://togithub.com/maiieul) in [https://github.com/BuilderIO/qwik/pull/5487](https://togithub.com/BuilderIO/qwik/pull/5487) - fix: disable Vite modulepreload by [@​gioboa](https://togithub.com/gioboa) in [https://github.com/BuilderIO/qwik/pull/5493](https://togithub.com/BuilderIO/qwik/pull/5493) - docs(faq): fix typos and improve the wording of some sentences by [@​maiieul](https://togithub.com/maiieul) in [https://github.com/BuilderIO/qwik/pull/5490](https://togithub.com/BuilderIO/qwik/pull/5490) - docs: make the distinction between module-prefetching and <Link prefetch> by [@​maiieul](https://togithub.com/maiieul) in [https://github.com/BuilderIO/qwik/pull/5485](https://togithub.com/BuilderIO/qwik/pull/5485) - docs(showcase): add `index.app` and `wiza.co` by [@​necatikcl](https://togithub.com/necatikcl) in [https://github.com/BuilderIO/qwik/pull/5484](https://togithub.com/BuilderIO/qwik/pull/5484) - fix(docs): mdx interpreting title as component by [@​maiieul](https://togithub.com/maiieul) in [https://github.com/BuilderIO/qwik/pull/5499](https://togithub.com/BuilderIO/qwik/pull/5499) - docs(/faq#vdom): cleanup the vdom section by [@​maiieul](https://togithub.com/maiieul) in [https://github.com/BuilderIO/qwik/pull/5500](https://togithub.com/BuilderIO/qwik/pull/5500) - fix: revert "fix: remove cf pages stream polyfill" by [@​gioboa](https://togithub.com/gioboa) in [https://github.com/BuilderIO/qwik/pull/5502](https://togithub.com/BuilderIO/qwik/pull/5502) - fix(qwik-city): prefix ids of SVGs based on their path when loaded as qwik nodes by [@​hbendev](https://togithub.com/hbendev) in [https://github.com/BuilderIO/qwik/pull/5497](https://togithub.com/BuilderIO/qwik/pull/5497) - fix: cf pages polyfill only if needed by [@​mpeg](https://togithub.com/mpeg) in [https://github.com/BuilderIO/qwik/pull/5507](https://togithub.com/BuilderIO/qwik/pull/5507) - refactor(core): extract Group type by [@​wtlin1228](https://togithub.com/wtlin1228) in [https://github.com/BuilderIO/qwik/pull/4798](https://togithub.com/BuilderIO/qwik/pull/4798) - docs: add QwikCityMockProvider explanation by [@​mulztob](https://togithub.com/mulztob) in [https://github.com/BuilderIO/qwik/pull/5505](https://togithub.com/BuilderIO/qwik/pull/5505) - docs(glob-import): add documentation for import.meta.glob by [@​maiieul](https://togithub.com/maiieul) in [https://github.com/BuilderIO/qwik/pull/5504](https://togithub.com/BuilderIO/qwik/pull/5504) - fix: CF pages polyfill also when shimmed by [@​mpeg](https://togithub.com/mpeg) in [https://github.com/BuilderIO/qwik/pull/5512](https://togithub.com/BuilderIO/qwik/pull/5512) - fix(qwik): handle cypress dev server path by [@​dmitry-stepanenko](https://togithub.com/dmitry-stepanenko) in [https://github.com/BuilderIO/qwik/pull/5509](https://togithub.com/BuilderIO/qwik/pull/5509) - chore(cf): Fix CloudFlare build failure by [@​mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5524](https://togithub.com/BuilderIO/qwik/pull/5524) - docs: removed defunct sites by [@​mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5528](https://togithub.com/BuilderIO/qwik/pull/5528) - chore(netlify): fix netlify failure by [@​mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5527](https://togithub.com/BuilderIO/qwik/pull/5527) - docs(showcase): add juneikerc.com - blog \[prismic cms] and personal website by [@​juneikerc](https://togithub.com/juneikerc) in [https://github.com/BuilderIO/qwik/pull/5523](https://togithub.com/BuilderIO/qwik/pull/5523) - fix(localization-starter): update docs and add script by [@​tzdesign](https://togithub.com/tzdesign) in [https://github.com/BuilderIO/qwik/pull/5494](https://togithub.com/BuilderIO/qwik/pull/5494) - chore(qwik-city): bump vite-imagetools ^5 -> ^6 by [@​birkskyum](https://togithub.com/birkskyum) in [https://github.com/BuilderIO/qwik/pull/5525](https://togithub.com/BuilderIO/qwik/pull/5525) - feat(insights): polish UI by [@​zanettin](https://togithub.com/zanettin) in [https://github.com/BuilderIO/qwik/pull/5503](https://togithub.com/BuilderIO/qwik/pull/5503) - chore: update .nvmrc by [@​gioboa](https://togithub.com/gioboa) in [https://github.com/BuilderIO/qwik/pull/5530](https://togithub.com/BuilderIO/qwik/pull/5530) - feat(insight): Add user auth to only see your app data. by [@​mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5517](https://togithub.com/BuilderIO/qwik/pull/5517) - chore(ci): set up CI for insights and docs by [@​mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5533](https://togithub.com/BuilderIO/qwik/pull/5533) - refactor(types): more precision by [@​wmertens](https://togithub.com/wmertens) in [https://github.com/BuilderIO/qwik/pull/5531](https://togithub.com/BuilderIO/qwik/pull/5531) - chore: 1.3.0 by [@​mhevery](https://togithub.com/mhevery) in [https://github.com/BuilderIO/qwik/pull/5535](https://togithub.com/BuilderIO/qwik/pull/5535) #### New Contributors - [@​dotarjun](https://togithub.com/dotarjun) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5467](https://togithub.com/BuilderIO/qwik/pull/5467) - [@​Adbib](https://togithub.com/Adbib) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5481](https://togithub.com/BuilderIO/qwik/pull/5481) - [@​mulztob](https://togithub.com/mulztob) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5505](https://togithub.com/BuilderIO/qwik/pull/5505) - [@​juneikerc](https://togithub.com/juneikerc) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5523](https://togithub.com/BuilderIO/qwik/pull/5523) - [@​birkskyum](https://togithub.com/birkskyum) made their first contribution in [https://github.com/BuilderIO/qwik/pull/5525](https://togithub.com/BuilderIO/qwik/pull/5525) **Full Changelog**: QwikDev/qwik@v1.2.19...v1.3.0 </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:eyJjcmVhdGVkSW5WZXIiOiIzNy44Ny4yIiwidXBkYXRlZEluVmVyIjoiMzcuODcuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Specifics:
Generic:
unknown
or actual type instead ofany
where possibleextends
test, it's probably ok to changeany
tounknown
. It will surface type mismatches.(...args: any) => any
instead of(...args: any[]) => any
Actual code changes:
track(signal)
inside a task