enable-browser-mode
Advanced tools
Comparing version 1.27.0 to 1.28.0
{ | ||
"name": "enable-browser-mode", | ||
"version": "1.27.0", | ||
"version": "1.28.0", | ||
"description": "Simulate the browser with ease by setting the global object to a JSDOM window and painlessly run browser JS without errors.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -49,3 +49,3 @@ # Enable browser mode | ||
For server-side rendering in Node, `web-widgets` builds out the widget tree on the virtual DOM and then exports it as flat HTML using the `HTMLElement.outerHTML` property; in the browser, the DOM is manipulated directly on-the-fly (i.e. with `Node.appendChild`). By simulating the browser global, we can use the exact same core library for both cases, the difference being just `Widget.render(HTMLElement)` to render into a DOM element and `Widget.export()` to dump the outerHTML. | ||
For server-side rendering in Node, `web-widgets` builds out the widget tree on the virtual DOM and then exports it as flat HTML using the `HTMLElement.outerHTML` property; in the browser, the DOM is manipulated directly on-the-fly (i.e. with `HTMLElement.appendChild`). By simulating the browser global, we can use the exact same core library for both cases, the difference being just `Widget.render(HTMLElement)` to render into a DOM element and `Widget.export()` to dump the outerHTML. | ||
@@ -52,0 +52,0 @@ Using `enable-browser-mode`, all that is needed to reuse original browser libraries (including jQuery, HammerJS, etc.) is creating an separate JS file for your Node logic, importing this package, and then importing your browser code: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
395749