Comments (5)
There's been a very long-standing issue about people wanting to be able to attach (primarily) classes to the <body>
, which we've put off because of a lack of a way to return those in SSR. Do we want to think about an API for that while naming this? If we do add that feature, would we be able to get away with not calling it a breaking change? It sounds tricky to wriggle out of that one, because there would be a new returned string that people directly consuming the SSR version of a component would have to do something with.
from svelte.
Good question. I think it'd be fine to do it in a minor — even though you can technically do <svelte:body class="blah" />
, no-one would since it doesn't do anything today.
Perhaps an API like this, with attributes
added in a later version?
declare function render(component, opts): {
head: string;
body: string;
attributes: {
root: Record<string, string>;
body: Record<string, string>:
}
}
from svelte.
For the breaking change, what I meant was that, if someone were calling the render
function manually, there would now be a new value returned that they would be expected to deal with, otherwise the components they're rendering wouldn't have everything the authors of those components would expect.
If we wanted to, we could address the breaking change you're discussing by making things like <svelte:body class='blah'>
a syntax error in 5.0 and relaxing it when we implement the feature - but that doesn't resolve the issue of adding new values to the response from render
. Those would also, probably, need to be returned right away in 5.0 - and documented as a breaking change - but they would initially all be empty strings.
from svelte.
I suppose the alternative solution is to just go ahead and implement attributes
? In the case of <svelte:body>
, #11046 will raise its head again
from svelte.
Shouldn't it be bodyAttributes
then?
Or body: { attributes: string; html: string }
from svelte.
Related Issues (20)
- Passing a Writable as prop to a component doesn't allow "$" access HOT 2
- Svelte 5: dynamic class name not supported on SVG
- Svelte 5: Monkeypatching introduced in #11610 has broken array_prototype.lastIndexOf()
- Svelte version @5.0.0-next.140 breaks Svelte-dnd-action HOT 9
- DOM does not update when using array of objects in $state.frozen() HOT 4
- Svelte 5: onanimationend event doesn't get called under these specific circumstances. HOT 1
- Svelte v5 (maybe v4 too?) incorrectly removes CSS selectors alleging they are unused HOT 9
- Disable paste rather then copy in the tutorial. HOT 2
- Immer JS doesn't work with svelte runes HOT 5
- 5.0.0-next.138 breaks nested global CSS-attribute selectors
- 5.0.0-next.140 blocks pre-render capabilities of $effect.pre() HOT 6
- Svelte action update doesn't trigger on classes HOT 4
- Svelte 5: CSS custom property wrapper is implemented incorrectly HOT 5
- svelte 5: gotpointercapture and lostpointercapture not paresed correctly
- Anchor Tags Triggering Old URLs in Android Chrome HOT 6
- `bind` updates are too late HOT 7
- Svelte 5: Mutation warning when assigning non enumerable properties HOT 7
- onwheel not fired
- Svelte 5 Docs: Provide some information on potential pitfalls of runtime reactivity HOT 1
- Svelte 5: deferred events + intermediate UI changes HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte.