Repository navigation
Intent: report discarded explicit attributes - #137
Merged
Merged
Conversation
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.
Problem
Gutenberg could discard explicit intent attribute keys without telling the caller. The validity gate cannot recover that information from the resulting markup. Closes #129.
Solution
Compare supplied keys with the attributes on the block returned by the native constructor, during the existing walk. Carry
intent-attribute-droppedwarnings through shared finalization, including block, key and exact input path, without raw values. Warnings remain informational in both modes.Diff
+110 / −25 across five files.
Testing & verification
Reviewed revision:
6ee50d0f144f08c4727b43e71a84e8c54ec6aee9· Environment: Node 24.18.0, macOS arm64.npx vitest run dev/test/intent.test.ts: 35 passed.npm run typecheckandgit diff --check: passed.textAlignandmadeUp, throughnode --import tsx src/bin.ts assemble /tmp/br129-intent.json --jsonand--out /tmp/br129-output.html: successful output, two warnings, category visible in both JSON and text, exact paths in JSON.Not verified: destination-theme values or rendering. Nested style values remain open; this reports discarded top-level attrs keys, not design fidelity.
Risk / rollout
Consumers may see new warnings for already ignored input. Successful output and strict-mode policy remain unchanged; there is no attribute allowlist or recursive style validation.
Detection: warning count, path and positive-control regressions. Rollback: revert this PR to remove the new diagnostics.