-
Notifications
You must be signed in to change notification settings - Fork 237
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
Move shared JavaScript to lib folder #1481
Conversation
b835956
to
7dc024e
Compare
7dc024e
to
98e67e7
Compare
98e67e7
to
ab960f3
Compare
ab960f3
to
65d4b62
Compare
65d4b62
to
29c135d
Compare
5f7d6f9
to
f9c61d7
Compare
f9c61d7
to
3f87634
Compare
3f87634
to
99cd145
Compare
99cd145
to
7662dab
Compare
7662dab
to
7da97d3
Compare
I think the test can be fixed by replacing:
with
|
7da97d3
to
0a17593
Compare
ffe15f6
to
e0ff427
Compare
7b7f1e9
to
364bfae
Compare
364bfae
to
ca3f699
Compare
As this PR is already pretty big I've put the layout template includes changes in a separate PR, #1499. |
Also rename application.js to kit.js to avoid clashes. Co-authored-by: Joe Lanman <joe.lanman@digital.cabinet-office.gov.uk>
Co-authored-by: NoraGDS <57447099+NoraGDS@users.noreply.github.com>
We want to make sure that any shared JS files we create can't have name collisions with files the user wants to create. Putting the files in a separate namespaced folder mitigates against this.
The update script tests run create-release-archive a lot, which involves a lot of shelling out, and on Windows this is very slow, so we increase the test timeout again to account for this. Ideally there would be less shelling out, but that's a problem for another day.
c07ecb9
to
5e5e10b
Compare
5e5e10b
to
f88485e
Compare
We want to make sure that on Windows we can compare files regardless of what line endings the users files have, and that any changes we make have the same line endings.
Simplify the update shell script by combining the Node.js post scripts into one mega script. We also move the final message from update script to very end.
f88485e
to
5e94bc7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great work
Ideally, a user would just add their javascript to
app/assets/javascripts/application.js
and not have to see or worry about things like intitialsing govuk-frontend, or the auto-store data JS. This would make updating a user's prototype easier and less risky, because currently it is possible they have changed the standard files. It will also mean less is needed to bootstrap a prototype using a package.This PR moves the standard JS to the lib folder as
lib/assets/javascripts/kit.js
, and replacesapp/assets/javascripts/application.js
with a simple placeholder that a user can rewrite completely as desired.Note that we make sure that all pages include both scripts by adding
kit.js
toapp/views/includes/scripts.html
. This PR doesn't help users update that file, but ideally in another PR we would make it so that updating to v13 also takes care of this.Resolves #1387.