From b806b8240b4f06cefa0f81feffa8b61135a83800 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 28 Apr 2019 11:46:17 +0200 Subject: [PATCH 1/9] test: Wrap test cases in `describe()` block --- .../hbs-minifier-plugin.test.js.snap | 72 ++++----- hbs-minifier-plugin.test.js | 145 +++++++++--------- 2 files changed, 110 insertions(+), 107 deletions(-) diff --git a/__snapshots__/hbs-minifier-plugin.test.js.snap b/__snapshots__/hbs-minifier-plugin.test.js.snap index 42e84dbb..82cd7259 100644 --- a/__snapshots__/hbs-minifier-plugin.test.js.snap +++ b/__snapshots__/hbs-minifier-plugin.test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`collapses whitespace into single space character 1`] = ` +exports[`HBS Minifier plugin collapses whitespace into single space character 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -137,9 +137,9 @@ Object { } `; -exports[`collapses whitespace into single space character 2`] = `"{{foo}} {{bar}}"`; +exports[`HBS Minifier plugin collapses whitespace into single space character 2`] = `"{{foo}} {{bar}}"`; -exports[`does not collapse   surrounding a text content into a single whitespace 1`] = ` +exports[`HBS Minifier plugin does not collapse   surrounding a text content into a single whitespace 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -267,9 +267,9 @@ Object { } `; -exports[`does not collapse   surrounding a text content into a single whitespace 2`] = `"
 1  2
"`; +exports[`HBS Minifier plugin does not collapse   surrounding a text content into a single whitespace 2`] = `"
 1  2
"`; -exports[`does not collapse multiple   textNode into a single whitespace 1`] = ` +exports[`HBS Minifier plugin does not collapse multiple   textNode into a single whitespace 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -376,9 +376,9 @@ Object { } `; -exports[`does not collapse multiple   textNode into a single whitespace 2`] = `"1  2"`; +exports[`HBS Minifier plugin does not collapse multiple   textNode into a single whitespace 2`] = `"1  2"`; -exports[`does not collapse whitespace inside of
 tags 1`] = `
+exports[`HBS Minifier plugin does not collapse whitespace inside of 
 tags 1`] = `
 Object {
   "blockParams": Array [],
   "body": Array [
@@ -437,14 +437,14 @@ Object {
 }
 `;
 
-exports[`does not collapse whitespace inside of 
 tags 2`] = `
+exports[`HBS Minifier plugin does not collapse whitespace inside of 
 tags 2`] = `
 "
  
 
    
 
" `; -exports[`does not collapse whitespace inside of {{#no-minify}} tags in other tags 1`] = ` +exports[`HBS Minifier plugin does not collapse whitespace inside of {{#no-minify}} tags in other tags 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -503,14 +503,14 @@ Object { } `; -exports[`does not collapse whitespace inside of {{#no-minify}} tags in other tags 2`] = ` +exports[`HBS Minifier plugin does not collapse whitespace inside of {{#no-minify}} tags in other tags 2`] = ` "
" `; -exports[`does not minify \`classNames\` specified in .hbs-minifyrc.js 1`] = ` +exports[`HBS Minifier plugin does not minify \`classNames\` specified in .hbs-minifyrc.js 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -653,7 +653,7 @@ Object { } `; -exports[`does not minify \`classNames\` specified in .hbs-minifyrc.js 2`] = ` +exports[`HBS Minifier plugin does not minify \`classNames\` specified in .hbs-minifyrc.js 2`] = ` "
1 @@ -662,7 +662,7 @@ exports[`does not minify \`classNames\` specified in .hbs-minifyrc.js 2`] = `
" `; -exports[`does not minify \`components\` specified in .hbs-minifyrc.js 1`] = ` +exports[`HBS Minifier plugin does not minify \`components\` specified in .hbs-minifyrc.js 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -819,14 +819,14 @@ Object { } `; -exports[`does not minify \`components\` specified in .hbs-minifyrc.js 2`] = ` +exports[`HBS Minifier plugin does not minify \`components\` specified in .hbs-minifyrc.js 2`] = ` "{{#foo-bar}} yield content {{/foo-bar}}" `; -exports[`does not minify \`tagNames\` specified in .hbs-minifyrc.js 1`] = ` +exports[`HBS Minifier plugin does not minify \`tagNames\` specified in .hbs-minifyrc.js 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -1026,7 +1026,7 @@ Object { } `; -exports[`does not minify \`tagNames\` specified in .hbs-minifyrc.js 2`] = ` +exports[`HBS Minifier plugin does not minify \`tagNames\` specified in .hbs-minifyrc.js 2`] = ` "
Box 564, @@ -1037,7 +1037,7 @@ exports[`does not minify \`tagNames\` specified in .hbs-minifyrc.js 2`] = `
" `; -exports[`does not strip inside of
 tags 1`] = `
+exports[`HBS Minifier plugin does not strip inside of 
 tags 1`] = `
 Object {
   "blockParams": Array [],
   "body": Array [
@@ -1159,9 +1159,9 @@ Object {
 }
 `;
 
-exports[`does not strip inside of 
 tags 2`] = `"
        {{foo}}        
"`; +exports[`HBS Minifier plugin does not strip inside of
 tags 2`] = `"
        {{foo}}        
"`; -exports[`does not strip inside of {{#no-minify}} tags 1`] = ` +exports[`HBS Minifier plugin does not strip inside of {{#no-minify}} tags 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -1262,9 +1262,9 @@ Object { } `; -exports[`does not strip inside of {{#no-minify}} tags 2`] = `" {{foo}} "`; +exports[`HBS Minifier plugin does not strip inside of {{#no-minify}} tags 2`] = `" {{foo}} "`; -exports[`does not strip inside of {{#no-minify}} tags in other tags 1`] = ` +exports[`HBS Minifier plugin does not strip inside of {{#no-minify}} tags in other tags 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -1386,9 +1386,9 @@ Object { } `; -exports[`does not strip inside of {{#no-minify}} tags in other tags 2`] = `"
{{foo}}
"`; +exports[`HBS Minifier plugin does not strip inside of {{#no-minify}} tags in other tags 2`] = `"
{{foo}}
"`; -exports[`does not strip leading/trailing text from ElementNode nodes 1`] = ` +exports[`HBS Minifier plugin does not strip leading/trailing text from ElementNode nodes 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -1510,9 +1510,9 @@ Object { } `; -exports[`does not strip leading/trailing text from ElementNode nodes 2`] = `"
x {{foo}} y
"`; +exports[`HBS Minifier plugin does not strip leading/trailing text from ElementNode nodes 2`] = `"
x {{foo}} y
"`; -exports[`does not strip leading/trailing text from Program nodes 1`] = ` +exports[`HBS Minifier plugin does not strip leading/trailing text from Program nodes 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -1613,9 +1613,9 @@ Object { } `; -exports[`does not strip leading/trailing text from Program nodes 2`] = `"x {{foo}} y "`; +exports[`HBS Minifier plugin does not strip leading/trailing text from Program nodes 2`] = `"x {{foo}} y "`; -exports[`minifies \`classNames\` that are not specified in .hbs-minifyrc.js 1`] = ` +exports[`HBS Minifier plugin minifies \`classNames\` that are not specified in .hbs-minifyrc.js 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -1738,9 +1738,9 @@ Object { } `; -exports[`minifies \`classNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
John Smith (Entrepreneur)
"`; +exports[`HBS Minifier plugin minifies \`classNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
John Smith (Entrepreneur)
"`; -exports[`minifies \`components\` that are not specified in .hbs-minifyrc.js 1`] = ` +exports[`HBS Minifier plugin minifies \`components\` that are not specified in .hbs-minifyrc.js 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -1864,9 +1864,9 @@ Object { } `; -exports[`minifies \`components\` that are not specified in .hbs-minifyrc.js 2`] = `"{{#my-component}} yield content {{/my-component}}"`; +exports[`HBS Minifier plugin minifies \`components\` that are not specified in .hbs-minifyrc.js 2`] = `"{{#my-component}} yield content {{/my-component}}"`; -exports[`minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 1`] = ` +exports[`HBS Minifier plugin minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -2044,9 +2044,9 @@ Object { } `; -exports[`minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
Box 564, Disneyland

USA
"`; +exports[`HBS Minifier plugin minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
Box 564, Disneyland

USA
"`; -exports[`strips leading and trailing whitespace from ElementNode nodes 1`] = ` +exports[`HBS Minifier plugin strips leading and trailing whitespace from ElementNode nodes 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -2138,9 +2138,9 @@ Object { } `; -exports[`strips leading and trailing whitespace from ElementNode nodes 2`] = `"
{{foo}}
"`; +exports[`HBS Minifier plugin strips leading and trailing whitespace from ElementNode nodes 2`] = `"
{{foo}}
"`; -exports[`strips leading and trailing whitespace from Program nodes 1`] = ` +exports[`HBS Minifier plugin strips leading and trailing whitespace from Program nodes 1`] = ` Object { "blockParams": Array [], "body": Array [ @@ -2211,4 +2211,4 @@ Object { } `; -exports[`strips leading and trailing whitespace from Program nodes 2`] = `"{{foo}}"`; +exports[`HBS Minifier plugin strips leading and trailing whitespace from Program nodes 2`] = `"{{foo}}"`; diff --git a/hbs-minifier-plugin.test.js b/hbs-minifier-plugin.test.js index 3c0d27c3..9a2dfceb 100644 --- a/hbs-minifier-plugin.test.js +++ b/hbs-minifier-plugin.test.js @@ -8,62 +8,64 @@ const defaultConfig = { components: ['foo-bar', 'no-minify'] } }; -const glimmer = require('@glimmer/syntax'); const HbsMinifierPlugin = require('./hbs-minifier-plugin')(defaultConfig); -it('collapses whitespace into single space character', () => { - assert(`{{foo}} \n\n \n{{bar}}`); -}); +describe('HBS Minifier plugin', () => { + const glimmer = require('@glimmer/syntax'); -it('strips leading and trailing whitespace from Program nodes', function() { - assert(` {{foo}} `); -}); + it('collapses whitespace into single space character', () => { + assert(`{{foo}} \n\n \n{{bar}}`); + }); -it('does not strip leading/trailing text from Program nodes', function() { - assert(`x {{foo}} y `); -}); + it('strips leading and trailing whitespace from Program nodes', function() { + assert(` {{foo}} `); + }); -it('strips leading and trailing whitespace from ElementNode nodes', function() { - assert(`
{{foo}}
`); -}); + it('does not strip leading/trailing text from Program nodes', function() { + assert(`x {{foo}} y `); + }); -it('does not strip leading/trailing text from ElementNode nodes', function() { - assert(`
x {{foo}} y
`); -}); + it('strips leading and trailing whitespace from ElementNode nodes', function() { + assert(`
{{foo}}
`); + }); -it('does not strip inside of
 tags', function() {
-  assert(`
        {{foo}}        
`); -}); + it('does not strip leading/trailing text from ElementNode nodes', function() { + assert(`
x {{foo}} y
`); + }); -it('does not collapse whitespace inside of
 tags', function() {
-  assert(`
  \n\n   \n
`); -}); + it('does not strip inside of
 tags', function() {
+    assert(`
        {{foo}}        
`); + }); -it('does not strip inside of {{#no-minify}} tags', function() { - assert(`{{#no-minify}} {{foo}} {{/no-minify}}`); -}); + it('does not collapse whitespace inside of
 tags', function() {
+    assert(`
  \n\n   \n
`); + }); -it('does not strip inside of {{#no-minify}} tags in other tags', function() { - assert(`
{{#no-minify}} {{foo}} {{/no-minify}}
`); -}); + it('does not strip inside of {{#no-minify}} tags', function() { + assert(`{{#no-minify}} {{foo}} {{/no-minify}}`); + }); -it('does not collapse whitespace inside of {{#no-minify}} tags in other tags', function() { - assert(`
{{#no-minify}} \n\n \n{{/no-minify}}
`); -}); + it('does not strip inside of {{#no-minify}} tags in other tags', function() { + assert(`
{{#no-minify}} {{foo}} {{/no-minify}}
`); + }); -it('does not collapse multiple   textNode into a single whitespace', function() { - assert(`1  2`); -}); + it('does not collapse whitespace inside of {{#no-minify}} tags in other tags', function() { + assert(`
{{#no-minify}} \n\n \n{{/no-minify}}
`); + }); -it('does not collapse   surrounding a text content into a single whitespace', function() { - assert(`
+ it('does not collapse multiple   textNode into a single whitespace', function() { + assert(`1  2`); + }); + + it('does not collapse   surrounding a text content into a single whitespace', function() { + assert(`
 1  2
`); -}); + }); -it('does not minify `tagNames` specified in .hbs-minifyrc.js', function() { - assert(`
+ it('does not minify `tagNames` specified in .hbs-minifyrc.js', function() { + assert(`
Box 564, Disneyland @@ -71,27 +73,27 @@ it('does not minify `tagNames` specified in .hbs-minifyrc.js', function() {
USA
`); -}); + }); -it('does not minify `classNames` specified in .hbs-minifyrc.js', function() { - assert(`
+ it('does not minify `classNames` specified in .hbs-minifyrc.js', function() { + assert(`
1 2
`); -}); + }); -it('does not minify `components` specified in .hbs-minifyrc.js', function() { - assert(`{{#foo-bar}} + it('does not minify `components` specified in .hbs-minifyrc.js', function() { + assert(`{{#foo-bar}} yield content {{/foo-bar}}`); -}); + }); -it('minifies `tagNames` that are not specified in .hbs-minifyrc.js', function() { - assert(`
+ it('minifies `tagNames` that are not specified in .hbs-minifyrc.js', function() { + assert(`
Box 564, Disneyland @@ -99,40 +101,41 @@ it('minifies `tagNames` that are not specified in .hbs-minifyrc.js', function()
USA
`); -}); + }); -it('minifies `classNames` that are not specified in .hbs-minifyrc.js', function() { - assert(`
+ it('minifies `classNames` that are not specified in .hbs-minifyrc.js', function() { + assert(`
John Smith (Entrepreneur)
`); -}); + }); -it('minifies `components` that are not specified in .hbs-minifyrc.js', function() { - assert(`{{#my-component}} + it('minifies `components` that are not specified in .hbs-minifyrc.js', function() { + assert(`{{#my-component}} yield content {{/my-component}}`); -}); + }); -function assert(template) { - let ast = process(template); - expect(ast).toMatchSnapshot(); + function assert(template) { + let ast = process(template); + expect(ast).toMatchSnapshot(); - let printed = glimmer.print(ast); - expect(printed).toMatchSnapshot(); -} + let printed = glimmer.print(ast); + expect(printed).toMatchSnapshot(); + } -function process(template) { - let plugin = () => { - return HbsMinifierPlugin.createASTPlugin(defaultConfig.skip); - }; - return glimmer.preprocess(template, { - plugins: { - ast: [plugin] - } - }); -} + function process(template) { + let plugin = () => { + return HbsMinifierPlugin.createASTPlugin(defaultConfig.skip); + }; + return glimmer.preprocess(template, { + plugins: { + ast: [plugin] + } + }); + } +}); From 7ac7393d31d814bcd373bfcb14214993c88d8da5 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 28 Apr 2019 11:16:02 +0200 Subject: [PATCH 2/9] Use `multidep` to test against multiple `@glimmer/syntax` versions --- .gitignore | 1 + .travis.yml | 3 + .../hbs-minifier-plugin.test.js.snap | 2213 +++++++++++++++++ hbs-minifier-plugin.test.js | 170 +- multidep.json | 8 + package.json | 3 +- yarn.lock | 16 +- 7 files changed, 2337 insertions(+), 77 deletions(-) create mode 100644 multidep.json diff --git a/.gitignore b/.gitignore index e6e30794..2eda80bd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /tmp # dependencies +/multidep_modules /node_modules /bower_components diff --git a/.travis.yml b/.travis.yml index b1d4583b..779c9484 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,9 @@ jobs: script: yarn lint - name: "Unit Tests" + install: + - yarn install --no-lockfile + - yarn multidep multidep.json script: yarn test - name: "Ember Tests" diff --git a/__snapshots__/hbs-minifier-plugin.test.js.snap b/__snapshots__/hbs-minifier-plugin.test.js.snap index 82cd7259..bb0c6c98 100644 --- a/__snapshots__/hbs-minifier-plugin.test.js.snap +++ b/__snapshots__/hbs-minifier-plugin.test.js.snap @@ -1,5 +1,2218 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) collapses whitespace into single space character 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 5, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "source": null, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 5, + "line": 4, + }, + "source": undefined, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "original": "bar", + "parts": Array [ + "bar", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) collapses whitespace into single space character 2`] = `"{{foo}} {{bar}}"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse   surrounding a text content into a single whitespace 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "  1  ", + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "source": null, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "source": null, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "modifiers": Array [], + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " 2 ", + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "source": null, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "tag": "span", + "type": "ElementNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse   surrounding a text content into a single whitespace 2`] = `"
 1  2
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse multiple   textNode into a single whitespace 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "1", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "source": null, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": "  ", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "source": null, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "2", + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "source": null, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "source": null, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "span", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse multiple   textNode into a single whitespace 2`] = `"1  2"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse whitespace inside of
 tags 1`] = `
+Object {
+  "blockParams": Array [],
+  "body": Array [
+    Object {
+      "attributes": Array [],
+      "blockParams": Array [],
+      "children": Array [
+        Object {
+          "chars": "  
+
+   
+",
+          "loc": Object {
+            "end": Object {
+              "column": 0,
+              "line": 4,
+            },
+            "source": null,
+            "start": Object {
+              "column": 5,
+              "line": 1,
+            },
+          },
+          "type": "TextNode",
+        },
+      ],
+      "comments": Array [],
+      "loc": Object {
+        "end": Object {
+          "column": 6,
+          "line": 4,
+        },
+        "source": null,
+        "start": Object {
+          "column": 0,
+          "line": 1,
+        },
+      },
+      "modifiers": Array [],
+      "tag": "pre",
+      "type": "ElementNode",
+    },
+  ],
+  "loc": Object {
+    "end": Object {
+      "column": 6,
+      "line": 4,
+    },
+    "source": null,
+    "start": Object {
+      "column": 0,
+      "line": 1,
+    },
+  },
+  "type": "Program",
+}
+`;
+
+exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse whitespace inside of 
 tags 2`] = `
+"
  
+
+   
+
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse whitespace inside of {{#no-minify}} tags in other tags 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + + +", + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "source": null, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse whitespace inside of {{#no-minify}} tags in other tags 2`] = ` +"
+ + +
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`classNames\` specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "source": null, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "class", + "type": "AttrNode", + "value": Object { + "chars": "description", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "source": null, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "type": "TextNode", + }, + }, + ], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + 1 + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + 2 + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": " +", + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "source": null, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`classNames\` specified in .hbs-minifyrc.js 2`] = ` +"
+ 1 + + 2 + +
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`components\` specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "inverse": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 10, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "original": "foo-bar", + "parts": Array [ + "foo-bar", + ], + "this": false, + "type": "PathExpression", + }, + "program": Object { + "blockParams": Array [], + "body": Array [ + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 2, + }, + "source": null, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + yield content + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "source": null, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "source": null, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "modifiers": Array [], + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": " +", + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "source": null, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "type": "TextNode", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "source": null, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "type": "Program", + }, + "type": "BlockStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`components\` specified in .hbs-minifyrc.js 2`] = ` +"{{#foo-bar}} + yield content + +{{/foo-bar}}" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`tagNames\` specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + Box 564, + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + Disneyland + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "tag": "b", + "type": "ElementNode", + }, + Object { + "chars": " + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "source": null, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "modifiers": Array [], + "tag": "br", + "type": "ElementNode", + }, + Object { + "chars": " + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "source": null, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " USA ", + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "source": null, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "source": null, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "modifiers": Array [], + "tag": "u", + "type": "ElementNode", + }, + Object { + "chars": " +", + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "source": null, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "address", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`tagNames\` specified in .hbs-minifyrc.js 2`] = ` +"
+ Box 564, + + Disneyland + +

+ USA +
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of
 tags 1`] = `
+Object {
+  "blockParams": Array [],
+  "body": Array [
+    Object {
+      "attributes": Array [],
+      "blockParams": Array [],
+      "children": Array [
+        Object {
+          "chars": "        ",
+          "loc": Object {
+            "end": Object {
+              "column": 13,
+              "line": 1,
+            },
+            "source": null,
+            "start": Object {
+              "column": 5,
+              "line": 1,
+            },
+          },
+          "type": "TextNode",
+        },
+        Object {
+          "escaped": true,
+          "hash": Object {
+            "loc": Object {
+              "end": Object {
+                "column": 0,
+                "line": 1,
+              },
+              "source": "(synthetic)",
+              "start": Object {
+                "column": 0,
+                "line": 1,
+              },
+            },
+            "pairs": Array [],
+            "type": "Hash",
+          },
+          "loc": Object {
+            "end": Object {
+              "column": 20,
+              "line": 1,
+            },
+            "source": null,
+            "start": Object {
+              "column": 13,
+              "line": 1,
+            },
+          },
+          "params": Array [],
+          "path": Object {
+            "data": false,
+            "loc": SourceLocation {
+              "end": Object {
+                "column": 18,
+                "line": 1,
+              },
+              "source": undefined,
+              "start": Object {
+                "column": 15,
+                "line": 1,
+              },
+            },
+            "original": "foo",
+            "parts": Array [
+              "foo",
+            ],
+            "this": false,
+            "type": "PathExpression",
+          },
+          "type": "MustacheStatement",
+        },
+        Object {
+          "chars": "        ",
+          "loc": Object {
+            "end": Object {
+              "column": 28,
+              "line": 1,
+            },
+            "source": null,
+            "start": Object {
+              "column": 20,
+              "line": 1,
+            },
+          },
+          "type": "TextNode",
+        },
+      ],
+      "comments": Array [],
+      "loc": Object {
+        "end": Object {
+          "column": 34,
+          "line": 1,
+        },
+        "source": null,
+        "start": Object {
+          "column": 0,
+          "line": 1,
+        },
+      },
+      "modifiers": Array [],
+      "tag": "pre",
+      "type": "ElementNode",
+    },
+  ],
+  "loc": Object {
+    "end": Object {
+      "column": 34,
+      "line": 1,
+    },
+    "source": null,
+    "start": Object {
+      "column": 0,
+      "line": 1,
+    },
+  },
+  "type": "Program",
+}
+`;
+
+exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of 
 tags 2`] = `"
        {{foo}}        
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of {{#no-minify}} tags 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "source": null, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "source": null, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 27, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "source": null, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of {{#no-minify}} tags 2`] = `" {{foo}} "`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of {{#no-minify}} tags in other tags 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "source": null, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "source": null, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 32, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "source": null, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of {{#no-minify}} tags in other tags 2`] = `"
{{foo}}
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip leading/trailing text from ElementNode nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "x ", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "source": null, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "source": null, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 19, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " y ", + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "source": null, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip leading/trailing text from ElementNode nodes 2`] = `"
x {{foo}} y
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip leading/trailing text from Program nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "chars": "x ", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "source": null, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 14, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " y ", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "source": null, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip leading/trailing text from Program nodes 2`] = `"x {{foo}} y "`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`classNames\` that are not specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "source": null, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "class", + "type": "AttrNode", + "value": Object { + "chars": "contact-details", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "source": null, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "type": "TextNode", + }, + }, + ], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " John Smith ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " (Entrepreneur) ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "tag": "i", + "type": "ElementNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`classNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
John Smith (Entrepreneur)
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`components\` that are not specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "inverse": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 15, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "original": "my-component", + "parts": Array [ + "my-component", + ], + "this": false, + "type": "PathExpression", + }, + "program": Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " yield content ", + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "source": null, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "source": null, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "modifiers": Array [], + "tag": "span", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "source": null, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "type": "Program", + }, + "type": "BlockStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`components\` that are not specified in .hbs-minifyrc.js 2`] = `"{{#my-component}} yield content {{/my-component}}"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " Box 564, ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " Disneyland ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "tag": "b", + "type": "ElementNode", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "source": null, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "modifiers": Array [], + "tag": "br", + "type": "ElementNode", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "source": null, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " USA ", + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "source": null, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "source": null, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "modifiers": Array [], + "tag": "u", + "type": "ElementNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "section", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
Box 564, Disneyland

USA
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) strips leading and trailing whitespace from ElementNode nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "source": null, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 18, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) strips leading and trailing whitespace from ElementNode nodes 2`] = `"
{{foo}}
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) strips leading and trailing whitespace from Program nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "source": null, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 13, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) strips leading and trailing whitespace from Program nodes 2`] = `"{{foo}}"`; + exports[`HBS Minifier plugin collapses whitespace into single space character 1`] = ` Object { "blockParams": Array [], diff --git a/hbs-minifier-plugin.test.js b/hbs-minifier-plugin.test.js index 9a2dfceb..f994644d 100644 --- a/hbs-minifier-plugin.test.js +++ b/hbs-minifier-plugin.test.js @@ -1,6 +1,16 @@ 'use strict'; /* eslint-env jest */ +/* eslint-disable no-inner-declarations */ + +const multidepRequire = require('multidep')('multidep.json'); + +const DEFAULT = 'default'; +const versions = [DEFAULT]; +multidepRequire.forEachVersion('@glimmer/syntax', function(version) { + versions.push(version); +}); + const defaultConfig = { skip: { elements: ['pre', 'address'], @@ -8,64 +18,73 @@ const defaultConfig = { components: ['foo-bar', 'no-minify'] } }; + const HbsMinifierPlugin = require('./hbs-minifier-plugin')(defaultConfig); -describe('HBS Minifier plugin', () => { - const glimmer = require('@glimmer/syntax'); +for (let version of versions) { + let moduleName = 'HBS Minifier plugin'; + if (version !== DEFAULT) { + moduleName += ` (with @glimmer/syntax v${version})`; + } - it('collapses whitespace into single space character', () => { - assert(`{{foo}} \n\n \n{{bar}}`); - }); + describe(moduleName, () => { + const glimmer = version === DEFAULT ? + require('@glimmer/syntax') : + multidepRequire('@glimmer/syntax', version); - it('strips leading and trailing whitespace from Program nodes', function() { - assert(` {{foo}} `); - }); + it('collapses whitespace into single space character', () => { + assert(`{{foo}} \n\n \n{{bar}}`); + }); - it('does not strip leading/trailing text from Program nodes', function() { - assert(`x {{foo}} y `); - }); + it('strips leading and trailing whitespace from Program nodes', function() { + assert(` {{foo}} `); + }); - it('strips leading and trailing whitespace from ElementNode nodes', function() { - assert(`
{{foo}}
`); - }); + it('does not strip leading/trailing text from Program nodes', function() { + assert(`x {{foo}} y `); + }); - it('does not strip leading/trailing text from ElementNode nodes', function() { - assert(`
x {{foo}} y
`); - }); + it('strips leading and trailing whitespace from ElementNode nodes', function() { + assert(`
{{foo}}
`); + }); - it('does not strip inside of
 tags', function() {
-    assert(`
        {{foo}}        
`); - }); + it('does not strip leading/trailing text from ElementNode nodes', function() { + assert(`
x {{foo}} y
`); + }); - it('does not collapse whitespace inside of
 tags', function() {
-    assert(`
  \n\n   \n
`); - }); + it('does not strip inside of
 tags', function() {
+      assert(`
        {{foo}}        
`); + }); - it('does not strip inside of {{#no-minify}} tags', function() { - assert(`{{#no-minify}} {{foo}} {{/no-minify}}`); - }); + it('does not collapse whitespace inside of
 tags', function() {
+      assert(`
  \n\n   \n
`); + }); - it('does not strip inside of {{#no-minify}} tags in other tags', function() { - assert(`
{{#no-minify}} {{foo}} {{/no-minify}}
`); - }); + it('does not strip inside of {{#no-minify}} tags', function() { + assert(`{{#no-minify}} {{foo}} {{/no-minify}}`); + }); - it('does not collapse whitespace inside of {{#no-minify}} tags in other tags', function() { - assert(`
{{#no-minify}} \n\n \n{{/no-minify}}
`); - }); + it('does not strip inside of {{#no-minify}} tags in other tags', function() { + assert(`
{{#no-minify}} {{foo}} {{/no-minify}}
`); + }); - it('does not collapse multiple   textNode into a single whitespace', function() { - assert(`1  2`); - }); + it('does not collapse whitespace inside of {{#no-minify}} tags in other tags', function() { + assert(`
{{#no-minify}} \n\n \n{{/no-minify}}
`); + }); + + it('does not collapse multiple   textNode into a single whitespace', function() { + assert(`1  2`); + }); - it('does not collapse   surrounding a text content into a single whitespace', function() { - assert(`
+ it('does not collapse   surrounding a text content into a single whitespace', function() { + assert(`
 1  2
`); - }); + }); - it('does not minify `tagNames` specified in .hbs-minifyrc.js', function() { - assert(`
+ it('does not minify `tagNames` specified in .hbs-minifyrc.js', function() { + assert(`
Box 564, Disneyland @@ -73,27 +92,27 @@ describe('HBS Minifier plugin', () => {
USA
`); - }); + }); - it('does not minify `classNames` specified in .hbs-minifyrc.js', function() { - assert(`
+ it('does not minify `classNames` specified in .hbs-minifyrc.js', function() { + assert(`
1 2
`); - }); + }); - it('does not minify `components` specified in .hbs-minifyrc.js', function() { - assert(`{{#foo-bar}} + it('does not minify `components` specified in .hbs-minifyrc.js', function() { + assert(`{{#foo-bar}} yield content {{/foo-bar}}`); - }); + }); - it('minifies `tagNames` that are not specified in .hbs-minifyrc.js', function() { - assert(`
+ it('minifies `tagNames` that are not specified in .hbs-minifyrc.js', function() { + assert(`
Box 564, Disneyland @@ -101,41 +120,42 @@ describe('HBS Minifier plugin', () => {
USA
`); - }); + }); - it('minifies `classNames` that are not specified in .hbs-minifyrc.js', function() { - assert(`
+ it('minifies `classNames` that are not specified in .hbs-minifyrc.js', function() { + assert(`
John Smith (Entrepreneur)
`); - }); + }); - it('minifies `components` that are not specified in .hbs-minifyrc.js', function() { - assert(`{{#my-component}} + it('minifies `components` that are not specified in .hbs-minifyrc.js', function() { + assert(`{{#my-component}} yield content {{/my-component}}`); - }); - - function assert(template) { - let ast = process(template); - expect(ast).toMatchSnapshot(); - - let printed = glimmer.print(ast); - expect(printed).toMatchSnapshot(); - } - - function process(template) { - let plugin = () => { - return HbsMinifierPlugin.createASTPlugin(defaultConfig.skip); - }; - return glimmer.preprocess(template, { - plugins: { - ast: [plugin] - } }); - } -}); + + function assert(template) { + let ast = process(template); + expect(ast).toMatchSnapshot(); + + let printed = glimmer.print(ast); + expect(printed).toMatchSnapshot(); + } + + function process(template) { + let plugin = () => { + return HbsMinifierPlugin.createASTPlugin(defaultConfig.skip); + }; + return glimmer.preprocess(template, { + plugins: { + ast: [plugin] + } + }); + } + }); +} diff --git a/multidep.json b/multidep.json new file mode 100644 index 00000000..c3a821cd --- /dev/null +++ b/multidep.json @@ -0,0 +1,8 @@ +{ + "path": "multidep_modules", + "versions": { + "@glimmer/syntax": [ + "0.33.0" + ] + } +} diff --git a/package.json b/package.json index 7d030561..b1ad311e 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,8 @@ "eslint": "^5.16.0", "eslint-config-simplabs": "0.4.0", "jest": "^24.1.0", - "loader.js": "^4.2.3" + "loader.js": "^4.2.3", + "multidep": "github:Turbo87/node-multidep#mkdirp" }, "dependencies": { "object-hash": "1.3.1" diff --git a/yarn.lock b/yarn.lock index d5321e23..5a5921e9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6576,6 +6576,15 @@ ms@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" +"multidep@github:Turbo87/node-multidep#mkdirp": + version "2.0.2" + resolved "https://codeload.github.com/Turbo87/node-multidep/tar.gz/566a5f8aa3380cb6e6d2743e3fb83aa5ba6b7de1" + dependencies: + mkdirp "^0.5.1" + rimraf "^2.4.3" + rsvp "^3.1.0" + spawn-cmd "0.0.2" + mustache@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/mustache/-/mustache-3.0.1.tgz#873855f23aa8a95b150fb96d9836edbc5a1d248a" @@ -7698,7 +7707,7 @@ rollup@^0.41.4: dependencies: source-map-support "^0.4.0" -rsvp@^3.0.14, rsvp@^3.0.17, rsvp@^3.0.18, rsvp@^3.0.21, rsvp@^3.0.6: +rsvp@^3.0.14, rsvp@^3.0.17, rsvp@^3.0.18, rsvp@^3.0.21, rsvp@^3.0.6, rsvp@^3.1.0: version "3.6.2" resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-3.6.2.tgz#2e96491599a96cde1b515d5674a8f7a91452926a" @@ -8045,6 +8054,11 @@ spawn-args@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/spawn-args/-/spawn-args-0.2.0.tgz#fb7d0bd1d70fd4316bd9e3dec389e65f9d6361bb" +spawn-cmd@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/spawn-cmd/-/spawn-cmd-0.0.2.tgz#6d5e251fad0eab00b0f193d245669a7a228ec0de" + integrity sha1-bV4lH60OqwCw8ZPSRWaaeiKOwN4= + spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" From c9290894b1c66674dde42cb2255d11a9377e5063 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 28 Apr 2019 12:06:51 +0200 Subject: [PATCH 3/9] Update `@glimmer/syntax` to v0.35.11 This is the version used by the latest Ember v3.4.x release --- .../hbs-minifier-plugin.test.js.snap | 33 ++++++++++++-- package.json | 2 +- yarn.lock | 45 ++++++++++--------- 3 files changed, 55 insertions(+), 25 deletions(-) diff --git a/__snapshots__/hbs-minifier-plugin.test.js.snap b/__snapshots__/hbs-minifier-plugin.test.js.snap index bb0c6c98..66276838 100644 --- a/__snapshots__/hbs-minifier-plugin.test.js.snap +++ b/__snapshots__/hbs-minifier-plugin.test.js.snap @@ -2393,6 +2393,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "span", "type": "ElementNode", }, @@ -2444,6 +2445,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "span", "type": "ElementNode", }, @@ -2461,6 +2463,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "div", "type": "ElementNode", }, @@ -2480,7 +2483,7 @@ Object { } `; -exports[`HBS Minifier plugin does not collapse   surrounding a text content into a single whitespace 2`] = `"
 1  2
"`; +exports[`HBS Minifier plugin does not collapse   surrounding a text content into a single whitespace 2`] = `"
 1  2
"`; exports[`HBS Minifier plugin does not collapse multiple   textNode into a single whitespace 1`] = ` Object { @@ -2519,6 +2522,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "span", "type": "ElementNode", }, @@ -2570,6 +2574,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "span", "type": "ElementNode", }, @@ -2589,7 +2594,7 @@ Object { } `; -exports[`HBS Minifier plugin does not collapse multiple   textNode into a single whitespace 2`] = `"1  2"`; +exports[`HBS Minifier plugin does not collapse multiple   textNode into a single whitespace 2`] = `"1  2"`; exports[`HBS Minifier plugin does not collapse whitespace inside of
 tags 1`] = `
 Object {
@@ -2631,6 +2636,7 @@ Object {
         },
       },
       "modifiers": Array [],
+      "selfClosing": false,
       "tag": "pre",
       "type": "ElementNode",
     },
@@ -2697,6 +2703,7 @@ Object {
         },
       },
       "modifiers": Array [],
+      "selfClosing": false,
       "tag": "div",
       "type": "ElementNode",
     },
@@ -2814,6 +2821,7 @@ Object {
             },
           },
           "modifiers": Array [],
+          "selfClosing": false,
           "tag": "span",
           "type": "ElementNode",
         },
@@ -2847,6 +2855,7 @@ Object {
         },
       },
       "modifiers": Array [],
+      "selfClosing": false,
       "tag": "div",
       "type": "ElementNode",
     },
@@ -2981,6 +2990,7 @@ Object {
               },
             },
             "modifiers": Array [],
+            "selfClosing": false,
             "tag": "span",
             "type": "ElementNode",
           },
@@ -3099,6 +3109,7 @@ Object {
             },
           },
           "modifiers": Array [],
+          "selfClosing": false,
           "tag": "b",
           "type": "ElementNode",
         },
@@ -3135,6 +3146,7 @@ Object {
             },
           },
           "modifiers": Array [],
+          "selfClosing": false,
           "tag": "br",
           "type": "ElementNode",
         },
@@ -3187,6 +3199,7 @@ Object {
             },
           },
           "modifiers": Array [],
+          "selfClosing": false,
           "tag": "u",
           "type": "ElementNode",
         },
