Skip to content

Conversation

LK
Copy link

@LK LK commented Aug 22, 2025

No description provided.

Copy link
Owner

@theacodes theacodes left a comment

Choose a reason for hiding this comment

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

Looks mostly good with one small comment!

return;
}

await this.#setup_project(
Copy link
Owner

Choose a reason for hiding this comment

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

instead of three separate invocations of await this.#setup_project, have the preceding code construct a vfs and then have the last statement be:

return await #this.setup_project(vfs);

Copy link
Author

Choose a reason for hiding this comment

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

good call, done!

continue;
}

let filename = src_elm.name?.trim();

Choose a reason for hiding this comment

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

Because querySelectorAll is used, the custom element property is not reliably accessible and may return undefined at runtime. To address this problem, getAttribute should be used on the returned element.

I've changed this to src_elm.getAttribute('name')?.trim() in my local copy to resolve the issue.

Copy link
Owner

Choose a reason for hiding this comment

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

Interesting - I'm wondering if this is executing before the element has finished being registered?


let filename = src_elm.name?.trim();
if (!filename || filename.length == 0) {
const type = (src_elm.type ?? "schematic").toLowerCase();

Choose a reason for hiding this comment

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

Similarly to the comment above I've changed this to src_elm.getAttribute('type') in my local copy to resolve the issue.

Copy link

@ceoloide ceoloide left a comment

Choose a reason for hiding this comment

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

I've tested this change as it's useful for my own project, and found that at runtime the code won't have the name and type custom properties reliably available when accessing elements through querySelectorAll. To address the problem it is recommended to use getAttribute to access the two custom attributes.

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