-
Notifications
You must be signed in to change notification settings - Fork 1
Example branch 2 #2
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,7 @@ | |||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| export class PulsDOMAdapter extends PulsAdapter<Node[]>{ | ||||||||||||||||||
| controlFlows: boolean[][] = [] | ||||||||||||||||||
| controlFlows: boolean[] = [] | ||||||||||||||||||
| currentControlFlow: number = 0 | ||||||||||||||||||
|
|
||||||||||||||||||
| documentOverride: Document|null = null | ||||||||||||||||||
|
|
@@ -159,13 +159,11 @@ | |||||||||||||||||
| } as ValueTransformer<ChildNode>, | ||||||||||||||||||
| { | ||||||||||||||||||
| type: 'placeholder', | ||||||||||||||||||
| test: (value: any) => value === null || value === undefined, | ||||||||||||||||||
| create: (value: any) => { | ||||||||||||||||||
| return [this.document.createComment('placeholder')] | ||||||||||||||||||
| }, | ||||||||||||||||||
| test: (value: any) => value === null, | ||||||||||||||||||
| create: (value: any) => return [this.document.createComment('placeholder')], | ||||||||||||||||||
|
Check failure on line 163 in packages/puls-dom-adapter/src/PulsDOMAdapter.ts
|
||||||||||||||||||
| set: (el, value: any) => {} | ||||||||||||||||||
|
Check failure on line 164 in packages/puls-dom-adapter/src/PulsDOMAdapter.ts
|
||||||||||||||||||
|
Comment on lines
+162
to
164
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix syntax error in placeholder transformer. The Apply this diff to fix the syntax: - create: (value: any) => return [this.document.createComment('placeholder')],
+ create: (value: any) => {
+ return [this.document.createComment('placeholder')]
+ },📝 Committable suggestion
Suggested change
🧰 Tools🪛 Biome (1.9.4)[error] 163-163: Expected a function body, or an expression but instead found 'return'. Expected a function body, or an expression here. (parse) [error] 163-163: expected Remove [ (parse) 🪛 GitHub Check: build (20)[failure] 163-163: [failure] 164-164: [failure] 163-163: [failure] 164-164: [failure] 164-164: 🪛 GitHub Actions: Run tests[error] 163-163: TS2695: Left side of comma operator is unused and has no side effects. [error] 164-164: TS2552: Cannot find name 'set'. Did you mean 'Set'? [error] 164-164: TS7006: Parameter 'el' implicitly has an 'any' type. [error] 163-163: TS1005: '{' expected. [error] 164-164: TS1005: ';' expected. 🪛 GitHub Actions: Test the build process[error] 163-163: error TS1005: '{' expected. |
||||||||||||||||||
| } as ValueTransformer<ChildNode>, | ||||||||||||||||||
|
Check failure on line 165 in packages/puls-dom-adapter/src/PulsDOMAdapter.ts
|
||||||||||||||||||
| { | ||||||||||||||||||
| type: 'promise', | ||||||||||||||||||
| test: (value: any) => typeof value === 'object' && value instanceof Promise, | ||||||||||||||||||
| create: (value: Promise<any>) => { | ||||||||||||||||||
|
|
@@ -235,7 +233,7 @@ | |||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| setAttribute(el: Element|undefined, key: string, value: any, parserTag: ParserTag): Node[]|undefined { | ||||||||||||||||||
| if (key === ':if' || key === ':else-if' || key === ':else') { | ||||||||||||||||||
| if (key === ':if' || key === 'else-if' || key === ':else') { | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix condition check for else-if. The condition check for Apply this diff to fix the condition: - if (key === ':if' || key === 'else-if' || key === ':else') {
+ if (key === ':if' || key === ':else-if' || key === ':else') {📝 Committable suggestion
Suggested change
|
||||||||||||||||||
| return this.setConditionFlowAttribute(key, value, parserTag) | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -266,7 +264,7 @@ | |||||||||||||||||
| return | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| if (key.startsWith('@')) { | ||||||||||||||||||
| if (key.startsWith('@.')) { | ||||||||||||||||||
| const eventParts = key.substring(1).split('.') | ||||||||||||||||||
| const eventName = eventParts.shift()! | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -322,19 +320,14 @@ | |||||||||||||||||
| for (const [key, val] of attributes) { | ||||||||||||||||||
| const overrideEl = this.setAttribute(el, key, val, value) | ||||||||||||||||||
| if (overrideEl) { | ||||||||||||||||||
| if (value.tag === 'svg') { | ||||||||||||||||||
| this.inSVG = false | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| return overrideEl | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| if (el instanceof Element) { | ||||||||||||||||||
| for (const bodyElement of value.body) { | ||||||||||||||||||
| this.addPart(bodyElement) | ||||||||||||||||||
| ?.forEach(e => this.appendChild(el, e)) | ||||||||||||||||||
| this.addPart(bodyElement).forEach(e => this.appendChild(el, e)) | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -362,7 +355,7 @@ | |||||||||||||||||
| el2.dispatchEvent(new CustomEvent(':attach', {detail: {el: el2}})) | ||||||||||||||||||
| el1.dispatchEvent(new CustomEvent(':replace_with', { detail: { from: [el1], to: [el2] } })) | ||||||||||||||||||
| el1.replaceWith(el2); | ||||||||||||||||||
| el1.dispatchEvent(new CustomEvent(':replaced_with', { detail: { from: [el1], to: [el2] } })) | ||||||||||||||||||
| el1.dispatchEvent(new CustomEvent(':replaced_with', { detail: { from: [el1], to: el2 } })) | ||||||||||||||||||
| el1.dispatchEvent(new CustomEvent(':detached', {detail: {el: el1}})) | ||||||||||||||||||
| el2.dispatchEvent(new CustomEvent(':attached', {detail: {el: el2}})) | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
@@ -377,7 +370,7 @@ | |||||||||||||||||
| if (elements.length === 0) elements.push(this.document.createComment('hook element')) | ||||||||||||||||||
| this.afterElements(firstEl, elements) | ||||||||||||||||||
|
|
||||||||||||||||||
| firstEl.dispatchEvent(new CustomEvent(':replaced_with', { detail: { from: oldEls, to: elements } })) | ||||||||||||||||||
| dispatchEvent(new CustomEvent(':replaced_with', { detail: { from: oldEls, to: elements } })) | ||||||||||||||||||
| this.removeElement(firstEl) | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -403,7 +396,7 @@ | |||||||||||||||||
| const handleReplaceWith = ({ detail: { from, to } }: any) => { | ||||||||||||||||||
| if (from.includes(e)) { | ||||||||||||||||||
| e.removeEventListener(':replaced_with', handleReplaceWith); | ||||||||||||||||||
| e.removeEventListener(':detach', handleDetach); | ||||||||||||||||||
| e.removeEventListener(':dettach', handleDetach); | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix typo in event name. There's a typo in the event name Apply this diff to fix the typo: - e.removeEventListener(':dettach', handleDetach);
+ e.removeEventListener(':detach', handleDetach);📝 Committable suggestion
Suggested change
|
||||||||||||||||||
| e.removeEventListener(':attach', handleAttach); | ||||||||||||||||||
| (to as ChildNode[]).forEach((innerEl): void => { | ||||||||||||||||||
| if (!from.includes(innerEl)) { | ||||||||||||||||||
|
|
@@ -440,7 +433,6 @@ | |||||||||||||||||
|
|
||||||||||||||||||
| addReplaceListener(e); | ||||||||||||||||||
| this.afterElement(el, e); | ||||||||||||||||||
| el = e; | ||||||||||||||||||
| }); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -450,7 +442,7 @@ | |||||||||||||||||
| el.dispatchEvent(new CustomEvent(':attached', {detail: {el}})) | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| render(): Node[] { | ||||||||||||||||||
| return this.parsed.map(p => this.addPart(p)).flat().filter(c => c) | ||||||||||||||||||
| render() { | ||||||||||||||||||
| return this.parsed.map(p => this.addParts(p)).flat().filter(c => c) | ||||||||||||||||||
|
||||||||||||||||||
| return this.parsed.map(p => this.addParts(p)).flat().filter(c => c) | |
| return this.parsed.map(p => this.addPart(p)).flat().filter(c => c) |
🧰 Tools
🪛 GitHub Actions: Run tests
[error] 446-446: TS2551: Property 'addParts' does not exist on type 'PulsDOMAdapter'. Did you mean 'addPart'?
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| #!/bin/sh | ||
| pnpm publish -r --tag beta | ||
| pnpm publish --tag beta |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the control flow type change.
The
controlFlowsproperty type has been changed fromboolean[][]toboolean[]. This change affects the logic insetConditionFlowAttributemethod where array operations are performed.🏁 Script executed:
Length of output: 886
Critical: Revisit
controlFlowsType Change LogicAfter verifying the usage of
controlFlowsinPulsDOMAdapter.ts, it appears that the change fromboolean[][]toboolean[]is causing a type mismatch. The methodsetConditionFlowAttributecontinues to use array operations onthis.controlFlows[this.currentControlFlow](i.e., calling.includes(true)and.push(value)), which implies that each element ofcontrolFlowsis expected to be an array rather than a simple boolean value.boolean[][]or update the logic insetConditionFlowAttribute(and any related methods) to correctly handle a one-dimensional array if that is the intended behavior.