Skip to content

Commit 33b4561

Browse files
author
Bruno Abreu
authored
Merge pull request #19 from vtex/feature/merge-runtime
Add missing window.__RUNTIME__ data to runtime
2 parents 1ebcfed + 9631ca6 commit 33b4561

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.2.1] - 2020-06-23
11+
### Fixed
12+
- Add global `__RUNTIME__` data local `runtime`.
13+
1014
## [0.2.0] - 2019-12-19
1115

1216
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vtex/render-extension-loader",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"description": "VTEX IO Render Extension Loader",
55
"main": "lib/render-extension-loader.js",
66
"browser": "lib/render-extension-loader.js",

src/render-extension-loader.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ class RenderExtensionLoader {
142142
)
143143
this.timeEnd('render-extension-loader:json')
144144

145+
for (const key in window.__RUNTIME__ || {}) {
146+
if (window.__RUNTIME__.hasOwnProperty(key) && runtime[key] === undefined) {
147+
runtime[key] = window.__RUNTIME__[key]
148+
}
149+
}
150+
145151
this.setGlobalContext({ runtime, styles, scripts })
146152
return { runtime, styles, scripts }
147153
}

0 commit comments

Comments
 (0)