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

Adds arrays to performance test templates. #285

Merged
merged 1 commit into from
Mar 7, 2025

Conversation

theengineear
Copy link
Collaborator

Only demo / test changes here — it’s not too hard to support this since most (all?) templating engines will accept a native array as input for a set of children.

// eslint-disable-next-line no-eval
return eval(`html\`<div data-id="p1" attr="\${attr}">
<div data-id="p2" data-foo one="\${one}" two="\${two}" three="\${three}" four="\${four}" five="\${five}" .six="\${six}" .seven="\${seven}" .eight="\${eight}" .nine="\${nine}" .ten="\${ten}">
<div data-id="p3" data-bar="bar">
<div data-id="\${id}" boolean ?hidden="\${hidden}" .title="\${title}">
\${content1} -- \${content2}
</div>
<ul data-id="list">
\${(items ?? []).map(item => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Easy peasy to test / compare performance of this stuff — we might as well.

@@ -1544,12 +1544,16 @@ describe('errors coverage', () => {
assertThrows(callback, expectedMessage, { startsWith: true });
});

//////////////////////////////////////////////////////////////////////////////
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Missed adding these error-code-block delimiters to the parser tests before. Sneaking them in.

Only demo / test changes here — it’s not too hard to support this since
most (all?) templating engines will accept a native _array_ as input for
a set of children.
@theengineear theengineear force-pushed the add-arrays-to-performance-test branch from 310423d to fe9585f Compare March 6, 2025 23:59
@theengineear theengineear merged commit bae7dab into main Mar 7, 2025
1 check passed
@theengineear theengineear deleted the add-arrays-to-performance-test branch March 7, 2025 00:00
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.

1 participant