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

This depends on deprecated govuk_frontend_toolkit #500

Closed
kevindew opened this issue Sep 5, 2018 · 6 comments · Fixed by #1110
Closed

This depends on deprecated govuk_frontend_toolkit #500

kevindew opened this issue Sep 5, 2018 · 6 comments · Fixed by #1110

Comments

@kevindew
Copy link
Member

kevindew commented Sep 5, 2018

We hit some issues using this gem working with content-publisher: alphagov/content-publisher#217 in a javascript context which highlighted some of the problems with the remaining dependency on govuk_frontend_toolkit.

A problem we have for any apps is that nearly all the modules in https://github.com/alphagov/govuk_publishing_components/tree/master/app/assets/javascripts/govuk_publishing_components need to use govuk_frontend_toolkit to initialise their modules. This presents a problem for developers trying to migrate away from jQuery as govuk_frontend_toolkit requires jQuery.

A solution to this would be to change the initialisation method for our components to use a different approach - as the current one we have is only a very thin layer. We'd have to decide whether we want to continue with a self initialisation approach or to take the approach from govuk-frontend to have them be initialised separately.

We also seem to use govuk_frontend_toolkit for various CSS files. I'm not sure if that's now covered by govuk-frontend, @alex-ju ?

So actions to resolve this would be:

  • Determine a new way to initialise javascript components that doesn't use govuk_frontend_toolkit
  • See if we can replace the stylesheets that are used

I'm not sure if I'm missing any others

/cc @alex-ju

@alex-ju
Copy link
Contributor

alex-ju commented Sep 5, 2018

govuk_frontend_toolkit should all be covered by govuk-frontend with the exception of a set of google analytics scripts that are not being used anymore as far as I'm aware.

My take would be to try and remove govuk_frontend_toolkit entirely as it's deprecated and replace it with govuk-frontend (both styles and scripts). The remaining question is if we're going to keep the jQuery dependency or not and I think this answer should come from frontend developers across GOV.UK. I will raise this in the next frontend meeting.

@kevindew
Copy link
Member Author

kevindew commented Sep 5, 2018

Cool thanks @alex-ju 👍 sounds good about the css.

Yeah with regards to jQuery be good to know the thoughts and if we do keep it what means should it be bundled.

Are you ok to have a ponder about the initialisation of modules without govuk_frontend_toolkit?

@alex-ju
Copy link
Contributor

alex-ju commented Sep 6, 2018

@kevindew yes, I'll think about it and come back with a proposal.

@NickColley
Copy link
Contributor

Can this be closed now?

@andysellick
Copy link
Contributor

I think we might still be using the modules JS from the toolkit, is that correct? https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/javascripts/govuk_publishing_components/dependencies.js#L6

@alex-ju
Copy link
Contributor

alex-ju commented Sep 6, 2019

@NickColley we still have some JS bits to remove/migrate and then we can close this. I will offer drinks when that happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants