-
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
Add backwards compatibility - support for prototypes made in Version 6 of the kit #553
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
253554b
Add Elements, Frontend Toolkit and GOV.UK Template modules
joelanman 053b889
Add gulp tasks for v6 support
joelanman 6fcb959
create v6 app to serve old prototype files from app/v6
joelanman 7d77d25
add backward compatibility documentation
joelanman 3c2b7c3
update changelog
joelanman 2b460b9
support old unbranded template
joelanman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Using backwards compatibility | ||
|
||
Version 7 of the Prototype Kit uses the new GOV.UK Design System. It is not compatible with prototypes built with older versions by default. | ||
|
||
Backwards compatibility lets you import a large old prototype into version 7, without having to rewrite it. You can update old pages one by one as you need to, and add new pages. | ||
|
||
You will end up with 2 'apps' in your prototype: | ||
|
||
**/app** using version 7 | ||
|
||
**/app/v6** using version 6 | ||
|
||
If any pages or routes exist in both apps, the one in version 7 will win. | ||
|
||
## Instructions | ||
|
||
1. Make a note of your Prototype Kit version in **VERSION.txt** in your prototype folder. | ||
|
||
1. Make sure you have a backup of your prototype folder, for example by copying it to another folder or by uploading to GitHub. | ||
|
||
1. Delete everything in your prototype folder except for the **app** and **.git** folders. (.git may be hidden). | ||
|
||
1. Rename your **app** folder to **v6** | ||
|
||
1. Find and replace all instances of **/public/** to **/public/v6/** in your code. | ||
In Atom, press **cmd shift F**. It looks like this: | ||
![Screenshot of Atom find and replace](/public/images/docs/backwards-compatibility-atom.png) | ||
|
||
1. [Download the latest Prototype Kit](/docs/download) and unzip it. | ||
|
||
1. Copy everything from the new Prototype Kit folder into your prototype folder. | ||
|
||
1. Move your **v6** folder into the new **app** folder. | ||
|
||
1. Update **app/config.js** to your settings, in particular the **serviceName**. You can then safely remove **app/v6/config.js**. | ||
|
||
1. On the command line, in your prototype folder, run **npm install**, then **npm start**. | ||
|
||
1. If your previous Prototype Kit version was older than 6.3.0, follow the guidance below about updating from older versions. | ||
|
||
## Updating pages to use version 7 | ||
|
||
You can now create new pages using version 7 by working in the app/views folder. | ||
|
||
You can update old pages by moving them from app/v6/views to app/views. You will then need to update the code on these pages to work with version 7. See the [updating your code guide in the GOV.UK Design System](https://design-system.service.gov.uk/get-started/updating-your-code/). | ||
|
||
## Updating from versions older than 6.3.0 | ||
|
||
The instructions above are for updating from version 6.3.0 of the Prototype Kit. If you had an older version, follow the normal instructions then run the commands below: | ||
|
||
### 6.2.0 | ||
|
||
``` | ||
npm install govuk-elements-sass@3.0.1 govuk_frontend_toolkit@5.1.2 govuk_template_jinja@0.22.1 | ||
``` | ||
|
||
### 6.1.0 or 6.0.0 | ||
|
||
``` | ||
npm install govuk-elements-sass@3.0.1 govuk_frontend_toolkit@5.1.2 govuk_template_jinja@0.19.2 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{% block top_of_page %}{% endblock %} | ||
<!DOCTYPE html> | ||
<!--[if lt IE 9]><html class="lte-ie8 unbranded" lang="{{ html_lang|default('en') }}"><![endif]--> | ||
<!--[if gt IE 8]><!--><html class="unbranded" lang="{{ html_lang|default('en') }}"><!--<![endif]--> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<title>{% block page_title %}{% endblock %}</title> | ||
|
||
<!--[if gt IE 8]><!--><link href="{{ asset_path }}stylesheets/govuk-template.css?0.18.3" media="screen" rel="stylesheet" /><!--<![endif]--> | ||
<!--[if IE 6]><link href="{{ asset_path }}stylesheets/govuk-template-ie6.css?0.18.3" media="screen" rel="stylesheet" /><![endif]--> | ||
<!--[if IE 7]><link href="{{ asset_path }}stylesheets/govuk-template-ie7.css?0.18.3" media="screen" rel="stylesheet" /><![endif]--> | ||
<!--[if IE 8]><link href="{{ asset_path }}stylesheets/govuk-template-ie8.css?0.18.3" media="screen" rel="stylesheet" /><![endif]--> | ||
<link href="{{ asset_path }}stylesheets/govuk-template-print.css?0.18.3" media="print" rel="stylesheet" /> | ||
|
||
<!--[if IE 8]><link href="{{ asset_path }}stylesheets/fonts-ie8.css?0.18.3" media="all" rel="stylesheet" /><![endif]--> | ||
<!--[if gte IE 9]><!--><link href="{{ asset_path }}stylesheets/fonts.css?0.18.3" media="all" rel="stylesheet" /><!--<![endif]--> | ||
<!--[if lt IE 9]><script src="{{ asset_path }}javascripts/ie.js?0.18.3"></script><![endif]--> | ||
|
||
<link rel="shortcut icon" href="{{ asset_path }}images/favicon.ico?0.18.3" type="image/x-icon" /> | ||
<link rel="mask-icon" href="{{ asset_path }}images/gov.uk_logotype_crown.svg?0.18.3" color="#0b0c0c"> | ||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ asset_path }}images/apple-touch-icon-152x152.png?0.18.3"> | ||
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="{{ asset_path }}images/apple-touch-icon-120x120.png?0.18.3"> | ||
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="{{ asset_path }}images/apple-touch-icon-76x76.png?0.18.3"> | ||
<link rel="apple-touch-icon-precomposed" href="{{ asset_path }}images/apple-touch-icon-60x60.png?0.18.3"> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta property="og:image" content="{{ asset_path }}images/opengraph-image.png?0.18.3"> | ||
|
||
|
||
{% block head %}{% endblock %} | ||
</head> | ||
|
||
<body class="{% block body_classes %}{% endblock %}"> | ||
<script>document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');</script> | ||
|
||
{% block body_start %}{% endblock %} | ||
|
||
<div id="skiplink-container"> | ||
<div> | ||
<a href="#content" class="skiplink">{{ skip_link_message|default('Skip to main content') }}</a> | ||
</div> | ||
</div> | ||
|
||
<div id="global-cookie-message"> | ||
|
||
{% block cookie_message %}{% endblock %} | ||
|
||
</div> | ||
<!--end global-cookie-message--> | ||
|
||
|
||
<header role="banner" id="global-header" class="{% block header_class %}{% endblock %}"> | ||
</header> | ||
<!--end header--> | ||
|
||
|
||
{% block after_header %}{% endblock %} | ||
|
||
{% block content %}{% endblock %} | ||
|
||
<footer class="group js-footer" id="footer" role="contentinfo"> | ||
</footer> | ||
|
||
<!--end footer--> | ||
|
||
<div id="global-app-error" class="app-error hidden"></div> | ||
|
||
<script src="{{ asset_path }}javascripts/govuk-template.js?0.18.3" type="text/javascript"></script> | ||
|
||
{% block body_end %}{% endblock %} | ||
|
||
<script>if (typeof window.GOVUK === 'undefined') document.body.className = document.body.className.replace('js-enabled', '');</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
As these arguments are now set in three different places in the file, I wonder if we might want to have them as a shared variable to reduce duplication. But if the intention is to have the v6 code here for the short term only then the current approach is okay for me 🙂
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.
good idea, but the
express
property is different in each one so I think this is tricky