@@ -3220,6 +3233,7 @@ Object {
         },
       },
       "modifiers": Array [],
+      "selfClosing": false,
       "tag": "address",
       "type": "ElementNode",
     },
@@ -3245,7 +3259,7 @@ exports[`HBS Minifier plugin does not minify \`tagNames\` specified in .hbs-mini
   
     Disneyland
   
-  

+
USA
" `; @@ -3353,6 +3367,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "pre", "type": "ElementNode", }, @@ -3580,6 +3595,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "div", "type": "ElementNode", }, @@ -3704,6 +3720,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "div", "type": "ElementNode", }, @@ -3915,6 +3932,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "i", "type": "ElementNode", }, @@ -3932,6 +3950,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "div", "type": "ElementNode", }, @@ -4042,6 +4061,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "span", "type": "ElementNode", }, @@ -4135,6 +4155,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "b", "type": "ElementNode", }, @@ -4170,6 +4191,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "br", "type": "ElementNode", }, @@ -4221,6 +4243,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "u", "type": "ElementNode", }, @@ -4238,6 +4261,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "section", "type": "ElementNode", }, @@ -4257,7 +4281,7 @@ Object { } `; -exports[`HBS Minifier plugin minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
Box 564, Disneyland

USA
"`; +exports[`HBS Minifier plugin minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
Box 564, Disneyland
USA
"`; exports[`HBS Minifier plugin strips leading and trailing whitespace from ElementNode nodes 1`] = ` Object { @@ -4332,6 +4356,7 @@ Object { }, }, "modifiers": Array [], + "selfClosing": false, "tag": "div", "type": "ElementNode", }, diff --git a/package.json b/package.json index b1ad311e..65cd3c2e 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@ember/optional-features": "^0.7.0", - "@glimmer/syntax": "^0.33.0", + "@glimmer/syntax": "^0.35.11", "broccoli-asset-rev": "^2.4.5", "ember-cli": "~3.9.0", "ember-cli-babel": "^6.11.0", diff --git a/yarn.lock b/yarn.lock index 5a5921e9..a55b5c77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -722,11 +722,12 @@ version "0.2.0" resolved "https://registry.yarnpkg.com/@glimmer/di/-/di-0.2.0.tgz#73bfd4a6ee4148a80bf092e8a5d29bcac9d4ce7e" -"@glimmer/interfaces@^0.33.0": - version "0.33.0" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.33.0.tgz#bbf58422e15d6a1f11d917516ba92a0e5185711d" +"@glimmer/interfaces@^0.35.11": + version "0.35.11" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.35.11.tgz#063a6fd1af1f660604c9f9d3d93fbc1f6509777a" + integrity sha512-0+SiWocsjh6uwEgqsHHcTuvO21/rXfWtS+C+LPqrdELR0miXJHG32PZeknK0S9Hyvn8Y1c6kefRw83vwyV4zFA== dependencies: - "@glimmer/wire-format" "^0.33.0" + "@glimmer/wire-format" "^0.35.11" "@glimmer/resolver@^0.4.1": version "0.4.3" @@ -734,24 +735,27 @@ dependencies: "@glimmer/di" "^0.2.0" -"@glimmer/syntax@^0.33.0": - version "0.33.0" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.33.0.tgz#5def8048e282f2ad7d77cdfa8859b2f292cdb697" +"@glimmer/syntax@^0.35.11": + version "0.35.11" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.35.11.tgz#4080d15f4ba64b5a96069c6dcc9ed7f81c428cd2" + integrity sha512-Hk27mqz14ccyFVtmEO5mfAB+1S8Hi+mzQp5vrTWXPOAV0IIiR0LnThVWzbRvprCP9GAgZbeNxWCuLT8KBoQrfw== dependencies: - "@glimmer/interfaces" "^0.33.0" - "@glimmer/util" "^0.33.0" + "@glimmer/interfaces" "^0.35.11" + "@glimmer/util" "^0.35.11" handlebars "^4.0.6" - simple-html-tokenizer "^0.4.1" + simple-html-tokenizer "^0.5.5" -"@glimmer/util@^0.33.0": - version "0.33.0" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.33.0.tgz#8271fbcb59989f8475c316887d49b622b84a2dfa" +"@glimmer/util@^0.35.11": + version "0.35.11" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.35.11.tgz#cd805c1c5cbc6e8ffa3d05aed4e9ec8aa2b291d7" + integrity sha512-Jb/QWnHgy9WMLQuh4eOEe9dPEPDCFTaUXqFTi0RA3/gre1XSSsCz7d492MI4trng0hH3mNHmacT9ppkBUjx9MQ== -"@glimmer/wire-format@^0.33.0": - version "0.33.0" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.33.0.tgz#e3e42ec205a5bf7fd9349b79da4632df999dbe45" +"@glimmer/wire-format@^0.35.11": + version "0.35.11" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.35.11.tgz#43fc2499cfdca657fc60ee5f7ce02ed3f6e3cb0d" + integrity sha512-Ovwp9MjBRttBkdU2NLYx2swHOS/MVrAG4fpouaInobKI/FFFMSltbm8HcoYD2QOneuWD0fLQdePaxKsoPLTQlQ== dependencies: - "@glimmer/util" "^0.33.0" + "@glimmer/util" "^0.35.11" "@jest/console@^24.7.1": version "24.7.1" @@ -7879,9 +7883,10 @@ silent-error@^1.0.0, silent-error@^1.0.1, silent-error@^1.1.0, silent-error@^1.1 dependencies: debug "^2.2.0" -simple-html-tokenizer@^0.4.1: - version "0.4.3" - resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.4.3.tgz#9b00b766e30058b4bb377c0d4f97566a13ab1be1" +simple-html-tokenizer@^0.5.5: + version "0.5.7" + resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.5.7.tgz#8eca336ecfbe2b3c6166cbb31b2682088de79f40" + integrity sha512-APW9iYbkJ5cijjX4Ljhf3VG8SwYPUJT5gZrwci/wieMabQxWFiV5VwsrP5c6GMRvXKEQMGkAB1d9dvW66dTqpg== sisteransi@^1.0.0: version "1.0.0" From 6d18996db7fe445cfdaf77169334e84720d23504 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 28 Apr 2019 12:07:46 +0200 Subject: [PATCH 4/9] Add `@glimmer/syntax` v0.35.11 to `multidep` scenarios --- .../hbs-minifier-plugin.test.js.snap | 2238 +++++++++++++++++ multidep.json | 1 + 2 files changed, 2239 insertions(+) diff --git a/__snapshots__/hbs-minifier-plugin.test.js.snap b/__snapshots__/hbs-minifier-plugin.test.js.snap index 66276838..8f1ae6c6 100644 --- a/__snapshots__/hbs-minifier-plugin.test.js.snap +++ b/__snapshots__/hbs-minifier-plugin.test.js.snap @@ -2213,6 +2213,2244 @@ Object { exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) strips leading and trailing whitespace from Program nodes 2`] = `"{{foo}}"`; +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) collapses whitespace into single space character 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 5, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "source": null, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 5, + "line": 4, + }, + "source": undefined, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "original": "bar", + "parts": Array [ + "bar", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) collapses whitespace into single space character 2`] = `"{{foo}} {{bar}}"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not collapse   surrounding a text content into a single whitespace 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "  1  ", + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "source": null, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "source": null, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " 2 ", + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "source": null, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not collapse   surrounding a text content into a single whitespace 2`] = `"
 1  2
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not collapse multiple   textNode into a single whitespace 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "1", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "source": null, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": "  ", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "source": null, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "2", + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "source": null, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "source": null, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not collapse multiple   textNode into a single whitespace 2`] = `"1  2"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not collapse whitespace inside of
 tags 1`] = `
