feat: update extended client:visible to use an object instead of a string#9596
Merged
Princesseuh merged 6 commits intomainfrom Jan 4, 2024
Merged
feat: update extended client:visible to use an object instead of a string#9596Princesseuh merged 6 commits intomainfrom
Princesseuh merged 6 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 8cbb65d The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
⚖️ Bundle Size CheckLatest commit: 8cbb65d
|
natemoo-re
reviewed
Jan 3, 2024
Member
natemoo-re
left a comment
There was a problem hiding this comment.
Looks good! Can we add a test that these arguments are properly encoded in the HTML?
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Princesseuh
commented
Jan 3, 2024
natemoo-re
approved these changes
Jan 3, 2024
packages/astro/e2e/fixtures/custom-client-directives/client-options.js
Outdated
Show resolved
Hide resolved
natemoo-re
reviewed
Jan 3, 2024
| const ioOptions = { | ||
| rootMargin: typeof options.value === 'string' ? options.value : undefined, | ||
| const rawOptions = | ||
| typeof options.value === 'object' ? (options.value as ClientVisibleOptions) : undefined; |
Member
There was a problem hiding this comment.
Final nit: this technically adds support for all IntersectionObserverInit values, but our types are narrowed to only support Pick<IntersectionObserverInit, 'rootMargin'>. Is that desired?
Member
Author
There was a problem hiding this comment.
It doesn't, see the code below
Merged
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.
Changes
Revert #9363 and redo it using an object instead of a string, that way it can supports options we'll add in the future.
Testing
Tested manually, like the original PR.
Docs
Will update docs!