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: filter data that the suffix is serverQrl_rpc #7441

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

Conversation

JerryWu1234
Copy link
Contributor

@JerryWu1234 JerryWu1234 commented Mar 20, 2025

What is it?

fixes #7313

By looking at the symbol name you can see if it's a server qrl,

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

@JerryWu1234 JerryWu1234 requested a review from a team as a code owner March 20, 2025 07:19
Copy link

changeset-bot bot commented Mar 20, 2025

⚠️ No Changeset found

Latest commit: a53fa4b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@JerryWu1234
Copy link
Contributor Author

@wmertens it's my first time trying to implement this
Maybe it won't fully meet your goal. let me know if there are anything else I should improve

Copy link

pkg-pr-new bot commented Mar 20, 2025

Open in Stackblitz

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

commit: a53fa4b

Copy link
Contributor

github-actions bot commented Mar 20, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

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

@JerryWu1234 JerryWu1234 self-assigned this Mar 24, 2025
@@ -798,7 +783,30 @@ export function createQwikPlugin(optimizerOptions: OptimizerOptions = {}) {
return manifest;
};

return { addInjection, generateManifest };
const collectServerRpcAndCtxKindSymbols = async () => {
Copy link
Member

Choose a reason for hiding this comment

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

let's rename this to collectPublicAPI

@@ -998,6 +1006,7 @@ export const SSR_OUT_DIR = 'server';
const LIB_OUT_DIR = 'lib';

export const Q_MANIFEST_FILENAME = 'q-manifest.json';
export const Q_SERVER_RPC_CTX_KIND_SYMBOLS_FILENAME = 'q-server-rpc-ctx-kind-symbols.json';
Copy link
Member

Choose a reason for hiding this comment

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

let's call this q-public-api.json

@wmertens
Copy link
Member

Good start, now we need to read this file in qwik-city and only allow known symbols.

Then we should also create a public-api.md in the source root that looks like

# Public endpoints

## `server$`

- `/xyz123`:
  - parameters: foo, bar
  - scope: myContext

## `formAction$`

...

the dev can then check this in and will know when the API changes.

@JerryWu1234 JerryWu1234 marked this pull request as draft March 27, 2025 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

[🐞] qwik-city doesn't check if server$ calls are server$
2 participants