fix(mock-doc): implement part API#6423
Merged
johnjenkins merged 4 commits intostenciljs:mainfrom Oct 14, 2025
Merged
Conversation
johnjenkins
reviewed
Oct 14, 2025
Contributor
johnjenkins
left a comment
There was a problem hiding this comment.
hey @ritoban23 - TYSM for looking at this!
319d30b to
c61c67d
Compare
johnjenkins
reviewed
Oct 14, 2025
Contributor
johnjenkins
left a comment
There was a problem hiding this comment.
LGTM - just need to run npm run lint --fix 🙏
johnjenkins
approved these changes
Oct 14, 2025
Contributor
|
@ritoban23 and now |
part API
Contributor
Author
|
@johnjenkins was wondering if i can get a |
hyyan
added a commit
to hyyan/core
that referenced
this pull request
Feb 23, 2026
The `part` getter added in stenciljs#6423 had no setter, causing `setAccessor` to overwrite it on custom elements instead of setting the attribute.
3 tasks
github-merge-queue bot
pushed a commit
that referenced
this pull request
Feb 23, 2026
The `part` getter added in #6423 had no setter, causing `setAccessor` to overwrite it on custom elements instead of setting the attribute.
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.
What is the current behavior?
The
partDOM API is missing from Stencil's MockDoc. Runningthis.element.part.add('something')throws "Cannot read properties of undefined (reading 'add')".GitHub Issue Number: #6420
What is the new behavior?
Implemented the
partproperty on MockElement, returning a DOMTokenList that manages thepartattribute. Mirrors the existingclassListAPI but operates on thepartattribute.Documentation
Does this introduce a breaking change?
Testing
Added comprehensive test suite (
part-list.spec.ts) covering add, remove, contains, toggle, validation, and integration with thepartattribute.Other information
Files:
src/mock-doc/part-list.ts,src/mock-doc/node.ts,src/mock-doc/test/part-list.spec.tsBefore:
this.element.part.add('something')→ ErrorAfter:
this.element.part.add('something')→ Works