citizensadvice / design-system

Citizens Advice Design System
https://citizens-advice-design-system.netlify.app/
Apache License 2.0
31 stars 7 forks source link

Bridgetown fails to build against view_component 3.9 #3145

Closed davidrapson closed 3 months ago

davidrapson commented 8 months ago

The bridgetown project fails to build when updated to view_component 3.9. We should investigate the cause and potentially create a reduced test case to confirm if the issue can be replicated using a fresh bridgetown install.

Related issue: https://github.com/bridgetownrb/bridgetown-view-component/issues/8

marianayovcheva commented 8 months ago

@davidrapson I've had a look at that last Friday but reached a bit of a deadend. What I found so far was that it happens because of the "Ensure HTML output safety" feature which was added to in view_component 3.9: https://github.com/ViewComponent/view_component/pull/1950/files#diff-b69c75ffd85596e0b5fca1327059ecf3b2930f3f77004c78a268fa85e8ec8d9eR310. I think the problem is that in Bridgetown request and controller are nil (in normal rails apps request has a value so the code can proceed) and we hit an error. I hope this is something we would be able to resolve our end, but I'm a bit concerned if it ends up related to the bridgetown-view-component gem. The gem hasn't been updated in two years at which point it was written to support view_component 2

davidrapson commented 8 months ago

Yeah that looks like it! I think the "two years ago" on bridgetown-view-component is misleading, the last release was Jan 2023.

Going to pin the version for now but if you are up for it I reckon it's worth seeing if we can pull together a reduced test case bridgetown project with just enough set up to reproduce the issue.

If it does end up being something that needs fixing upstream having a good minimal example of the issue will help us fix it.

marianayovcheva commented 8 months ago

Sounds like a good plan, thanks! Not sure when I'll have the chance to look further into it though - meaning that it's open to anyone who's interested in the meanwhile.