Skip to content

Conversation

@innocenzi
Copy link
Member

@innocenzi innocenzi commented Mar 11, 2025

This pull request adds a failing test for a bug in the view rendering. Currently, multiple custom components cannot be used when one is used in <x-slot>.

x-foo-bar.view.php

<x-component name="x-foo-bar">
<link rel="stylesheet" href="/foo.css"></link>
</x-component>

x-custom-base.view.php

<x-component name="x-custom-base">
	<!doctype html>
	<html lang="en">
	<head>
		<title>Foo</title>
		<x-foo-bar />
		<x-slot name="head" />
	</head>
	<body class="a">b</body>
	</html>
</x-component>

rendered.view.php

<x-custom-base>
	<x-slot name="head">
		<x-foo-bar />
	</x-slot>
	Foo
</x-custom-base>

Will render:

b

Instead of:

<!DOCTYPE html>
  <html lang="en">
	<head>
		<title>Foo</title>
		<link rel="stylesheet" href="/foo.css"></link>
		<link rel="stylesheet" href="/foo.css"></link>
	</head>
	<body class="a">b</body>
</html>

@innocenzi innocenzi marked this pull request as draft March 11, 2025 17:07
@brendt brendt self-assigned this Mar 13, 2025
@brendt brendt added the Views label Mar 13, 2025
@brendt brendt added this to the v1.0.0-alpha.6 milestone Mar 13, 2025
@brendt
Copy link
Member

brendt commented Mar 13, 2025

Oh boy… I'm scared of this one :p I'll look into it!

@brendt brendt modified the milestones: v1.0.0-alpha.6, pre-1.0 Mar 19, 2025
@brendt brendt closed this Apr 2, 2025
@brendt brendt reopened this Apr 3, 2025
@brendt
Copy link
Member

brendt commented Apr 8, 2025

Closing in favor of #1129

@brendt brendt closed this Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants