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 dynamic components #708

Merged
merged 2 commits into from
Jun 27, 2024
Merged

Fix dynamic components #708

merged 2 commits into from
Jun 27, 2024

Conversation

bakerkretzmar
Copy link
Collaborator

Fixes <x-dynamic-component> Blade components, which don't work but should have been supported (and might have worked at some point in the past).

All this does is override the DynamicComponent component class so that it uses Jigsaw's customized ComponentTagCompiler instead of Laravel's. I didn't even change anything in DynamicComponent, just the fact that we redeclare it picks up the new compiler because of the namespace it's in.

There might be more nuance to explore here, this is super basic and just makes the happy path example in the included snapshot test work as expected.

Closes #707.

@bakerkretzmar
Copy link
Collaborator Author

Leaving the formatting action broken here because it changes a ton of files. I'll fix it separately.

@stevenmaguire
Copy link

@bakerkretzmar thanks for getting this going. I think this is the most prudent strategy.

There might be more nuance to explore here, this is super basic and just makes the happy path example in the included snapshot test work as expected.

The basics working is a good sign. If you're looking for most use cases, my specific use case is that I am using "class backed" components in the \Components jigsaw project namespace. I know that there is a logical fork in the component detection logic - one to source the path of the php class that backs the component and one to source the path of the blade template if the first fails. Perhaps ensuring that use case is handled in your solution would help build confidence?

@damiani damiani merged commit f47335a into main Jun 27, 2024
8 of 10 checks passed
@damiani damiani deleted the fix-dynamic-components branch June 27, 2024 19:16
@damiani
Copy link
Contributor

damiani commented Jun 27, 2024

Fantastic, thanks @bakerkretzmar !!

@stevenmaguire
Copy link

Thank you both!

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.

<x-dynamic-component /> support?
3 participants