Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nanocomponent

Package Overview
Dependencies
Maintainers
26
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanocomponent - npm Package Compare versions

Comparing version 6.4.6 to 6.5.0

19

index.js

@@ -42,3 +42,3 @@ var document = require('global/document')

Nanocomponent.prototype.render = function () {
var timing = nanotiming(this._name + '.render')
var renderTiming = nanotiming(this._name + '.render')
var self = this

@@ -49,15 +49,22 @@ var args = new Array(arguments.length)

if (!this._hasWindow) {
var createTiming = nanotiming(this._name + '.create')
el = this.createElement.apply(this, args)
timing()
createTiming()
renderTiming()
return el
} else if (this.element) {
el = this.element // retain reference, as the ID might change on render
var updateTiming = nanotiming(this._name + '.update')
var shouldUpdate = this._rerender || this.update.apply(this, args)
updateTiming()
if (this._rerender) this._rerender = false
if (shouldUpdate) {
morph(el, this._handleRender(args))
var desiredHtml = this._handleRender(args)
var morphTiming = nanotiming(this._name + '.morph')
morph(el, desiredHtml)
morphTiming()
if (this.afterupdate) this.afterupdate(el)
}
if (!this._proxy) { this._proxy = this._createProxy() }
timing()
renderTiming()
return this._proxy

@@ -72,3 +79,3 @@ } else {

}
timing()
renderTiming()
return el

@@ -85,3 +92,5 @@ }

Nanocomponent.prototype._handleRender = function (args) {
var createElementTiming = nanotiming(this._name + '.createElement')
var el = this.createElement.apply(this, args)
createElementTiming()
if (!this._rootNodeName) this._rootNodeName = el.nodeName

@@ -88,0 +97,0 @@ assert(el instanceof window.HTMLElement, 'nanocomponent: createElement should return a DOM node')

{
"name": "nanocomponent",
"version": "6.4.6",
"version": "6.5.0",
"description": "Native DOM components that pair nicely with DOM diffing algorithms",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc