Reliable component detection #217
thejackshelton
started this conversation in
External Library Ideas
Replies: 1 comment
-
This is a reasonable request. I think a better API may be something like this: getComponentType(fn: Function): 'QwikComponent'|'QwikInlineComponent'|'Unknown' It is unclear to me how one could tell react vs qwik inline component, since qwik is just a function (just like React) function QwikInlineComponent() {
return "some string";
}
// OR
function QwikInlineComponent() {
return callSomeHelperFunctionWhichReturnsJSX();
} In the above case, there would be no easy way for us to detect that is the case. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What is it about?
A way for tools to know whether something belongs to Qwik.
What's the motivation for this proposal?
RFC: Reliable Component Detection in Qwik
Problem Statement
In microfrontend and multi-framework environments, distinguishing Qwik inline components from other framework's JSX components is challenging and currently relies on brittle implementation details.
Current Issues:
_jsxS
,_jsxC
,_jsxQ
Proposed Solution / Feature
Proposed Solution
Add a reliable component detection API through optimizer annotations.
API Design
Benefits
Use Cases
Implementation Details
isComponent
helper reads these annotationscomponent$
componentsMigration Strategy
Existing applications using the JSX transform detection can gradually migrate to the new API when upgrading to the version that includes this feature.
Open Questions
Next Steps
isComponent
helperLinks / References
No response
Beta Was this translation helpful? Give feedback.
All reactions