Skip to content

Commit

Permalink
treat slot the same as other props - closes #9455 (#9457)
Browse files Browse the repository at this point in the history
Co-authored-by: Rich Harris <rich.harris@vercel.com>
  • Loading branch information
Rich-Harris and Rich-Harris committed Nov 15, 2023
1 parent 6f6c3a0 commit f5101c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tiny-kings-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: treat `slot` the same as other props
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,6 @@ function serialize_inline_component(node, component_name, context) {
} else if (attribute.type === 'SpreadAttribute') {
props_and_spreads.push(/** @type {import('estree').Expression} */ (context.visit(attribute)));
} else if (attribute.type === 'Attribute') {
if (attribute.name === 'slot') continue;
if (attribute.name.startsWith('--')) {
custom_css_props.push(
b.init(attribute.name, serialize_attribute_value(attribute.value, context)[1])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,6 @@ function serialize_inline_component(node, component_name, context) {
} else if (attribute.type === 'SpreadAttribute') {
props_and_spreads.push(/** @type {import('estree').Expression} */ (context.visit(attribute)));
} else if (attribute.type === 'Attribute') {
if (attribute.name === 'slot') continue;
if (attribute.name.startsWith('--')) {
const value = serialize_attribute_value(attribute.value, context, false, true);
custom_css_props.push(b.init(attribute.name, value));
Expand Down

1 comment on commit f5101c0

@vercel
Copy link

@vercel vercel bot commented on f5101c0 Nov 15, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

svelte-5-preview – ./sites/svelte-5-preview

svelte-5-preview.vercel.app
svelte-octane.vercel.app
svelte-5-preview-git-main-svelte.vercel.app
svelte-5-preview-svelte.vercel.app

Please sign in to comment.