Permit hydrating on custom node
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
We've struggled for some time with the challenge of embedding sveltekit "interactives" within the React ecosystem of The New York Times. This is of particular issue on our homepage (https://www.nytimes.com/) where svelte-kit apps are embedded like so many raisins in the pudding, and mounting them to the wrong node can blow out the rest of the page DOM.
There's a fair amount of fancy-footwork going on on the homepage, so we don't always have control over where scripts are mounted on the page (they are sometimes moved around for various performance reasons).
There have been some solutions— via https://github.com/sveltejs/kit/issues/4685 and https://github.com/sveltejs/kit/issues/4685 —which have worked in the past, but unfortunately, those solutions are no longer in more recent vintages of sveltekit. (I believe that the data attribute in question has moved on?)
We're currently stuck in an older vintage of sveltekit , because of this, which is a shame, as there are a number of new features we'd like to take advantage of!
Describe the proposed solution
We'd like to figure out a durable solution for the use-case above; it appears possible that we can update this ourselves via the suggestion here but have had some trouble making that work. A pointer in the right direction, if that's the appropriate avenue, would be helpful!
Alternatives considered
No response
Importance
i cannot use SvelteKit without it
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the prior discussion in sveltejs/kit#4685, especially the referenced comment about the moved data attribute, and compare it with current hydration behavior. Done means a durable, documented way to hydrate an embedded SvelteKit app on a custom node without mounting to the wrong DOM node.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100