+Object {
+  "blockParams": Array [],
+  "body": Array [
+    Object {
+      "attributes": Array [],
+      "blockParams": Array [],
+      "children": Array [
+        Object {
+          "chars": "  
+
+   
+",
+          "loc": Object {
+            "end": Object {
+              "column": 0,
+              "line": 4,
+            },
+            "source": null,
+            "start": Object {
+              "column": 5,
+              "line": 1,
+            },
+          },
+          "type": "TextNode",
+        },
+      ],
+      "comments": Array [],
+      "loc": Object {
+        "end": Object {
+          "column": 6,
+          "line": 4,
+        },
+        "source": null,
+        "start": Object {
+          "column": 0,
+          "line": 1,
+        },
+      },
+      "modifiers": Array [],
+      "selfClosing": false,
+      "tag": "pre",
+      "type": "ElementNode",
+    },
+  ],
+  "loc": Object {
+    "end": Object {
+      "column": 6,
+      "line": 4,
+    },
+    "source": null,
+    "start": Object {
+      "column": 0,
+      "line": 1,
+    },
+  },
+  "type": "Program",
+}
+`;
+
+exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not collapse whitespace inside of 
 tags 2`] = `
+"
  
+
+   
+
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not collapse whitespace inside of {{#no-minify}} tags in other tags 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + + +", + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "source": null, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not collapse whitespace inside of {{#no-minify}} tags in other tags 2`] = ` +"
+ + +
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not minify \`classNames\` specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "source": null, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "class", + "type": "AttrNode", + "value": Object { + "chars": "description", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "source": null, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "type": "TextNode", + }, + }, + ], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + 1 + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + 2 + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": " +", + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "source": null, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not minify \`classNames\` specified in .hbs-minifyrc.js 2`] = ` +"
+ 1 + + 2 + +
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not minify \`components\` specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "inverse": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 10, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "original": "foo-bar", + "parts": Array [ + "foo-bar", + ], + "this": false, + "type": "PathExpression", + }, + "program": Object { + "blockParams": Array [], + "body": Array [ + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 2, + }, + "source": null, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + yield content + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "source": null, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "source": null, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": " +", + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "source": null, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "type": "TextNode", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "source": null, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "type": "Program", + }, + "type": "BlockStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not minify \`components\` specified in .hbs-minifyrc.js 2`] = ` +"{{#foo-bar}} + yield content + +{{/foo-bar}}" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not minify \`tagNames\` specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + Box 564, + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + Disneyland + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "b", + "type": "ElementNode", + }, + Object { + "chars": " + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "source": null, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "br", + "type": "ElementNode", + }, + Object { + "chars": " + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "source": null, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " USA ", + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "source": null, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "source": null, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "u", + "type": "ElementNode", + }, + Object { + "chars": " +", + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "source": null, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "address", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not minify \`tagNames\` specified in .hbs-minifyrc.js 2`] = ` +"
+ Box 564, + + Disneyland + +
+ USA +
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip inside of
 tags 1`] = `
+Object {
+  "blockParams": Array [],
+  "body": Array [
+    Object {
+      "attributes": Array [],
+      "blockParams": Array [],
+      "children": Array [
+        Object {
+          "chars": "        ",
+          "loc": Object {
+            "end": Object {
+              "column": 13,
+              "line": 1,
+            },
+            "source": null,
+            "start": Object {
+              "column": 5,
+              "line": 1,
+            },
+          },
+          "type": "TextNode",
+        },
+        Object {
+          "escaped": true,
+          "hash": Object {
+            "loc": Object {
+              "end": Object {
+                "column": 0,
+                "line": 1,
+              },
+              "source": "(synthetic)",
+              "start": Object {
+                "column": 0,
+                "line": 1,
+              },
+            },
+            "pairs": Array [],
+            "type": "Hash",
+          },
+          "loc": Object {
+            "end": Object {
+              "column": 20,
+              "line": 1,
+            },
+            "source": null,
+            "start": Object {
+              "column": 13,
+              "line": 1,
+            },
+          },
+          "params": Array [],
+          "path": Object {
+            "data": false,
+            "loc": SourceLocation {
+              "end": Object {
+                "column": 18,
+                "line": 1,
+              },
+              "source": undefined,
+              "start": Object {
+                "column": 15,
+                "line": 1,
+              },
+            },
+            "original": "foo",
+            "parts": Array [
+              "foo",
+            ],
+            "this": false,
+            "type": "PathExpression",
+          },
+          "type": "MustacheStatement",
+        },
+        Object {
+          "chars": "        ",
+          "loc": Object {
+            "end": Object {
+              "column": 28,
+              "line": 1,
+            },
+            "source": null,
+            "start": Object {
+              "column": 20,
+              "line": 1,
+            },
+          },
+          "type": "TextNode",
+        },
+      ],
+      "comments": Array [],
+      "loc": Object {
+        "end": Object {
+          "column": 34,
+          "line": 1,
+        },
+        "source": null,
+        "start": Object {
+          "column": 0,
+          "line": 1,
+        },
+      },
+      "modifiers": Array [],
+      "selfClosing": false,
+      "tag": "pre",
+      "type": "ElementNode",
+    },
+  ],
+  "loc": Object {
+    "end": Object {
+      "column": 34,
+      "line": 1,
+    },
+    "source": null,
+    "start": Object {
+      "column": 0,
+      "line": 1,
+    },
+  },
+  "type": "Program",
+}
+`;
+
+exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip inside of 
 tags 2`] = `"
        {{foo}}        
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip inside of {{#no-minify}} tags 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "source": null, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "source": null, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 27, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "source": null, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip inside of {{#no-minify}} tags 2`] = `" {{foo}} "`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip inside of {{#no-minify}} tags in other tags 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "source": null, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "source": null, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 32, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "source": null, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip inside of {{#no-minify}} tags in other tags 2`] = `"
{{foo}}
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip leading/trailing text from ElementNode nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "x ", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "source": null, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "source": null, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 19, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " y ", + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "source": null, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip leading/trailing text from ElementNode nodes 2`] = `"
x {{foo}} y
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip leading/trailing text from Program nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "chars": "x ", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "source": null, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 14, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " y ", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "source": null, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) does not strip leading/trailing text from Program nodes 2`] = `"x {{foo}} y "`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) minifies \`classNames\` that are not specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "source": null, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "class", + "type": "AttrNode", + "value": Object { + "chars": "contact-details", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "source": null, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "type": "TextNode", + }, + }, + ], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " John Smith ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " (Entrepreneur) ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "i", + "type": "ElementNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) minifies \`classNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
John Smith (Entrepreneur)
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) minifies \`components\` that are not specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "inverse": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 15, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "original": "my-component", + "parts": Array [ + "my-component", + ], + "this": false, + "type": "PathExpression", + }, + "program": Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " yield content ", + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "source": null, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "source": null, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "source": null, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "type": "Program", + }, + "type": "BlockStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) minifies \`components\` that are not specified in .hbs-minifyrc.js 2`] = `"{{#my-component}} yield content {{/my-component}}"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " Box 564, ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " Disneyland ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "b", + "type": "ElementNode", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "source": null, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "br", + "type": "ElementNode", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "source": null, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " USA ", + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "source": null, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "source": null, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "u", + "type": "ElementNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "section", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
Box 564, Disneyland
USA
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) strips leading and trailing whitespace from ElementNode nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "source": null, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 18, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) strips leading and trailing whitespace from ElementNode nodes 2`] = `"
{{foo}}
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) strips leading and trailing whitespace from Program nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "source": null, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 13, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) strips leading and trailing whitespace from Program nodes 2`] = `"{{foo}}"`; + exports[`HBS Minifier plugin collapses whitespace into single space character 1`] = ` Object { "blockParams": Array [], diff --git a/multidep.json b/multidep.json index c3a821cd..90af08b5 100644 --- a/multidep.json +++ b/multidep.json @@ -2,6 +2,7 @@ "path": "multidep_modules", "versions": { "@glimmer/syntax": [ + "0.35.11", "0.33.0" ] } From 5003633caaf68171c5a4b2ba356ed08c60f20cd8 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 28 Apr 2019 12:08:33 +0200 Subject: [PATCH 5/9] Update `@glimmer/syntax` to v0.37.1 This is the version used by the latest Ember v3.8.x release --- package.json | 2 +- yarn.lock | 50 ++++++++++++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 65cd3c2e..e135fdf5 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@ember/optional-features": "^0.7.0", - "@glimmer/syntax": "^0.35.11", + "@glimmer/syntax": "^0.37.1", "broccoli-asset-rev": "^2.4.5", "ember-cli": "~3.9.0", "ember-cli-babel": "^6.11.0", diff --git a/yarn.lock b/yarn.lock index a55b5c77..e8020394 100644 --- a/yarn.lock +++ b/yarn.lock @@ -722,12 +722,13 @@ version "0.2.0" resolved "https://registry.yarnpkg.com/@glimmer/di/-/di-0.2.0.tgz#73bfd4a6ee4148a80bf092e8a5d29bcac9d4ce7e" -"@glimmer/interfaces@^0.35.11": - version "0.35.11" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.35.11.tgz#063a6fd1af1f660604c9f9d3d93fbc1f6509777a" - integrity sha512-0+SiWocsjh6uwEgqsHHcTuvO21/rXfWtS+C+LPqrdELR0miXJHG32PZeknK0S9Hyvn8Y1c6kefRw83vwyV4zFA== +"@glimmer/interfaces@^0.37.1": + version "0.37.1" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.37.1.tgz#44328c49d835445fda26efa7c8d5463ee2e626ed" + integrity sha512-ys5I6iEeaPvSPY9dn6uc9NAh9HkL8fnUZjTHJhlKV5nFv5qqXhBK8hFE86fVXqGRtXLHfOa90pg75vLXgw7u/g== dependencies: - "@glimmer/wire-format" "^0.35.11" + "@glimmer/wire-format" "^0.37.1" + "@simple-dom/interface" "1.4.0" "@glimmer/resolver@^0.4.1": version "0.4.3" @@ -735,27 +736,27 @@ dependencies: "@glimmer/di" "^0.2.0" -"@glimmer/syntax@^0.35.11": - version "0.35.11" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.35.11.tgz#4080d15f4ba64b5a96069c6dcc9ed7f81c428cd2" - integrity sha512-Hk27mqz14ccyFVtmEO5mfAB+1S8Hi+mzQp5vrTWXPOAV0IIiR0LnThVWzbRvprCP9GAgZbeNxWCuLT8KBoQrfw== +"@glimmer/syntax@^0.37.1": + version "0.37.1" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.37.1.tgz#f3c507122f7c4b859ce712e0c5bbc43608ca12db" + integrity sha512-DtSRWrbZlgAvLOR62slBvMgUmcnYxfq4Jv5uqCqD4/DUrjV2ezmOMhDFW4zxAVz55luqx9/900XHYiUzsicPyA== dependencies: - "@glimmer/interfaces" "^0.35.11" - "@glimmer/util" "^0.35.11" + "@glimmer/interfaces" "^0.37.1" + "@glimmer/util" "^0.37.1" handlebars "^4.0.6" - simple-html-tokenizer "^0.5.5" + simple-html-tokenizer "^0.5.6" -"@glimmer/util@^0.35.11": - version "0.35.11" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.35.11.tgz#cd805c1c5cbc6e8ffa3d05aed4e9ec8aa2b291d7" - integrity sha512-Jb/QWnHgy9WMLQuh4eOEe9dPEPDCFTaUXqFTi0RA3/gre1XSSsCz7d492MI4trng0hH3mNHmacT9ppkBUjx9MQ== +"@glimmer/util@^0.37.1": + version "0.37.1" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.37.1.tgz#b6dafd36134556053121fc8a8ffceb68e490a4b5" + integrity sha512-Of58Of07fsT8JOkok/tXJvewEdI6LzDxdlIIcdhv6iOJgYUsJUQKUYf6XY+5o/rtsrByPQ5da2WwHbLAcpq0aQ== -"@glimmer/wire-format@^0.35.11": - version "0.35.11" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.35.11.tgz#43fc2499cfdca657fc60ee5f7ce02ed3f6e3cb0d" - integrity sha512-Ovwp9MjBRttBkdU2NLYx2swHOS/MVrAG4fpouaInobKI/FFFMSltbm8HcoYD2QOneuWD0fLQdePaxKsoPLTQlQ== +"@glimmer/wire-format@^0.37.1": + version "0.37.1" + resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.37.1.tgz#34906e320d38bc65b1730b5f78890b184211a0d5" + integrity sha512-iDj8D1eCVDmcsNUcz5epdOCN6Gt53W3cMsS2qAkf2H6REiXQ9kG7ySIGIdahNsLT/f21MT+JzqawylZR0hrw0w== dependencies: - "@glimmer/util" "^0.35.11" + "@glimmer/util" "^0.37.1" "@jest/console@^24.7.1": version "24.7.1" @@ -891,6 +892,11 @@ "@types/istanbul-lib-coverage" "^2.0.0" "@types/yargs" "^12.0.9" +"@simple-dom/interface@1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@simple-dom/interface/-/interface-1.4.0.tgz#e8feea579232017f89b0138e2726facda6fbb71f" + integrity sha512-l5qumKFWU0S+4ZzMaLXFU8tQZsicHEMEyAxI5kDFGhJsRqDwe0a7/iPA/GdxlGyDKseQQAgIz5kzU7eXTrlSpA== + "@sindresorhus/is@^0.7.0": version "0.7.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" @@ -7883,7 +7889,7 @@ silent-error@^1.0.0, silent-error@^1.0.1, silent-error@^1.1.0, silent-error@^1.1 dependencies: debug "^2.2.0" -simple-html-tokenizer@^0.5.5: +simple-html-tokenizer@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.5.7.tgz#8eca336ecfbe2b3c6166cbb31b2682088de79f40" integrity sha512-APW9iYbkJ5cijjX4Ljhf3VG8SwYPUJT5gZrwci/wieMabQxWFiV5VwsrP5c6GMRvXKEQMGkAB1d9dvW66dTqpg== From 84c507406cda82102faaedac63f23f6580133d97 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 28 Apr 2019 12:08:55 +0200 Subject: [PATCH 6/9] Add `@glimmer/syntax` v0.37.1 to `multidep` scenarios --- .../hbs-minifier-plugin.test.js.snap | 2238 +++++++++++++++++ multidep.json | 1 + 2 files changed, 2239 insertions(+) diff --git a/__snapshots__/hbs-minifier-plugin.test.js.snap b/__snapshots__/hbs-minifier-plugin.test.js.snap index 8f1ae6c6..b810eef1 100644 --- a/__snapshots__/hbs-minifier-plugin.test.js.snap +++ b/__snapshots__/hbs-minifier-plugin.test.js.snap @@ -4451,6 +4451,2244 @@ Object { exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) strips leading and trailing whitespace from Program nodes 2`] = `"{{foo}}"`; +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) collapses whitespace into single space character 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 5, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 2, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "source": null, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 4, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 5, + "line": 4, + }, + "source": undefined, + "start": Object { + "column": 2, + "line": 4, + }, + }, + "original": "bar", + "parts": Array [ + "bar", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 7, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) collapses whitespace into single space character 2`] = `"{{foo}} {{bar}}"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not collapse   surrounding a text content into a single whitespace 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "  1  ", + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "source": null, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "source": null, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 35, + "line": 2, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " 2 ", + "loc": Object { + "end": Object { + "column": 13, + "line": 3, + }, + "source": null, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 3, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not collapse   surrounding a text content into a single whitespace 2`] = `"
 1  2
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not collapse multiple   textNode into a single whitespace 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "1", + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "source": null, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": "  ", + "loc": Object { + "end": Object { + "column": 26, + "line": 1, + }, + "source": null, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "2", + "loc": Object { + "end": Object { + "column": 33, + "line": 1, + }, + "source": null, + "start": Object { + "column": 32, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "source": null, + "start": Object { + "column": 26, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 40, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not collapse multiple   textNode into a single whitespace 2`] = `"1  2"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not collapse whitespace inside of
 tags 1`] = `
+Object {
+  "blockParams": Array [],
+  "body": Array [
+    Object {
+      "attributes": Array [],
+      "blockParams": Array [],
+      "children": Array [
+        Object {
+          "chars": "  
+
+   
+",
+          "loc": Object {
+            "end": Object {
+              "column": 0,
+              "line": 4,
+            },
+            "source": null,
+            "start": Object {
+              "column": 5,
+              "line": 1,
+            },
+          },
+          "type": "TextNode",
+        },
+      ],
+      "comments": Array [],
+      "loc": Object {
+        "end": Object {
+          "column": 6,
+          "line": 4,
+        },
+        "source": null,
+        "start": Object {
+          "column": 0,
+          "line": 1,
+        },
+      },
+      "modifiers": Array [],
+      "selfClosing": false,
+      "tag": "pre",
+      "type": "ElementNode",
+    },
+  ],
+  "loc": Object {
+    "end": Object {
+      "column": 6,
+      "line": 4,
+    },
+    "source": null,
+    "start": Object {
+      "column": 0,
+      "line": 1,
+    },
+  },
+  "type": "Program",
+}
+`;
+
+exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not collapse whitespace inside of 
 tags 2`] = `
+"
  
+
+   
+
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not collapse whitespace inside of {{#no-minify}} tags in other tags 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + + +", + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "source": null, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 20, + "line": 4, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not collapse whitespace inside of {{#no-minify}} tags in other tags 2`] = ` +"
+ + +
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not minify \`classNames\` specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "source": null, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "class", + "type": "AttrNode", + "value": Object { + "chars": "description", + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "source": null, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "type": "TextNode", + }, + }, + ], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + 1 + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 25, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + 2 + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 8, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": " +", + "loc": Object { + "end": Object { + "column": 0, + "line": 6, + }, + "source": null, + "start": Object { + "column": 9, + "line": 5, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not minify \`classNames\` specified in .hbs-minifyrc.js 2`] = ` +"
+ 1 + + 2 + +
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not minify \`components\` specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "inverse": null, + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 10, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "original": "foo-bar", + "parts": Array [ + "foo-bar", + ], + "this": false, + "type": "PathExpression", + }, + "program": Object { + "blockParams": Array [], + "body": Array [ + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 2, + }, + "source": null, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + yield content + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "source": null, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "source": null, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + Object { + "chars": " +", + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "source": null, + "start": Object { + "column": 9, + "line": 4, + }, + }, + "type": "TextNode", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "source": null, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "type": "Program", + }, + "type": "BlockStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 12, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not minify \`components\` specified in .hbs-minifyrc.js 2`] = ` +"{{#foo-bar}} + yield content + +{{/foo-bar}}" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not minify \`tagNames\` specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + Box 564, + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " + Disneyland + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "b", + "type": "ElementNode", + }, + Object { + "chars": " + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "source": null, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "br", + "type": "ElementNode", + }, + Object { + "chars": " + ", + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "source": null, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " USA ", + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "source": null, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "source": null, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "u", + "type": "ElementNode", + }, + Object { + "chars": " +", + "loc": Object { + "end": Object { + "column": 0, + "line": 8, + }, + "source": null, + "start": Object { + "column": 14, + "line": 7, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "address", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not minify \`tagNames\` specified in .hbs-minifyrc.js 2`] = ` +"
+ Box 564, + + Disneyland + +
+ USA +
" +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip inside of
 tags 1`] = `
+Object {
+  "blockParams": Array [],
+  "body": Array [
+    Object {
+      "attributes": Array [],
+      "blockParams": Array [],
+      "children": Array [
+        Object {
+          "chars": "        ",
+          "loc": Object {
+            "end": Object {
+              "column": 13,
+              "line": 1,
+            },
+            "source": null,
+            "start": Object {
+              "column": 5,
+              "line": 1,
+            },
+          },
+          "type": "TextNode",
+        },
+        Object {
+          "escaped": true,
+          "hash": Object {
+            "loc": Object {
+              "end": Object {
+                "column": 0,
+                "line": 1,
+              },
+              "source": "(synthetic)",
+              "start": Object {
+                "column": 0,
+                "line": 1,
+              },
+            },
+            "pairs": Array [],
+            "type": "Hash",
+          },
+          "loc": Object {
+            "end": Object {
+              "column": 20,
+              "line": 1,
+            },
+            "source": null,
+            "start": Object {
+              "column": 13,
+              "line": 1,
+            },
+          },
+          "params": Array [],
+          "path": Object {
+            "data": false,
+            "loc": SourceLocation {
+              "end": Object {
+                "column": 18,
+                "line": 1,
+              },
+              "source": undefined,
+              "start": Object {
+                "column": 15,
+                "line": 1,
+              },
+            },
+            "original": "foo",
+            "parts": Array [
+              "foo",
+            ],
+            "this": false,
+            "type": "PathExpression",
+          },
+          "type": "MustacheStatement",
+        },
+        Object {
+          "chars": "        ",
+          "loc": Object {
+            "end": Object {
+              "column": 28,
+              "line": 1,
+            },
+            "source": null,
+            "start": Object {
+              "column": 20,
+              "line": 1,
+            },
+          },
+          "type": "TextNode",
+        },
+      ],
+      "comments": Array [],
+      "loc": Object {
+        "end": Object {
+          "column": 34,
+          "line": 1,
+        },
+        "source": null,
+        "start": Object {
+          "column": 0,
+          "line": 1,
+        },
+      },
+      "modifiers": Array [],
+      "selfClosing": false,
+      "tag": "pre",
+      "type": "ElementNode",
+    },
+  ],
+  "loc": Object {
+    "end": Object {
+      "column": 34,
+      "line": 1,
+    },
+    "source": null,
+    "start": Object {
+      "column": 0,
+      "line": 1,
+    },
+  },
+  "type": "Program",
+}
+`;
+
+exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip inside of 
 tags 2`] = `"
        {{foo}}        
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip inside of {{#no-minify}} tags 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "source": null, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 29, + "line": 1, + }, + "source": null, + "start": Object { + "column": 22, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 27, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 24, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 37, + "line": 1, + }, + "source": null, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "loc": Object { + "end": Object { + "column": 51, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip inside of {{#no-minify}} tags 2`] = `" {{foo}} "`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip inside of {{#no-minify}} tags in other tags 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 27, + "line": 1, + }, + "source": null, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "source": null, + "start": Object { + "column": 27, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 32, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 42, + "line": 1, + }, + "source": null, + "start": Object { + "column": 34, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip inside of {{#no-minify}} tags in other tags 2`] = `"
{{foo}}
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip leading/trailing text from ElementNode nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": "x ", + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "source": null, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 21, + "line": 1, + }, + "source": null, + "start": Object { + "column": 14, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 19, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " y ", + "loc": Object { + "end": Object { + "column": 30, + "line": 1, + }, + "source": null, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 36, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip leading/trailing text from ElementNode nodes 2`] = `"
x {{foo}} y
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip leading/trailing text from Program nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "chars": "x ", + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 1, + }, + "source": null, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 14, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + Object { + "chars": " y ", + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "source": null, + "start": Object { + "column": 16, + "line": 1, + }, + }, + "type": "TextNode", + }, + ], + "loc": Object { + "end": Object { + "column": 25, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) does not strip leading/trailing text from Program nodes 2`] = `"x {{foo}} y "`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) minifies \`classNames\` that are not specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [ + Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "source": null, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "class", + "type": "AttrNode", + "value": Object { + "chars": "contact-details", + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "source": null, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "type": "TextNode", + }, + }, + ], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " John Smith ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " (Entrepreneur) ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "i", + "type": "ElementNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) minifies \`classNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
John Smith (Entrepreneur)
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) minifies \`components\` that are not specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "inverse": null, + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 15, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "original": "my-component", + "parts": Array [ + "my-component", + ], + "this": false, + "type": "PathExpression", + }, + "program": Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " yield content ", + "loc": Object { + "end": Object { + "column": 2, + "line": 4, + }, + "source": null, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 9, + "line": 4, + }, + "source": null, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "span", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 5, + }, + "source": null, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "type": "Program", + }, + "type": "BlockStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 17, + "line": 5, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) minifies \`components\` that are not specified in .hbs-minifyrc.js 2`] = `"{{#my-component}} yield content {{/my-component}}"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " Box 564, ", + "loc": Object { + "end": Object { + "column": 2, + "line": 3, + }, + "source": null, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " Disneyland ", + "loc": Object { + "end": Object { + "column": 2, + "line": 5, + }, + "source": null, + "start": Object { + "column": 5, + "line": 3, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 5, + }, + "source": null, + "start": Object { + "column": 2, + "line": 3, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "b", + "type": "ElementNode", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "source": null, + "start": Object { + "column": 6, + "line": 5, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 6, + "line": 6, + }, + "source": null, + "start": Object { + "column": 2, + "line": 6, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "br", + "type": "ElementNode", + }, + Object { + "chars": " ", + "loc": Object { + "end": Object { + "column": 2, + "line": 7, + }, + "source": null, + "start": Object { + "column": 6, + "line": 6, + }, + }, + "type": "TextNode", + }, + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "chars": " USA ", + "loc": Object { + "end": Object { + "column": 10, + "line": 7, + }, + "source": null, + "start": Object { + "column": 5, + "line": 7, + }, + }, + "type": "TextNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 14, + "line": 7, + }, + "source": null, + "start": Object { + "column": 2, + "line": 7, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "u", + "type": "ElementNode", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "section", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 10, + "line": 8, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
Box 564, Disneyland
USA
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) strips leading and trailing whitespace from ElementNode nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "attributes": Array [], + "blockParams": Array [], + "children": Array [ + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 20, + "line": 1, + }, + "source": null, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 18, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 15, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "modifiers": Array [], + "selfClosing": false, + "tag": "div", + "type": "ElementNode", + }, + ], + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) strips leading and trailing whitespace from ElementNode nodes 2`] = `"
{{foo}}
"`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) strips leading and trailing whitespace from Program nodes 1`] = ` +Object { + "blockParams": Array [], + "body": Array [ + Object { + "escaped": true, + "hash": Object { + "loc": Object { + "end": Object { + "column": 0, + "line": 1, + }, + "source": "(synthetic)", + "start": Object { + "column": 0, + "line": 1, + }, + }, + "pairs": Array [], + "type": "Hash", + }, + "loc": Object { + "end": Object { + "column": 15, + "line": 1, + }, + "source": null, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [], + "path": Object { + "data": false, + "loc": SourceLocation { + "end": Object { + "column": 13, + "line": 1, + }, + "source": undefined, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "original": "foo", + "parts": Array [ + "foo", + ], + "this": false, + "type": "PathExpression", + }, + "type": "MustacheStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 23, + "line": 1, + }, + "source": null, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "type": "Program", +} +`; + +exports[`HBS Minifier plugin (with @glimmer/syntax v0.37.1) strips leading and trailing whitespace from Program nodes 2`] = `"{{foo}}"`; + exports[`HBS Minifier plugin collapses whitespace into single space character 1`] = ` Object { "blockParams": Array [], diff --git a/multidep.json b/multidep.json index 90af08b5..45567573 100644 --- a/multidep.json +++ b/multidep.json @@ -2,6 +2,7 @@ "path": "multidep_modules", "versions": { "@glimmer/syntax": [ + "0.37.1", "0.35.11", "0.33.0" ] From ec208c2daa929a1480cfead9e5e017269f3346ab Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 28 Apr 2019 12:13:42 +0200 Subject: [PATCH 7/9] Update `@glimmer/syntax` to v0.40.1 --- .../hbs-minifier-plugin.test.js.snap | 40 +++++++------- package.json | 2 +- yarn.lock | 54 +++++++------------ 3 files changed, 41 insertions(+), 55 deletions(-) diff --git a/__snapshots__/hbs-minifier-plugin.test.js.snap b/__snapshots__/hbs-minifier-plugin.test.js.snap index b810eef1..e66698aa 100644 --- a/__snapshots__/hbs-minifier-plugin.test.js.snap +++ b/__snapshots__/hbs-minifier-plugin.test.js.snap @@ -6822,7 +6822,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -6955,7 +6955,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -7066,7 +7066,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -7128,7 +7128,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -7195,7 +7195,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -7347,7 +7347,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -7498,7 +7498,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Block", }, "type": "BlockStatement", }, @@ -7514,7 +7514,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -7725,7 +7725,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -7859,7 +7859,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -7962,7 +7962,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -8087,7 +8087,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -8212,7 +8212,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -8315,7 +8315,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -8442,7 +8442,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -8553,7 +8553,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Block", }, "type": "BlockStatement", }, @@ -8569,7 +8569,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -8753,7 +8753,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -8848,7 +8848,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; @@ -8921,7 +8921,7 @@ Object { "line": 1, }, }, - "type": "Program", + "type": "Template", } `; diff --git a/package.json b/package.json index e135fdf5..e5fd1a5c 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "devDependencies": { "@ember/optional-features": "^0.7.0", - "@glimmer/syntax": "^0.37.1", + "@glimmer/syntax": "^0.40.1", "broccoli-asset-rev": "^2.4.5", "ember-cli": "~3.9.0", "ember-cli-babel": "^6.11.0", diff --git a/yarn.lock b/yarn.lock index e8020394..938b7108 100644 --- a/yarn.lock +++ b/yarn.lock @@ -722,13 +722,10 @@ version "0.2.0" resolved "https://registry.yarnpkg.com/@glimmer/di/-/di-0.2.0.tgz#73bfd4a6ee4148a80bf092e8a5d29bcac9d4ce7e" -"@glimmer/interfaces@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.37.1.tgz#44328c49d835445fda26efa7c8d5463ee2e626ed" - integrity sha512-ys5I6iEeaPvSPY9dn6uc9NAh9HkL8fnUZjTHJhlKV5nFv5qqXhBK8hFE86fVXqGRtXLHfOa90pg75vLXgw7u/g== - dependencies: - "@glimmer/wire-format" "^0.37.1" - "@simple-dom/interface" "1.4.0" +"@glimmer/interfaces@^0.40.1": + version "0.40.1" + resolved "https://registry.yarnpkg.com/@glimmer/interfaces/-/interfaces-0.40.1.tgz#eb767718c47872243db50c993700a385940c2cb2" + integrity sha512-gk+3Ij3hrJHPBJpCQE1wF54sh4M/NRx/JOJOhCzsyrf488IDnw2v93ZDEwBd7O3EcQDaRZMOQq6M3FNh/0YZpw== "@glimmer/resolver@^0.4.1": version "0.4.3" @@ -736,27 +733,20 @@ dependencies: "@glimmer/di" "^0.2.0" -"@glimmer/syntax@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.37.1.tgz#f3c507122f7c4b859ce712e0c5bbc43608ca12db" - integrity sha512-DtSRWrbZlgAvLOR62slBvMgUmcnYxfq4Jv5uqCqD4/DUrjV2ezmOMhDFW4zxAVz55luqx9/900XHYiUzsicPyA== +"@glimmer/syntax@^0.40.1": + version "0.40.1" + resolved "https://registry.yarnpkg.com/@glimmer/syntax/-/syntax-0.40.1.tgz#6c387ca8d3080350c039092586adba37ba2bf351" + integrity sha512-lZ0xv9wNBVt1tteWszQy+PZbVi8v1vmlYjCTU9s/q2H1khrnVe6VYvicVapGATqlMQ84reRqJkQKdgfpy+ig6A== dependencies: - "@glimmer/interfaces" "^0.37.1" - "@glimmer/util" "^0.37.1" - handlebars "^4.0.6" - simple-html-tokenizer "^0.5.6" - -"@glimmer/util@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.37.1.tgz#b6dafd36134556053121fc8a8ffceb68e490a4b5" - integrity sha512-Of58Of07fsT8JOkok/tXJvewEdI6LzDxdlIIcdhv6iOJgYUsJUQKUYf6XY+5o/rtsrByPQ5da2WwHbLAcpq0aQ== + "@glimmer/interfaces" "^0.40.1" + "@glimmer/util" "^0.40.1" + handlebars "^4.0.13" + simple-html-tokenizer "^0.5.7" -"@glimmer/wire-format@^0.37.1": - version "0.37.1" - resolved "https://registry.yarnpkg.com/@glimmer/wire-format/-/wire-format-0.37.1.tgz#34906e320d38bc65b1730b5f78890b184211a0d5" - integrity sha512-iDj8D1eCVDmcsNUcz5epdOCN6Gt53W3cMsS2qAkf2H6REiXQ9kG7ySIGIdahNsLT/f21MT+JzqawylZR0hrw0w== - dependencies: - "@glimmer/util" "^0.37.1" +"@glimmer/util@^0.40.1": + version "0.40.1" + resolved "https://registry.yarnpkg.com/@glimmer/util/-/util-0.40.1.tgz#e4bd667d36422261248df039dd46bfe963655bd3" + integrity sha512-YuV7hhjrPi/2YYc+GCyOBzrG1xSolQ4Fg/dkQdpDkTA03UkC9BiCQRxbOK4SjlV9IuBSEIv/Is6BOfkQ8hhX2g== "@jest/console@^24.7.1": version "24.7.1" @@ -892,11 +882,6 @@ "@types/istanbul-lib-coverage" "^2.0.0" "@types/yargs" "^12.0.9" -"@simple-dom/interface@1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@simple-dom/interface/-/interface-1.4.0.tgz#e8feea579232017f89b0138e2726facda6fbb71f" - integrity sha512-l5qumKFWU0S+4ZzMaLXFU8tQZsicHEMEyAxI5kDFGhJsRqDwe0a7/iPA/GdxlGyDKseQQAgIz5kzU7eXTrlSpA== - "@sindresorhus/is@^0.7.0": version "0.7.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd" @@ -4627,9 +4612,10 @@ growly@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" -handlebars@^4.0.11: +handlebars@^4.0.11, handlebars@^4.0.13: version "4.1.2" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== dependencies: neo-async "^2.6.0" optimist "^0.6.1" @@ -4637,7 +4623,7 @@ handlebars@^4.0.11: optionalDependencies: uglify-js "^3.1.4" -handlebars@^4.0.4, handlebars@^4.0.6, handlebars@^4.1.0: +handlebars@^4.0.4, handlebars@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.0.tgz#0d6a6f34ff1f63cecec8423aa4169827bf787c3a" dependencies: @@ -7889,7 +7875,7 @@ silent-error@^1.0.0, silent-error@^1.0.1, silent-error@^1.1.0, silent-error@^1.1 dependencies: debug "^2.2.0" -simple-html-tokenizer@^0.5.6: +simple-html-tokenizer@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/simple-html-tokenizer/-/simple-html-tokenizer-0.5.7.tgz#8eca336ecfbe2b3c6166cbb31b2682088de79f40" integrity sha512-APW9iYbkJ5cijjX4Ljhf3VG8SwYPUJT5gZrwci/wieMabQxWFiV5VwsrP5c6GMRvXKEQMGkAB1d9dvW66dTqpg== From 6ef90d0c70690e5ac2a61ae6d41d07f9c2e6104a Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 28 Apr 2019 12:19:27 +0200 Subject: [PATCH 8/9] Remove `@glimmer/syntax` v0.33.0 from `multidep` scenarios This is no longer used by any of our supported Ember versions --- .../hbs-minifier-plugin.test.js.snap | 2213 ----------------- multidep.json | 3 +- 2 files changed, 1 insertion(+), 2215 deletions(-) diff --git a/__snapshots__/hbs-minifier-plugin.test.js.snap b/__snapshots__/hbs-minifier-plugin.test.js.snap index e66698aa..15f5d4d7 100644 --- a/__snapshots__/hbs-minifier-plugin.test.js.snap +++ b/__snapshots__/hbs-minifier-plugin.test.js.snap @@ -1,2218 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) collapses whitespace into single space character 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "escaped": true, - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 5, - "line": 1, - }, - "source": undefined, - "start": Object { - "column": 2, - "line": 1, - }, - }, - "original": "foo", - "parts": Array [ - "foo", - ], - "this": false, - "type": "PathExpression", - }, - "type": "MustacheStatement", - }, - Object { - "chars": " ", - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "source": null, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "escaped": true, - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 4, - }, - "source": null, - "start": Object { - "column": 0, - "line": 4, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 5, - "line": 4, - }, - "source": undefined, - "start": Object { - "column": 2, - "line": 4, - }, - }, - "original": "bar", - "parts": Array [ - "bar", - ], - "this": false, - "type": "PathExpression", - }, - "type": "MustacheStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 7, - "line": 4, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) collapses whitespace into single space character 2`] = `"{{foo}} {{bar}}"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse   surrounding a text content into a single whitespace 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": "  1  ", - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "source": null, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 35, - "line": 2, - }, - "source": null, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "modifiers": Array [], - "tag": "span", - "type": "ElementNode", - }, - Object { - "chars": " ", - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "source": null, - "start": Object { - "column": 35, - "line": 2, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " 2 ", - "loc": Object { - "end": Object { - "column": 13, - "line": 3, - }, - "source": null, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 3, - }, - "source": null, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "modifiers": Array [], - "tag": "span", - "type": "ElementNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 4, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "div", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 6, - "line": 4, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse   surrounding a text content into a single whitespace 2`] = `"
 1  2
"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse multiple   textNode into a single whitespace 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": "1", - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "source": null, - "start": Object { - "column": 6, - "line": 1, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "span", - "type": "ElementNode", - }, - Object { - "chars": "  ", - "loc": Object { - "end": Object { - "column": 26, - "line": 1, - }, - "source": null, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": "2", - "loc": Object { - "end": Object { - "column": 33, - "line": 1, - }, - "source": null, - "start": Object { - "column": 32, - "line": 1, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "source": null, - "start": Object { - "column": 26, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "span", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 40, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse multiple   textNode into a single whitespace 2`] = `"1  2"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse whitespace inside of
 tags 1`] = `
-Object {
-  "blockParams": Array [],
-  "body": Array [
-    Object {
-      "attributes": Array [],
-      "blockParams": Array [],
-      "children": Array [
-        Object {
-          "chars": "  
-
-   
-",
-          "loc": Object {
-            "end": Object {
-              "column": 0,
-              "line": 4,
-            },
-            "source": null,
-            "start": Object {
-              "column": 5,
-              "line": 1,
-            },
-          },
-          "type": "TextNode",
-        },
-      ],
-      "comments": Array [],
-      "loc": Object {
-        "end": Object {
-          "column": 6,
-          "line": 4,
-        },
-        "source": null,
-        "start": Object {
-          "column": 0,
-          "line": 1,
-        },
-      },
-      "modifiers": Array [],
-      "tag": "pre",
-      "type": "ElementNode",
-    },
-  ],
-  "loc": Object {
-    "end": Object {
-      "column": 6,
-      "line": 4,
-    },
-    "source": null,
-    "start": Object {
-      "column": 0,
-      "line": 1,
-    },
-  },
-  "type": "Program",
-}
-`;
-
-exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse whitespace inside of 
 tags 2`] = `
-"
  
-
-   
-
" -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse whitespace inside of {{#no-minify}} tags in other tags 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " - - -", - "loc": Object { - "end": Object { - "column": 0, - "line": 4, - }, - "source": null, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 20, - "line": 4, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "div", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 20, - "line": 4, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not collapse whitespace inside of {{#no-minify}} tags in other tags 2`] = ` -"
- - -
" -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`classNames\` specified in .hbs-minifyrc.js 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "source": null, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "class", - "type": "AttrNode", - "value": Object { - "chars": "description", - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "source": null, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "type": "TextNode", - }, - }, - ], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " - 1 - ", - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "source": null, - "start": Object { - "column": 25, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " - 2 - ", - "loc": Object { - "end": Object { - "column": 2, - "line": 5, - }, - "source": null, - "start": Object { - "column": 8, - "line": 3, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 9, - "line": 5, - }, - "source": null, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "modifiers": Array [], - "tag": "span", - "type": "ElementNode", - }, - Object { - "chars": " -", - "loc": Object { - "end": Object { - "column": 0, - "line": 6, - }, - "source": null, - "start": Object { - "column": 9, - "line": 5, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 6, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "div", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 6, - "line": 6, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`classNames\` specified in .hbs-minifyrc.js 2`] = ` -"
- 1 - - 2 - -
" -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`components\` specified in .hbs-minifyrc.js 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "inverse": null, - "loc": Object { - "end": Object { - "column": 12, - "line": 5, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 10, - "line": 1, - }, - "source": undefined, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "original": "foo-bar", - "parts": Array [ - "foo-bar", - ], - "this": false, - "type": "PathExpression", - }, - "program": Object { - "blockParams": Array [], - "body": Array [ - Object { - "chars": " ", - "loc": Object { - "end": Object { - "column": 2, - "line": 2, - }, - "source": null, - "start": Object { - "column": 0, - "line": 2, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " - yield content - ", - "loc": Object { - "end": Object { - "column": 2, - "line": 4, - }, - "source": null, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "source": null, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "modifiers": Array [], - "tag": "span", - "type": "ElementNode", - }, - Object { - "chars": " -", - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "source": null, - "start": Object { - "column": 9, - "line": 4, - }, - }, - "type": "TextNode", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "source": null, - "start": Object { - "column": 12, - "line": 1, - }, - }, - "type": "Program", - }, - "type": "BlockStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 12, - "line": 5, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`components\` specified in .hbs-minifyrc.js 2`] = ` -"{{#foo-bar}} - yield content - -{{/foo-bar}}" -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`tagNames\` specified in .hbs-minifyrc.js 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " - Box 564, - ", - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "source": null, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " - Disneyland - ", - "loc": Object { - "end": Object { - "column": 2, - "line": 5, - }, - "source": null, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 5, - }, - "source": null, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "modifiers": Array [], - "tag": "b", - "type": "ElementNode", - }, - Object { - "chars": " - ", - "loc": Object { - "end": Object { - "column": 2, - "line": 6, - }, - "source": null, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 6, - }, - "source": null, - "start": Object { - "column": 2, - "line": 6, - }, - }, - "modifiers": Array [], - "tag": "br", - "type": "ElementNode", - }, - Object { - "chars": " - ", - "loc": Object { - "end": Object { - "column": 2, - "line": 7, - }, - "source": null, - "start": Object { - "column": 6, - "line": 6, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " USA ", - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "source": null, - "start": Object { - "column": 5, - "line": 7, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "source": null, - "start": Object { - "column": 2, - "line": 7, - }, - }, - "modifiers": Array [], - "tag": "u", - "type": "ElementNode", - }, - Object { - "chars": " -", - "loc": Object { - "end": Object { - "column": 0, - "line": 8, - }, - "source": null, - "start": Object { - "column": 14, - "line": 7, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "address", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not minify \`tagNames\` specified in .hbs-minifyrc.js 2`] = ` -"
- Box 564, - - Disneyland - -

- USA -
" -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of
 tags 1`] = `
-Object {
-  "blockParams": Array [],
-  "body": Array [
-    Object {
-      "attributes": Array [],
-      "blockParams": Array [],
-      "children": Array [
-        Object {
-          "chars": "        ",
-          "loc": Object {
-            "end": Object {
-              "column": 13,
-              "line": 1,
-            },
-            "source": null,
-            "start": Object {
-              "column": 5,
-              "line": 1,
-            },
-          },
-          "type": "TextNode",
-        },
-        Object {
-          "escaped": true,
-          "hash": Object {
-            "loc": Object {
-              "end": Object {
-                "column": 0,
-                "line": 1,
-              },
-              "source": "(synthetic)",
-              "start": Object {
-                "column": 0,
-                "line": 1,
-              },
-            },
-            "pairs": Array [],
-            "type": "Hash",
-          },
-          "loc": Object {
-            "end": Object {
-              "column": 20,
-              "line": 1,
-            },
-            "source": null,
-            "start": Object {
-              "column": 13,
-              "line": 1,
-            },
-          },
-          "params": Array [],
-          "path": Object {
-            "data": false,
-            "loc": SourceLocation {
-              "end": Object {
-                "column": 18,
-                "line": 1,
-              },
-              "source": undefined,
-              "start": Object {
-                "column": 15,
-                "line": 1,
-              },
-            },
-            "original": "foo",
-            "parts": Array [
-              "foo",
-            ],
-            "this": false,
-            "type": "PathExpression",
-          },
-          "type": "MustacheStatement",
-        },
-        Object {
-          "chars": "        ",
-          "loc": Object {
-            "end": Object {
-              "column": 28,
-              "line": 1,
-            },
-            "source": null,
-            "start": Object {
-              "column": 20,
-              "line": 1,
-            },
-          },
-          "type": "TextNode",
-        },
-      ],
-      "comments": Array [],
-      "loc": Object {
-        "end": Object {
-          "column": 34,
-          "line": 1,
-        },
-        "source": null,
-        "start": Object {
-          "column": 0,
-          "line": 1,
-        },
-      },
-      "modifiers": Array [],
-      "tag": "pre",
-      "type": "ElementNode",
-    },
-  ],
-  "loc": Object {
-    "end": Object {
-      "column": 34,
-      "line": 1,
-    },
-    "source": null,
-    "start": Object {
-      "column": 0,
-      "line": 1,
-    },
-  },
-  "type": "Program",
-}
-`;
-
-exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of 
 tags 2`] = `"
        {{foo}}        
