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

Version 2.0.0 #158

Merged
merged 177 commits into from
Aug 10, 2021
Merged

Version 2.0.0 #158

merged 177 commits into from
Aug 10, 2021

Conversation

peteryates
Copy link
Member

@peteryates peteryates commented May 20, 2021

ViewComponent has progressed significantly since this library was created. Due to our use of the old slot API, significant changes are required to bring it in line with the latest version. It's impossible to simply adjust our existing slots so they work with slots v2.

This is a good opportunity to tighten things up a bit and improve consistency throughout.

Style choices

  • Use Rails' tag/content_tag helpers and pass arrays of classes instead of building the string inside templates
  • Keep as much attribute-building logic in the component file as possible, template shouldn't have any substantial logic
  • Remove the really basic templates in favour of rendering in Ruby via #call
  • Remove the component 'DSL' style slot wrapper, it's no longer needed

Component updates

Nice-to-haves

  • Improve the guide/docs. Perhaps create a statically-built guide like the form builder's (also create a PR to update the ViewComponent page that lists us if we change the URL) going to push this back to 2.1.0, probably a couple of weeks' work here at least
  • Switch to rspec-html-matchers from Capybara, it makes asserting the presence of attributes much nicer and we don't need any browser-driving capability
  • Implement the remaining tasks to bring the gem into alignment with the Nunjucks macros Parity with the Nunjucks macros #202

Housekeeping

  • Upgrade to govuk-rubocop >= 4.0.0
  • Update the examples page

@peteryates peteryates added this to the Version 2.0.0 milestone May 22, 2021
peteryates and others added 16 commits May 22, 2021 20:27
…g-text

Version 2.0.0 tag and warning text
Replace Accordion with new AccordionComponent
Also move this assertation over to RSpec HTML matcher syntax
…-breadcrumbs

Update the back link and breadcrumb components
- Upgrade to the new slots API
- Update specs to be consistent and use have_tag matcher
…d-of-ugly-selectors

Favour the with syntax over long complex selectors
- Remove template and use call method to render
- Rename arguments for consistency with design system
- Update spec to use with syntax
- Update specs to use with syntax
- Use call method for rendering panel component
- Update spec to use with syntax
…tions-specs

Split actions specs so extra classes aren't needed
…ew-component

Bump to latest version of ViewComponent
…e-banner-heading

Add 'govuk-heading-m' to cookie banner message h2
Some services might want to display the row in the summary list despite
it having no content.
Don't error when summary list value is empty
…okie-banner-grid

Move button group out of cookie banner message grid
…n-and-visually-hidden-text

Ensure there's a space before visually hidden text
@peteryates peteryates marked this pull request as ready for review August 10, 2021 10:24
@peteryates peteryates merged commit f4036bc into master Aug 10, 2021
@peteryates peteryates deleted the version-2.0.0 branch August 10, 2021 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants