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

Fix for #12: Ensure original named slot tags are retained when not using shadow root. #13

Merged

Conversation

patricknelson
Copy link
Contributor

@patricknelson patricknelson commented Jun 2, 2023

Fix for #12.

Ensure original named slot tags are retained when not using shadow root. Only "unwrap" (i.e. from the host tag) when in the default slot. This PR isn't as significant as it looks since it's only altering a single line, the rest is whitespace: https://github.com/crisward/svelte-tag/pull/13/files#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346L98-R98

That said, I'm doing a few other minor things in the PR (making it easier to contribute):

  1. Including ignore of .idea/ files (JetBrains specific)
  2. Enforcing repo-specific whitespace rules (differs from my specific IDE settings). My IDE is also configured to trim trailing whitespace (not in .editorconfig), hope this is ok.

…ing shadow root. Only "unwrap" (i.e. from the host tag) when in the default slot. Including ignore of .idea/ files (JetBrains) and enforcing repo-specific whitespace rules (differs from my specific IDE settings)
slots[n.slot] = this.unwrap(n)
slots[n.slot] = n
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the primary change, the rest is whitespace (or unit test updates).

@patricknelson
Copy link
Contributor Author

patricknelson commented Jun 2, 2023

p.s. @crisward I cannot run the unit tests on my machine (WSL2 on Win10). Can you double check these for me really quick and let me know?

Edit: Oops, never mind, I see you've got actions enabled. 😅 Just validated on Github: https://github.com/patricknelson/svelte-tag/actions/runs/5151576479/jobs/9276874029?pr=1

@patricknelson
Copy link
Contributor Author

patricknelson commented Jun 2, 2023

Some additional discussion here (just the PR I'm using for unit tests): patricknelson/svelte-retag#1

@crisward crisward merged commit af48491 into crisward:master Jun 3, 2023
1 check passed
@patricknelson patricknelson deleted the issue-12-dont-unwrap-named-slots branch June 3, 2023 20:56
patricknelson referenced this pull request Jun 3, 2023
patricknelson referenced this pull request in patricknelson/svelte-retag Jun 5, 2023
…en not using shadow root. Take 2 required to account for new unit testing framework (Vitest) from PR #13.
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.

None yet

2 participants