@atlassian/soy-loader
Advanced tools
Comparing version
@@ -6,2 +6,12 @@ # Change Log | ||
### [5.3.3](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/soy-loader@5.3.3..@atlassian/soy-loader@5.3.2) (2021-10-22) | ||
### Bug Fixes | ||
* **ci:** update webpack versions when running integration tests ([009dd61](https://bitbucket.org/atlassianlabs/fe-server/commits/009dd61f36a784d3fef7b6d6fa7214c5cc16b8b8)) | ||
* **soy-loader:** SOY-145 - ensure not to overwrite a potentially already existing namespace ([087dfd0](https://bitbucket.org/atlassianlabs/fe-server/commits/087dfd0277a3b70af46bf1bde288f8faccc931e1)) | ||
### [5.3.2](https://bitbucket.org/atlassianlabs/fe-server/branches/compare/@atlassian/soy-loader@5.3.2..@atlassian/soy-loader@5.3.1) (2021-10-14) | ||
@@ -8,0 +18,0 @@ |
const exposeSoy = (parsedSoy, soyJs) => { | ||
// As we wrap the soy template in a module now a simple `var xyz` doesnt translate to a global variable anymore. | ||
// Therefore, we need to rewrite the template to explicitly expose the namespace to windows. | ||
return ` | ||
${soyJs} | ||
// Exposed to window by expose-soy | ||
window.${parsedSoy.namespaceRoot} = ${parsedSoy.namespaceRoot} || {}; | ||
`; | ||
var ${parsedSoy.namespaceRoot} = window['${parsedSoy.namespaceRoot}'] = window['${parsedSoy.namespaceRoot}'] || {}; | ||
${soyJs}`; | ||
}; | ||
module.exports = exposeSoy; |
{ | ||
"name": "@atlassian/soy-loader", | ||
"version": "5.3.2", | ||
"version": "5.3.3", | ||
"description": "Soy loader for webpack using the Atlassian Soy CLI compiler", | ||
"main": "index.js", | ||
"scripts": { | ||
"precommit": "lint-staged", | ||
"test:ci": "../../node_modules/.bin/tav --verbose", | ||
@@ -14,3 +13,3 @@ "test:ci:jest": "node ./tests/webpack-version.js && ../../node_modules/.bin/jest -ci", | ||
"test:webpack-4": "../../node_modules/tav webpack '~4.0.1 || ^4.46' 'npm run test:ci:jest'", | ||
"test:webpack-5": "../../node_modules/tav webpack '~5.0.0 || ^5.53.0' 'npm run test:ci:jest'" | ||
"test:webpack-5": "../../node_modules/tav webpack '~5.0.0 || ^5.58.1' 'npm run test:ci:jest'" | ||
}, | ||
@@ -67,3 +66,3 @@ "repository": { | ||
}, | ||
"gitHead": "f426599f63d634483ebc573db6c8fe42782eaec7" | ||
"gitHead": "2d361b4cdef4d201dc79067c4f7affd76f517520" | ||
} |
41052
1.82%