feat(core): add non-QRL API aliases#8690
Draft
thejackshelton wants to merge 1 commit into
Draft
Conversation
🦋 Changeset detectedLatest commit: 348b507 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
2e2cdd8 to
a562356
Compare
a562356 to
5f82b65
Compare
@qwik.dev/core
@qwik.dev/router
eslint-plugin-qwik
create-qwik
@qwik.dev/optimizer
commit: |
5f82b65 to
348b507
Compare
Contributor
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
This file contains hidden or 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
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.
Why
This adds markerless API entry points so users can write the major callback APIs without the QRL suffix or JSX event marker, while existing QRL-based usage continues to work.
The design is intentionally compatibility-first: these new APIs accept already-created QRLs as well as plain functions. That gives us the runtime/type surface needed for the markerless AI inferred compiler approach, where a future compiler pass can auto-inject QRL wrappers before the Qwik optimizer runs.
What changed
component(),useTask(),useComputed(),useResource(),useSerializer(),useStyles(),useVisibleTask(), and related callback APIs.onClickcan lower likeonClick$when a QRL is supplied.onClick={$(() => {})}, proving the compiler-backed path works.Testing
pnpm build.fullpnpm vitest run packages/qwik/src/core/shared/jsx/types/jsx-types.unit.tsx packages/qwik/src/core/shared/utils/event-names.unit.ts packages/qwik/src/core/use/use-computed.unit.ts packages/qwik/src/core/use/use-task.unit.ts packages/qwik-router/src/runtime/src/use-functions.unit.ts packages/qwik-react/src/react/qwik-react-aliases.unit.tsxpnpm playwright test e2e/qwik-e2e/tests/events.e2e.ts -g "qrl handler passed to no-dollar event" --browser=chromium --config e2e/qwik-e2e/playwright.config.ts --workers=1 --max-failures=1INSTA_UPDATE=always cargo test --libcargo test example_2 -- --nocapture