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(v2): fix streaming tests #6553

Merged
merged 4 commits into from
Jun 16, 2024

Conversation

Varixo
Copy link
Member

@Varixo Varixo commented Jun 15, 2024

this PR fixes the streaming tests + some refactoring

Co-authored-by: Shai Reznik <shairez@users.noreply.github.com>
Co-authored-by: Igal Klebanov <igalklebanov@gmail.com>
Co-authored-by: Naor Peled <me@naor.dev>
@Varixo Varixo requested a review from a team as a code owner June 15, 2024 19:20
@@ -1019,14 +1025,12 @@ class SSRContainer extends _SharedContainer implements ISSRContainer {
const frame: ContainerElementFrame = {
tagNesting: tagNesting,
parent: this.currentElementFrame,
elementName: tag,
elementName: elementName,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
elementName: elementName,
elementName,

remove waitForTimeout from test
Comment on lines 978 to 982
/**
* @param tag
* @param elementName
* @param depthFirstElementIdx
* @param isElement
*/
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 align with current function's arguments..

why do we even need this js docs block? seems to not add much.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah I will remove it

/** @param tag Returns true if `qDispatchEvent` needs patching */
function createNewElement(jsx: JSXNode, tag: string): boolean {
const element = createElementWithNamespace(tag);
/** @param elementName Returns true if `qDispatchEvent` needs patching */
Copy link
Member

@igalklebanov igalklebanov Jun 15, 2024

Choose a reason for hiding this comment

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

this is misleading.
the return value is only affected by jsx argument's constProps. am I missing something?
let's change it to something like this?

Suggested change
/** @param elementName Returns true if `qDispatchEvent` needs patching */
/**
* Returns whether `qDispatchEvent` needs patching. This is true when one of the `jsx` argument's const props has the name of an event.
* @returns {boolean}
*/

Copy link
Member Author

@Varixo Varixo Jun 16, 2024

Choose a reason for hiding this comment

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

This is because when we create an element we handle only the constProps. The varProps are handled later here needsQDispatchEventPatch = setBulkProps(vNode, jsxAttrs) || needsQDispatchEventPatch;

Copy link
Member

@igalklebanov igalklebanov Jun 16, 2024

Choose a reason for hiding this comment

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

Yeah, but the jsdoc is for function createNewElement(jsx: JSXNode, elementName: string): boolean {. In which needsQDispatchEventPatch is only set to true once - when isJsxPropertyAnEventName(key) is true.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I will change the description

@shairez
Copy link
Contributor

shairez commented Jun 16, 2024

@igalklebanov @Varixo please write a comment when this PR is ready to be merged, thanks!

@Varixo
Copy link
Member Author

Varixo commented Jun 16, 2024

@igalklebanov @Varixo please write a comment when this PR is ready to be merged, thanks!

For me it is ready

@igalklebanov
Copy link
Member

@igalklebanov @Varixo please write a comment when this PR is ready to be merged, thanks!

Yalla let's go! 🚀

@shairez shairez merged commit 164f103 into QwikDev:build/v2 Jun 16, 2024
18 checks passed
@Varixo Varixo deleted the build/v2-streaming-test-fixes branch June 16, 2024 15:42
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.

3 participants