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

Discuss: 'all' JavaScript should not auto initialise, and export individual components #660

Closed
NickColley opened this issue Apr 17, 2018 · 3 comments

Comments

@NickColley
Copy link
Contributor

At the moment if you import 'all' it'll initialise automatically.

Should it instead do the following:

<script src="all.js"></script>
<script>
  govukFrontend.initAll()
</script>

and

<script src="all.js"></script>
<script>
  govukFrontend.Checkboxes.init()
</script>
@NickColley
Copy link
Contributor Author

Adam has an interesting article on this: https://adamsilver.io/articles/dont-initialise-javascript-automagically/

@NickColley
Copy link
Contributor Author

After integrating the JavaScript into the design system, I think this is definitely something we should consider.

@NickColley
Copy link
Contributor Author

Closed with #759

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

No branches or pull requests

1 participant