Skip to content

Commit

Permalink
Merge pull request #74 from Financial-Times/no-mustard
Browse files Browse the repository at this point in the history
removed next-mustard dependency
  • Loading branch information
wheresrhys committed Mar 31, 2015
2 parents 8c674cc + e8bb890 commit 1e904dc
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 13 deletions.
3 changes: 1 addition & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "next-express",
"dependencies": {
"next-mustard": "^3.0.0",
"next-js-setup": "^v1.3.0",
"next-js-setup": "^v1.9.0",
"next-header": "*",
"next-footer": "^1.0.0",
"next-welcome": "^1.0.0"
Expand Down
11 changes: 8 additions & 3 deletions layouts/vanilla.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
<meta name="theme-color" content="#fff1e0"/>
<meta name="dfp_site" content="test.next.ft" />
<link rel="stylesheet" href="{{#hashedAsset}}main.css{{/hashedAsset}}"/>
<title>{{#title}}{{{this}}} &mdash; {{/title}}Financial Times</title>
{{>next-mustard/check}}
<title>{{#title}}{{{this}}} &mdash; {{/title}}FT.com</title>
{{>next-js-setup/templates/ctm}}
</head>
<body class="o-hoverable-on">
{{{body}}}
{{>next-mustard/addscripts}}
{{#if @root.flags.javascript.isSwitchedOn }}
<script>
window.nextFeatureFlags = {{{json @root.flags}}};
</script>
{{/if}}
{{>next-js-setup/templates/script-loader}}
{{>next-js-setup/templates/tracking}}
</body>
</html>
13 changes: 11 additions & 2 deletions layouts/wrapper.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="dfp_site" content="test.next.ft" />
<link rel="stylesheet" href="{{#hashedAsset}}main.css{{/hashedAsset}}"/>
<title>{{#title}}{{{this}}} &mdash; {{/title}}FT.com</title>
{{>next-mustard/check}}
{{>next-js-setup/templates/ctm}}
</head>
<body class="o-hoverable-on">
{{>next-header/templates/main}}
Expand All @@ -23,7 +23,16 @@
window.nextFeatureFlags = {{{json @root.flags}}};
</script>
{{/if}}
{{>next-mustard/addscripts}}
{{>next-js-setup/templates/script-loader}}
{{>next-js-setup/templates/tracking}}
</body>
</html>



</head>
<body class="o-hoverable-on">
{{{body}}}

</body>
</html>
8 changes: 4 additions & 4 deletions test/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ describe('simple app', function() {
request(app)
.get('/wrapped')
// doctype ... header ... script loader ... end page
.expect(200, /^<!DOCTYPE html>(.|[\r\n])*header(.|[\r\n])*addscripts(.|[\r\n])*<\/html>/, done);
.expect(200, /^<!DOCTYPE html>(.|[\r\n])*header(.|[\r\n])*script-loader(.|[\r\n])*<\/html>/, done);
});

it('wrapper should expose app name to client side code', function(done) {
Expand All @@ -151,14 +151,14 @@ describe('simple app', function() {
it('wrapper should expose offy flags to client side code', function(done) {
request(app)
.get('/wrapped')
.expect(200, /<html.*data-next-flags="(([a-z\-]+--off))( [a-z\-]+--off)*"/, done);
.expect(200, /<html.*data-next-flags="(([a-z\d\-]+--off))( [a-z\d\-]+--off)*"/, done);
});

it('should be possible to inherit a vanilla (inc html head only) layout', function(done) {
request(app)
.get('/vanilla')
// doctype ... no header ... script loader ... tracking ... end page
.expect(200, /^<!DOCTYPE html>(.|[\r\n])*<body class="o-hoverable-on">([^a-z])*<h1>(.|[\r\n])*addscripts([\t]+)tracking*/, done);
.expect(200, /^<!DOCTYPE html>(.|[\r\n])*<body class="o-hoverable-on">([^a-z])*<h1>(.|[\r\n])*script-loader([\t]+)tracking*/, done);
});

it('vanilla should expose app name to client side code', function(done) {
Expand All @@ -169,7 +169,7 @@ describe('simple app', function() {
it('vanilla should expose offy flags to client side code', function(done) {
request(app)
.get('/wrapped')
.expect(200, /<html.*data-next-flags="(([a-z\-]+--off))( [a-z\-]+--off)*"/, done);
.expect(200, /<html.*data-next-flags="(([a-z\d\-]+--off))( [a-z\d\-]+--off)*"/, done);
});
it('should integrate with the image service', function(done) {
request(app)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ctm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
script-loader

This file was deleted.

1 change: 0 additions & 1 deletion test/fixtures/app/bower_components/next-mustard/check.html

This file was deleted.

0 comments on commit 1e904dc

Please sign in to comment.