"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of {{#no-minify}} tags 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "chars": " ", - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "source": null, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "escaped": true, - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "loc": Object { - "end": Object { - "column": 29, - "line": 1, - }, - "source": null, - "start": Object { - "column": 22, - "line": 1, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 27, - "line": 1, - }, - "source": undefined, - "start": Object { - "column": 24, - "line": 1, - }, - }, - "original": "foo", - "parts": Array [ - "foo", - ], - "this": false, - "type": "PathExpression", - }, - "type": "MustacheStatement", - }, - Object { - "chars": " ", - "loc": Object { - "end": Object { - "column": 37, - "line": 1, - }, - "source": null, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "type": "TextNode", - }, - ], - "loc": Object { - "end": Object { - "column": 51, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of {{#no-minify}} tags 2`] = `" {{foo}} "`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of {{#no-minify}} tags in other tags 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " ", - "loc": Object { - "end": Object { - "column": 27, - "line": 1, - }, - "source": null, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "escaped": true, - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "source": null, - "start": Object { - "column": 27, - "line": 1, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 32, - "line": 1, - }, - "source": undefined, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "original": "foo", - "parts": Array [ - "foo", - ], - "this": false, - "type": "PathExpression", - }, - "type": "MustacheStatement", - }, - Object { - "chars": " ", - "loc": Object { - "end": Object { - "column": 42, - "line": 1, - }, - "source": null, - "start": Object { - "column": 34, - "line": 1, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 62, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "div", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 62, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip inside of {{#no-minify}} tags in other tags 2`] = `"
{{foo}}
"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip leading/trailing text from ElementNode nodes 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": "x ", - "loc": Object { - "end": Object { - "column": 14, - "line": 1, - }, - "source": null, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "escaped": true, - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "loc": Object { - "end": Object { - "column": 21, - "line": 1, - }, - "source": null, - "start": Object { - "column": 14, - "line": 1, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 19, - "line": 1, - }, - "source": undefined, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "original": "foo", - "parts": Array [ - "foo", - ], - "this": false, - "type": "PathExpression", - }, - "type": "MustacheStatement", - }, - Object { - "chars": " y ", - "loc": Object { - "end": Object { - "column": 30, - "line": 1, - }, - "source": null, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "div", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 36, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip leading/trailing text from ElementNode nodes 2`] = `"
x {{foo}} y
"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip leading/trailing text from Program nodes 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "chars": "x ", - "loc": Object { - "end": Object { - "column": 9, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "escaped": true, - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "loc": Object { - "end": Object { - "column": 16, - "line": 1, - }, - "source": null, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 14, - "line": 1, - }, - "source": undefined, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "original": "foo", - "parts": Array [ - "foo", - ], - "this": false, - "type": "PathExpression", - }, - "type": "MustacheStatement", - }, - Object { - "chars": " y ", - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "source": null, - "start": Object { - "column": 16, - "line": 1, - }, - }, - "type": "TextNode", - }, - ], - "loc": Object { - "end": Object { - "column": 25, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) does not strip leading/trailing text from Program nodes 2`] = `"x {{foo}} y "`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`classNames\` that are not specified in .hbs-minifyrc.js 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [ - Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "source": null, - "start": Object { - "column": 5, - "line": 1, - }, - }, - "name": "class", - "type": "AttrNode", - "value": Object { - "chars": "contact-details", - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "source": null, - "start": Object { - "column": 11, - "line": 1, - }, - }, - "type": "TextNode", - }, - }, - ], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " John Smith ", - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "source": null, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " (Entrepreneur) ", - "loc": Object { - "end": Object { - "column": 2, - "line": 5, - }, - "source": null, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 5, - }, - "source": null, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "modifiers": Array [], - "tag": "i", - "type": "ElementNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 6, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "div", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 6, - "line": 6, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`classNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
John Smith (Entrepreneur)
"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`components\` that are not specified in .hbs-minifyrc.js 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "inverse": null, - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 15, - "line": 1, - }, - "source": undefined, - "start": Object { - "column": 3, - "line": 1, - }, - }, - "original": "my-component", - "parts": Array [ - "my-component", - ], - "this": false, - "type": "PathExpression", - }, - "program": Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " yield content ", - "loc": Object { - "end": Object { - "column": 2, - "line": 4, - }, - "source": null, - "start": Object { - "column": 8, - "line": 2, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 9, - "line": 4, - }, - "source": null, - "start": Object { - "column": 2, - "line": 2, - }, - }, - "modifiers": Array [], - "tag": "span", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 0, - "line": 5, - }, - "source": null, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "type": "Program", - }, - "type": "BlockStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 17, - "line": 5, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`components\` that are not specified in .hbs-minifyrc.js 2`] = `"{{#my-component}} yield content {{/my-component}}"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " Box 564, ", - "loc": Object { - "end": Object { - "column": 2, - "line": 3, - }, - "source": null, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " Disneyland ", - "loc": Object { - "end": Object { - "column": 2, - "line": 5, - }, - "source": null, - "start": Object { - "column": 5, - "line": 3, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 5, - }, - "source": null, - "start": Object { - "column": 2, - "line": 3, - }, - }, - "modifiers": Array [], - "tag": "b", - "type": "ElementNode", - }, - Object { - "chars": " ", - "loc": Object { - "end": Object { - "column": 2, - "line": 6, - }, - "source": null, - "start": Object { - "column": 6, - "line": 5, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 6, - "line": 6, - }, - "source": null, - "start": Object { - "column": 2, - "line": 6, - }, - }, - "modifiers": Array [], - "tag": "br", - "type": "ElementNode", - }, - Object { - "chars": " ", - "loc": Object { - "end": Object { - "column": 2, - "line": 7, - }, - "source": null, - "start": Object { - "column": 6, - "line": 6, - }, - }, - "type": "TextNode", - }, - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "chars": " USA ", - "loc": Object { - "end": Object { - "column": 10, - "line": 7, - }, - "source": null, - "start": Object { - "column": 5, - "line": 7, - }, - }, - "type": "TextNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 14, - "line": 7, - }, - "source": null, - "start": Object { - "column": 2, - "line": 7, - }, - }, - "modifiers": Array [], - "tag": "u", - "type": "ElementNode", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "section", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 10, - "line": 8, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) minifies \`tagNames\` that are not specified in .hbs-minifyrc.js 2`] = `"
Box 564, Disneyland

USA
"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) strips leading and trailing whitespace from ElementNode nodes 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "attributes": Array [], - "blockParams": Array [], - "children": Array [ - Object { - "escaped": true, - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "loc": Object { - "end": Object { - "column": 20, - "line": 1, - }, - "source": null, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 18, - "line": 1, - }, - "source": undefined, - "start": Object { - "column": 15, - "line": 1, - }, - }, - "original": "foo", - "parts": Array [ - "foo", - ], - "this": false, - "type": "PathExpression", - }, - "type": "MustacheStatement", - }, - ], - "comments": Array [], - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "modifiers": Array [], - "tag": "div", - "type": "ElementNode", - }, - ], - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) strips leading and trailing whitespace from ElementNode nodes 2`] = `"
{{foo}}
"`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) strips leading and trailing whitespace from Program nodes 1`] = ` -Object { - "blockParams": Array [], - "body": Array [ - Object { - "escaped": true, - "hash": Object { - "loc": Object { - "end": Object { - "column": 0, - "line": 1, - }, - "source": "(synthetic)", - "start": Object { - "column": 0, - "line": 1, - }, - }, - "pairs": Array [], - "type": "Hash", - }, - "loc": Object { - "end": Object { - "column": 15, - "line": 1, - }, - "source": null, - "start": Object { - "column": 8, - "line": 1, - }, - }, - "params": Array [], - "path": Object { - "data": false, - "loc": SourceLocation { - "end": Object { - "column": 13, - "line": 1, - }, - "source": undefined, - "start": Object { - "column": 10, - "line": 1, - }, - }, - "original": "foo", - "parts": Array [ - "foo", - ], - "this": false, - "type": "PathExpression", - }, - "type": "MustacheStatement", - }, - ], - "loc": Object { - "end": Object { - "column": 23, - "line": 1, - }, - "source": null, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "type": "Program", -} -`; - -exports[`HBS Minifier plugin (with @glimmer/syntax v0.33.0) strips leading and trailing whitespace from Program nodes 2`] = `"{{foo}}"`; - exports[`HBS Minifier plugin (with @glimmer/syntax v0.35.11) collapses whitespace into single space character 1`] = ` Object { "blockParams": Array [], diff --git a/multidep.json b/multidep.json index 45567573..57e06ce5 100644 --- a/multidep.json +++ b/multidep.json @@ -3,8 +3,7 @@ "versions": { "@glimmer/syntax": [ "0.37.1", - "0.35.11", - "0.33.0" + "0.35.11" ] } } From 741ae69116b1d81b2ad753906ed984fd91f44100 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 28 Apr 2019 12:29:55 +0200 Subject: [PATCH 9/9] Jest: Add `modulePathIgnorePatterns` option to silence Haste warnings --- package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package.json b/package.json index e5fd1a5c..dd1af0ff 100644 --- a/package.json +++ b/package.json @@ -60,5 +60,10 @@ "versionCompatibility": { "ember": ">=3.4.0" } + }, + "jest": { + "modulePathIgnorePatterns": [ + "/multidep_modules" + ] } }