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: inline component transforms #229

Merged
merged 3 commits into from
Jan 25, 2025
Merged

fix: inline component transforms #229

merged 3 commits into from
Jan 25, 2025

Conversation

thejackshelton
Copy link
Member

fixes #228

Copy link

changeset-bot bot commented Jan 24, 2025

🦋 Changeset detected

Latest commit: 292c849

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

This PR includes changesets to release 1 package
Name Type
@qwikdev/astro 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 Jan 24, 2025

Open in Stackblitz

npm i https://pkg.pr.new/QwikDev/astro/@qwikdev/create-astro@229
npm i https://pkg.pr.new/QwikDev/astro/@qwikdev/astro@229

commit: 292c849

@Shane-Donlon
Copy link

Hey Jack,
Seems like a much more elegant solution than my proposal and from what I've tested this has resolved the issue.
But I'll defer to the Dev that logged the issue to confirm.

While we're here - what do you think about the below check function?
Just putting it out there as an idea.

Proposed updated code:

async function check(this: RendererContext, component: unknown) {
  try {
    const isComponent =  isQwikComponent(component);
    if(!isComponent) {
      throw new Error("Component is not a Qwik component");
    }
    return isComponent;
  } catch (error) {
    console.error("Error in check function of @qwikdev/astro: ", error);
    return false;
  }
}

Terminal Output:

Error in check function of @qwikdev/astro:  Error: Component is not a Qwik component

Open to feedback on this Change as I understand that you may not want a full error to be thrown, and could just console.error instead?

@thejackshelton
Copy link
Member Author

We don't want to throw an error because the checked component may belong to another renderer, we're just seeing if it belongs to the Qwik renderer.

@thejackshelton thejackshelton merged commit 0ee52c4 into main Jan 25, 2025
32 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.

[🐞] Confusing NoMatchingRenderer failure with some components crossing Astro/Qwik component boundary
2 participants