Skip to content

Commit

Permalink
[6.x] Switching from jade to pug (#21047) (#21338)
Browse files Browse the repository at this point in the history
* Switching from jade to pug (#21047)

* Upgrading pug

* Switching .jade to .pug and fixing templates

* Renaming the I18N usages of jade to pug

* No more jade in I18N

* Renaming root_redirect to .pug
  • Loading branch information
kobelb authored Aug 7, 2018
1 parent a743dd0 commit c88b567
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 156 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@
"http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^2.2.1",
"inert": "4.0.2",
"jade": "1.11.0",
"jade-loader": "0.8.0",
"joi": "10.4.1",
"jquery": "^3.3.1",
"js-yaml": "3.4.1",
Expand Down Expand Up @@ -169,6 +167,7 @@
"postcss-loader": "2.0.6",
"prop-types": "15.5.8",
"proxy-from-env": "1.0.0",
"pug": "^2.0.3",
"querystring-browser": "1.0.4",
"raw-loader": "0.5.1",
"react": "^16.3.0",
Expand Down
5 changes: 0 additions & 5 deletions src/optimize/base_optimizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ export default class BaseOptimizer {
test: /\.css$/,
use: getStyleLoaders(),
},
{
// TODO: this doesn't seem to be used, remove?
test: /\.jade$/,
loader: 'jade-loader'
},
{
test: /\.(html|tmpl)$/,
loader: 'raw-loader'
Expand Down
2 changes: 1 addition & 1 deletion src/server/http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default async function (kbnServer, server, config) {
this.views({
path: path,
isCached: config.get('optimize.viewCaching'),
engines: _.assign({ jade: require('jade') }, engines || {})
engines: _.assign({ pug: require('pug') }, engines || {})
});
});

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@ html(lang='en')

//- Favicons (generated from http://realfavicongenerator.net/)
link(
rel='apple-touch-icon' sizes='180x180' href='#{uiPublicUrl}/favicons/apple-touch-icon.png'
rel='apple-touch-icon' sizes='180x180' href=`${uiPublicUrl}/favicons/apple-touch-icon.png`
)
link(
rel='icon' type='image/png' href='#{uiPublicUrl}/favicons/favicon-32x32.png' sizes='32x32'
rel='icon' type='image/png' href=`${uiPublicUrl}/favicons/favicon-32x32.png` sizes='32x32'
)
link(
rel='icon' type='image/png' href='#{uiPublicUrl}/favicons/favicon-16x16.png' sizes='16x16'
rel='icon' type='image/png' href=`${uiPublicUrl}/favicons/favicon-16x16.png` sizes='16x16'
)
link(
rel='manifest' href='#{uiPublicUrl}/favicons/manifest.json'
rel='manifest' href=`${uiPublicUrl}/favicons/manifest.json`
)
link(
rel='mask-icon' href='#{uiPublicUrl}/favicons/safari-pinned-tab.svg' color='#e8488b'
rel='mask-icon' href=`${uiPublicUrl}/favicons/safari-pinned-tab.svg` color='#e8488b'
)
link(
rel='shortcut icon' href='#{uiPublicUrl}/favicons/favicon.ico'
rel='shortcut icon' href=`${uiPublicUrl}/favicons/favicon.ico`
)
meta(
name='msapplication-config' content='#{uiPublicUrl}/favicons/browserconfig.xml'
name='msapplication-config' content=`${uiPublicUrl}/favicons/browserconfig.xml`
)
meta(
name='theme-color' content='#ffffff'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extends ./chrome.jade
extends ./chrome

block content
style.
Expand Down
4 changes: 2 additions & 2 deletions tasks/verify_translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async function verifyTranslations(uiExports) {
// Search files for used translation keys
const translationPatterns = [
{ regexp: 'i18n\\(\'(.*)\'\\)',
parsePaths: [fromRoot('src/ui/ui_render/views/*.jade')] }
parsePaths: [fromRoot('src/ui/ui_render/views/*.pug')] }
];
for (const { regexp, parsePaths } of translationPatterns) {
const keys = await i18nVerify.getTranslationKeys(regexp, parsePaths);
Expand All @@ -80,7 +80,7 @@ async function verifyTranslations(uiExports) {
throw new Error(
'\n' +
'\n' +
'The following keys are used in angular/jade views but are not translated:\n' +
'The following keys are used in angular/pug views but are not translated:\n' +
keysWithoutTranslations.map(([locale, keys]) => (
` - ${locale}: ${formatListAsProse(keys)}`
)).join('\n') +
Expand Down
Loading

0 comments on commit c88b567

Please sign in to comment.