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

Use type=module for application.js #1924

Merged
merged 3 commits into from
Aug 15, 2024
Merged

Use type=module for application.js #1924

merged 3 commits into from
Aug 15, 2024

Conversation

AshGDS
Copy link
Contributor

@AshGDS AshGDS commented Jul 19, 2024

What / Why

  • Use type=module for this application's JS file
  • To coincide with Drop support for legacy browsers govuk_publishing_components#4111
  • Has [DO NOT MERGE] as we want the above PR live on static first before this is merged.
  • We will combine es6-components.js again as a separate task unless you disagree with this
  • To accurately test this you will need to use local static that is using a local version the govuk_publishing_components branch linked above. If you test without, this app's application.js seems to crash.
  • The tests are passing locally with the type=module branch of the gem, so the PR failing is likely due to the deployed version of the gem currently not having type=module as well.
  • Trello card: https://trello.com/c/Hoa45SMD/141-turn-off-javascript-in-legacy-browsers

@AshGDS AshGDS changed the title Use type=module for application.js [DO NOT MERGE] Use type=module for application.js Jul 23, 2024
@AshGDS AshGDS marked this pull request as ready for review July 24, 2024 09:32
@AshGDS AshGDS requested a review from MartinJJones July 24, 2024 09:34
Copy link
Contributor

@MartinJJones MartinJJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code changes look to me 👍

The JS error in the browser relates to the closest polyfill, further info here - alphagov/smart-answers#6846 (review)

I'm happy to give this another look and approve when the new version of the gem is released and included in this PR as this should then resolve the issue.

@govuk-ci govuk-ci temporarily deployed to feedback-pr-1924 August 15, 2024 15:52 Inactive
@AshGDS AshGDS changed the title [DO NOT MERGE] Use type=module for application.js Use type=module for application.js Aug 15, 2024
@AshGDS AshGDS merged commit 84dce11 into main Aug 15, 2024
11 checks passed
@AshGDS AshGDS deleted the type-module-changes branch August 15, 2024 16:08
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.

4 participants