Repository navigation
fix(html): a condition on a list or an object no longer fails the who… - #1076
Merged
Merged
Conversation
…le HTML export
0.43.71 resolves a condition on a state against the value it starts with, so a
download shows what a visitor sees on first load. A list or an object cannot be
written into the comparison that check builds, and the error was thrown outside
its guard: one "cart is not empty" in a project made the HTML export of the
whole project fail ("Conditional node received an operand of type object").
0.43.70 rendered nothing for a state condition and exported.
- The collection operations (isEmpty, isNotEmpty, lengthEquals,
lengthGreaterThan, lengthLessThan, contains, notContains, hasKey, notHasKey)
are answered on the value itself, with the meaning node-to-html and
node-to-jsx give them. "Is not empty" was also read as "is not" by the unary
fallback, for texts and props too.
- A condition the check cannot answer (a list compared with ===, an operand
that is another value of the page) renders nothing, as before 0.43.71, and
the export goes on.
Tests: two in project-generator-html/__tests__/conditionals; both fail on
0.43.71 with the error above. Whole suite: 526 suites, 6024 tests.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…le HTML export
0.43.71 resolves a condition on a state against the value it starts with, so a download shows what a visitor sees on first load. A list or an object cannot be written into the comparison that check builds, and the error was thrown outside its guard: one "cart is not empty" in a project made the HTML export of the whole project fail ("Conditional node received an operand of type object"). 0.43.70 rendered nothing for a state condition and exported.
Tests: two in project-generator-html/tests/conditionals; both fail on
0.43.71 with the error above. Whole suite: 526 suites, 6024 tests.