From b2b7afd31085aa0c15e6dfdf84f9ee994659b70d Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 27 Mar 2020 12:06:14 -0400 Subject: [PATCH] Rename the server side widget hbs compiler --- lib/discourse_js_processor.rb | 2 +- .../{widget-hbs-compiler.js.es6 => widget-hbs-compiler.js} | 0 script/compile_hbs.rb | 2 +- script/test_hbs_compiler.rb | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename lib/javascripts/{widget-hbs-compiler.js.es6 => widget-hbs-compiler.js} (100%) diff --git a/lib/discourse_js_processor.rb b/lib/discourse_js_processor.rb index ebe2559982b..7417207ff5c 100644 --- a/lib/discourse_js_processor.rb +++ b/lib/discourse_js_processor.rb @@ -88,7 +88,7 @@ class DiscourseJsProcessor } JS - source = File.read("#{Rails.root}/lib/javascripts/widget-hbs-compiler.js.es6") + source = File.read("#{Rails.root}/lib/javascripts/widget-hbs-compiler.js") js_source = ::JSON.generate(source, quirks_mode: true) js = ctx.eval("Babel.transform(#{js_source}, { ast: false, plugins: ['check-es2015-constants', 'transform-es2015-arrow-functions', 'transform-es2015-block-scoped-functions', 'transform-es2015-block-scoping', 'transform-es2015-classes', 'transform-es2015-computed-properties', 'transform-es2015-destructuring', 'transform-es2015-duplicate-keys', 'transform-es2015-for-of', 'transform-es2015-function-name', 'transform-es2015-literals', 'transform-es2015-object-super', 'transform-es2015-parameters', 'transform-es2015-shorthand-properties', 'transform-es2015-spread', 'transform-es2015-sticky-regex', 'transform-es2015-template-literals', 'transform-es2015-typeof-symbol', 'transform-es2015-unicode-regex'] }).code") ctx.eval(js) diff --git a/lib/javascripts/widget-hbs-compiler.js.es6 b/lib/javascripts/widget-hbs-compiler.js similarity index 100% rename from lib/javascripts/widget-hbs-compiler.js.es6 rename to lib/javascripts/widget-hbs-compiler.js diff --git a/script/compile_hbs.rb b/script/compile_hbs.rb index cfec4386a2c..ee072ea35d6 100644 --- a/script/compile_hbs.rb +++ b/script/compile_hbs.rb @@ -14,7 +14,7 @@ console = { } JS -source = File.read("#{Rails.root}/lib/javascripts/widget-hbs-compiler.js.es6") +source = File.read("#{Rails.root}/lib/javascripts/widget-hbs-compiler.js") js_source = ::JSON.generate(source, quirks_mode: true) js = ctx.eval("Babel.transform(#{js_source}, { ast: false, plugins: ['check-es2015-constants', 'transform-es2015-arrow-functions', 'transform-es2015-block-scoped-functions', 'transform-es2015-block-scoping', 'transform-es2015-classes', 'transform-es2015-computed-properties', 'transform-es2015-destructuring', 'transform-es2015-duplicate-keys', 'transform-es2015-for-of', 'transform-es2015-function-name', 'transform-es2015-literals', 'transform-es2015-object-super', 'transform-es2015-parameters', 'transform-es2015-shorthand-properties', 'transform-es2015-spread', 'transform-es2015-sticky-regex', 'transform-es2015-template-literals', 'transform-es2015-typeof-symbol', 'transform-es2015-unicode-regex'] }).code") ctx.eval(js) diff --git a/script/test_hbs_compiler.rb b/script/test_hbs_compiler.rb index badbd227e4d..f3c5be35c1b 100644 --- a/script/test_hbs_compiler.rb +++ b/script/test_hbs_compiler.rb @@ -22,7 +22,7 @@ console = { } JS -source = File.read("#{Rails.root}/lib/javascripts/widget-hbs-compiler.js.es6") +source = File.read("#{Rails.root}/lib/javascripts/widget-hbs-compiler.js") ctx.eval(source) js_source = ::JSON.generate(template, quirks_mode: true)