Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Consider how govuk-frontend JS is imported and used to avoid bloated bundles #112

Open
andymantell opened this issue Mar 19, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@andymantell
Copy link
Collaborator

govuk-frontend JS is currently being imported from the npm module but as per alphagov/govuk-frontend#711 there are issues with this - it results (I think) in duplicated polyfills.

Current "solution" is to bundle from source. Perhaps by copying the govuk-frontend JS into this package at build time?

@andymantell andymantell added the enhancement New feature or request label Mar 19, 2021
@gunjam
Copy link

gunjam commented Mar 25, 2021

I would really like the original js included in the npm package along with the bundled versions 🙏.

@andymantell
Copy link
Collaborator Author

@gunjam Out of curiosity are you using govuk-react-jsx? Or have you reached this ticket because I linked to it from that ticket in govuk-frontend?

I might add the original JS to this package if it ends up being the right solution for the needs of govuk-react-jsx, but I don't think it would be wise for anyone to reference the govuk-frontend JS contained in govuk-react-jsx unless you were using govuk-react-jsx itself. That's not a use case I can support as I wouldn't like to guarantee that I wouldn't remove it in future.

@gunjam
Copy link

gunjam commented Mar 25, 2021

Yeah sorry I ended up here because I clicked an issue mention on govuk-frontend and didn't realise I'd changed repos! Sorry 😅

@andymantell
Copy link
Collaborator Author

Haha don't worry! Thanks for bringing the issue to my attention though - it was your tickets on govuk-frontend that made me investigate it here...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants