From a91a1cc7872476ffa2b9ece00bfb9bb6af0314cf Mon Sep 17 00:00:00 2001 From: ozsayag Date: Thu, 28 Jan 2016 11:21:55 +0200 Subject: [PATCH] Refactor static-html to not use jquery Simply use setAttribute instead. Fixes #5320 PR #6105 --- packages/caching-html-compiler/caching-html-compiler.js | 9 +++++++-- packages/static-html/package.js | 1 - 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/caching-html-compiler/caching-html-compiler.js b/packages/caching-html-compiler/caching-html-compiler.js index b4c2456ab2..43e01ee3ef 100644 --- a/packages/caching-html-compiler/caching-html-compiler.js +++ b/packages/caching-html-compiler/caching-html-compiler.js @@ -108,8 +108,13 @@ CachingHtmlCompiler = class CachingHtmlCompiler extends CachingCompiler { }); // Add JavaScript code to set attributes on body - allJavaScript += ` -Meteor.startup(function() { $('body').attr(${JSON.stringify(compileResult.bodyAttrs)}); }); + allJavaScript += +`Meteor.startup(function() { + var attrs = ${JSON.stringify(compileResult.bodyAttrs)}; + for (var prop in attrs) { + document.body.setAttribute(prop, attrs[prop]); + } +}); `; } diff --git a/packages/static-html/package.js b/packages/static-html/package.js index 2ecc4ef935..ece5f3ba86 100644 --- a/packages/static-html/package.js +++ b/packages/static-html/package.js @@ -23,7 +23,6 @@ Package.registerBuildPlugin({ Package.onUse(function(api) { api.use('isobuild:compiler-plugin@1.0.0'); - api.use('jquery'); // Body attributes are compiled to code that uses Meteor.startup api.imply('meteor', 'client');