UNPKG

22.1 kBSource Map (JSON)View Raw
1{"version":3,"file":"devtools.js","sources":["src/constants.js","devtools/devtools.js","devtools/index.js"],"sourcesContent":["// render modes\n\n/** Do not re-render a component */\nexport const NO_RENDER = 0;\n/** Synchronously re-render a component and its children */\nexport const SYNC_RENDER = 1;\n/** Synchronously re-render a component, even if its lifecycle methods attempt to prevent it. */\nexport const FORCE_RENDER = 2;\n/** Queue asynchronous re-render of a component and it's children */\nexport const ASYNC_RENDER = 3;\n\n\nexport const ATTR_KEY = '__preactattr_';\n\n/** DOM properties that should NOT have \"px\" added when numeric */\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\n","/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n\nimport { options } from 'preact';\n\n// Internal helpers from preact\nimport { ATTR_KEY } from '../src/constants';\n\n/**\n * Return a ReactElement-compatible object for the current state of a preact\n * component.\n */\nfunction createReactElement(component) {\n\treturn {\n\t\ttype: component.constructor,\n\t\tkey: component.key,\n\t\tref: null, // Unsupported\n\t\tprops: component.props\n\t};\n}\n\n/**\n * Create a ReactDOMComponent-compatible object for a given DOM node rendered\n * by preact.\n *\n * This implements the subset of the ReactDOMComponent interface that\n * React DevTools requires in order to display DOM nodes in the inspector with\n * the correct type and properties.\n *\n * @param {Node} node\n */\nfunction createReactDOMComponent(node) {\n\tconst childNodes = node.nodeType === Node.ELEMENT_NODE ?\n\t\tArray.from(node.childNodes) : [];\n\n\tconst isText = node.nodeType === Node.TEXT_NODE;\n\n\treturn {\n\t\t// --- ReactDOMComponent interface\n\t\t_currentElement: isText ? node.textContent : {\n\t\t\ttype: node.nodeName.toLowerCase(),\n\t\t\tprops: node[ATTR_KEY]\n\t\t},\n\t\t_renderedChildren: childNodes.map(child => {\n\t\t\tif (child._component) {\n\t\t\t\treturn updateReactComponent(child._component);\n\t\t\t}\n\t\t\treturn updateReactComponent(child);\n\t\t}),\n\t\t_stringText: isText ? node.textContent : null,\n\n\t\t// --- Additional properties used by preact devtools\n\n\t\t// A flag indicating whether the devtools have been notified about the\n\t\t// existence of this component instance yet.\n\t\t// This is used to send the appropriate notifications when DOM components\n\t\t// are added or updated between composite component updates.\n\t\t_inDevTools: false,\n\t\tnode\n\t};\n}\n\n/**\n * Return the name of a component created by a `ReactElement`-like object.\n *\n * @param {ReactElement} element\n */\nfunction typeName(element) {\n\tif (typeof element.type === 'function') {\n\t\treturn element.type.displayName || element.type.name;\n\t}\n\treturn element.type;\n}\n\n/**\n * Return a ReactCompositeComponent-compatible object for a given preact\n * component instance.\n *\n * This implements the subset of the ReactCompositeComponent interface that\n * the DevTools requires in order to walk the component tree and inspect the\n * component's properties.\n *\n * See https://github.com/facebook/react-devtools/blob/e31ec5825342eda570acfc9bcb43a44258fceb28/backend/getData.js\n */\nfunction createReactCompositeComponent(component) {\n\tconst _currentElement = createReactElement(component);\n\tconst node = component.base;\n\n\tlet instance = {\n\t\tgetPublicInstance() {\n\t\t\t// Can be anything other than null\n\t\t\treturn true;\n\t\t},\n\t\t// --- ReactDOMComponent properties\n\t\tgetName() {\n\t\t\treturn typeName(_currentElement);\n\t\t},\n\t\t_currentElement: createReactElement(component),\n\t\tprops: component.props,\n\t\tstate: component.state,\n\t\tforceUpdate: component.forceUpdate && component.forceUpdate.bind(component),\n\t\tsetState: component.setState && component.setState.bind(component),\n\n\t\t// --- Additional properties used by preact devtools\n\t\tnode\n\t};\n\n\t// React DevTools exposes the `_instance` field of the selected item in the\n\t// component tree as `$r` in the console. `_instance` must refer to a\n\t// React Component (or compatible) class instance with `props` and `state`\n\t// fields and `setState()`, `forceUpdate()` methods.\n\tinstance._instance = component;\n\n\t// If the root node returned by this component instance's render function\n\t// was itself a composite component, there will be a `_component` property\n\t// containing the child component instance.\n\tif (component._component) {\n\t\tinstance._renderedComponent = updateReactComponent(component._component);\n\t} else {\n\t\t// Otherwise, if the render() function returned an HTML/SVG element,\n\t\t// create a ReactDOMComponent-like object for the DOM node itself.\n\t\tinstance._renderedComponent = updateReactComponent(node);\n\t}\n\n\treturn instance;\n}\n\n/**\n * Map of Component|Node to ReactDOMComponent|ReactCompositeComponent-like\n * object.\n *\n * The same React*Component instance must be used when notifying devtools\n * about the initial mount of a component and subsequent updates.\n */\nlet instanceMap = typeof Map==='function' && new Map();\n\n/**\n * Update (and create if necessary) the ReactDOMComponent|ReactCompositeComponent-like\n * instance for a given preact component instance or DOM Node.\n *\n * @param {Component|Node} componentOrNode\n */\nfunction updateReactComponent(componentOrNode) {\n\tconst newInstance = componentOrNode instanceof Node ?\n\t\tcreateReactDOMComponent(componentOrNode) :\n\t\tcreateReactCompositeComponent(componentOrNode);\n\tif (instanceMap.has(componentOrNode)) {\n\t\tlet inst = instanceMap.get(componentOrNode);\n\t\tObject.assign(inst, newInstance);\n\t\treturn inst;\n\t}\n\tinstanceMap.set(componentOrNode, newInstance);\n\treturn newInstance;\n}\n\nfunction nextRootKey(roots) {\n\treturn '.' + Object.keys(roots).length;\n}\n\n/**\n * Find all root component instances rendered by preact in `node`'s children\n * and add them to the `roots` map.\n *\n * @param {DOMElement} node\n * @param {[key: string] => ReactDOMComponent|ReactCompositeComponent}\n */\nfunction findRoots(node, roots) {\n\tArray.from(node.childNodes).forEach(child => {\n\t\tif (child._component) {\n\t\t\troots[nextRootKey(roots)] = updateReactComponent(child._component);\n\t\t} else {\n\t\t\tfindRoots(child, roots);\n\t\t}\n\t});\n}\n\n/**\n * Create a bridge for exposing preact's component tree to React DevTools.\n *\n * It creates implementations of the interfaces that ReactDOM passes to\n * devtools to enable it to query the component tree and hook into component\n * updates.\n *\n * See https://github.com/facebook/react/blob/59ff7749eda0cd858d5ee568315bcba1be75a1ca/src/renderers/dom/ReactDOM.js\n * for how ReactDOM exports its internals for use by the devtools and\n * the `attachRenderer()` function in\n * https://github.com/facebook/react-devtools/blob/e31ec5825342eda570acfc9bcb43a44258fceb28/backend/attachRenderer.js\n * for how the devtools consumes the resulting objects.\n */\nfunction createDevToolsBridge() {\n\t// The devtools has different paths for interacting with the renderers from\n\t// React Native, legacy React DOM and current React DOM.\n\t//\n\t// Here we emulate the interface for the current React DOM (v15+) lib.\n\n\t// ReactDOMComponentTree-like object\n\tconst ComponentTree = {\n\t\tgetNodeFromInstance(instance) {\n\t\t\treturn instance.node;\n\t\t},\n\t\tgetClosestInstanceFromNode(node) {\n\t\t\twhile (node && !node._component) {\n\t\t\t\tnode = node.parentNode;\n\t\t\t}\n\t\t\treturn node ? updateReactComponent(node._component) : null;\n\t\t}\n\t};\n\n\t// Map of root ID (the ID is unimportant) to component instance.\n\tlet roots = {};\n\tfindRoots(document.body, roots);\n\n\t// ReactMount-like object\n\t//\n\t// Used by devtools to discover the list of root component instances and get\n\t// notified when new root components are rendered.\n\tconst Mount = {\n\t\t_instancesByReactRootID: roots,\n\n\t\t// Stub - React DevTools expects to find this method and replace it\n\t\t// with a wrapper in order to observe new root components being added\n\t\t_renderNewRootComponent(/* instance, ... */) { }\n\t};\n\n\t// ReactReconciler-like object\n\tconst Reconciler = {\n\t\t// Stubs - React DevTools expects to find these methods and replace them\n\t\t// with wrappers in order to observe components being mounted, updated and\n\t\t// unmounted\n\t\tmountComponent(/* instance, ... */) { },\n\t\tperformUpdateIfNecessary(/* instance, ... */) { },\n\t\treceiveComponent(/* instance, ... */) { },\n\t\tunmountComponent(/* instance, ... */) { }\n\t};\n\n\t/** Notify devtools that a new component instance has been mounted into the DOM. */\n\tconst componentAdded = component => {\n\t\tconst instance = updateReactComponent(component);\n\t\tif (isRootComponent(component)) {\n\t\t\tinstance._rootID = nextRootKey(roots);\n\t\t\troots[instance._rootID] = instance;\n\t\t\tMount._renderNewRootComponent(instance);\n\t\t}\n\t\tvisitNonCompositeChildren(instance, childInst => {\n\t\t\tchildInst._inDevTools = true;\n\t\t\tReconciler.mountComponent(childInst);\n\t\t});\n\t\tReconciler.mountComponent(instance);\n\t};\n\n\t/** Notify devtools that a component has been updated with new props/state. */\n\tconst componentUpdated = component => {\n\t\tconst prevRenderedChildren = [];\n\t\tlet instance = instanceMap.get(component);\n\t\tif (instance) {\n\t\t\tvisitNonCompositeChildren(instance, childInst => {\n\t\t\t\tprevRenderedChildren.push(childInst);\n\t\t\t});\n\t\t}\n\t\t// Notify devtools about updates to this component and any non-composite\n\t\t// children\n\t\tinstance = updateReactComponent(component);\n\n\t\tReconciler.receiveComponent(instance);\n\t\tvisitNonCompositeChildren(instance, childInst => {\n\t\t\tconst info = {\n\t\t\t\t// Must be defined otherwise state updates won't work\n\t\t\t\t_topLevelWrapper: instance\n\t\t\t};\n\n\t\t\tif (!childInst._inDevTools) {\n\t\t\t\t// New DOM child component\n\t\t\t\tchildInst._inDevTools = true;\n\t\t\t\tReconciler.mountComponent(childInst, null, null, info);\n\t\t\t} else {\n\t\t\t\t// Updated DOM child component\n\t\t\t\tReconciler.receiveComponent(childInst, null, null, info);\n\t\t\t}\n\t\t});\n\n\t\t// For any non-composite children that were removed by the latest render,\n\t\t// remove the corresponding ReactDOMComponent-like instances and notify\n\t\t// the devtools\n\t\tprevRenderedChildren.forEach(childInst => {\n\t\t\tif (!document.body.contains(childInst.node)) {\n\t\t\t\tinstanceMap.delete(childInst.node);\n\t\t\t\tReconciler.unmountComponent(childInst);\n\t\t\t}\n\t\t});\n\t};\n\n\t/** Notify devtools that a component has been unmounted from the DOM. */\n\tconst componentRemoved = component => {\n\t\tconst instance = updateReactComponent(component);\n\t\tvisitNonCompositeChildren(childInst => {\n\t\t\tinstanceMap.delete(childInst.node);\n\t\t\tReconciler.unmountComponent(childInst);\n\t\t});\n\t\tReconciler.unmountComponent(instance);\n\t\tinstanceMap.delete(component);\n\t\tif (instance._rootID) {\n\t\t\tdelete roots[instance._rootID];\n\t\t}\n\t};\n\n\treturn {\n\t\tcomponentAdded,\n\t\tcomponentUpdated,\n\t\tcomponentRemoved,\n\n\t\t// Interfaces passed to devtools via __REACT_DEVTOOLS_GLOBAL_HOOK__.inject()\n\t\tComponentTree,\n\t\tMount,\n\t\tReconciler\n\t};\n}\n\n/**\n * Return `true` if a preact component is a top level component rendered by\n * `render()` into a container Element.\n */\nfunction isRootComponent(component) {\n\t// `_parentComponent` is actually `__u` after minification\n\tif (component._parentComponent || component.__u) {\n\t\t// Component with a composite parent\n\t\treturn false;\n\t}\n\tif (component.base.parentElement && component.base.parentElement[ATTR_KEY]) {\n\t\t// Component with a parent DOM element rendered by Preact\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n/**\n * Visit all child instances of a ReactCompositeComponent-like object that are\n * not composite components (ie. they represent DOM elements or text)\n *\n * @param {Component} component\n * @param {(Component) => void} visitor\n */\nfunction visitNonCompositeChildren(component, visitor) {\n\tif (!component) return;\n\tif (component._renderedComponent) {\n\t\tif (!component._renderedComponent._component) {\n\t\t\tvisitor(component._renderedComponent);\n\t\t\tvisitNonCompositeChildren(component._renderedComponent, visitor);\n\t\t}\n\t} else if (component._renderedChildren) {\n\t\tcomponent._renderedChildren.forEach(child => {\n\t\t\tvisitor(child);\n\t\t\tif (!child._component) visitNonCompositeChildren(child, visitor);\n\t\t});\n\t}\n}\n\n/**\n * Create a bridge between the preact component tree and React's dev tools\n * and register it.\n *\n * After this function is called, the React Dev Tools should be able to detect\n * \"React\" on the page and show the component tree.\n *\n * This function hooks into preact VNode creation in order to expose functional\n * components correctly, so it should be called before the root component(s)\n * are rendered.\n *\n * Returns a cleanup function which unregisters the hooks.\n */\nexport function initDevTools() {\n\tif (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\n\t\t// React DevTools are not installed\n\t\treturn;\n\t}\n\n\t// Notify devtools when preact components are mounted, updated or unmounted\n\tconst bridge = createDevToolsBridge();\n\n\tconst nextAfterMount = options.afterMount;\n\toptions.afterMount = component => {\n\t\tbridge.componentAdded(component);\n\t\tif (nextAfterMount) nextAfterMount(component);\n\t};\n\n\tconst nextAfterUpdate = options.afterUpdate;\n\toptions.afterUpdate = component => {\n\t\tbridge.componentUpdated(component);\n\t\tif (nextAfterUpdate) nextAfterUpdate(component);\n\t};\n\n\tconst nextBeforeUnmount = options.beforeUnmount;\n\toptions.beforeUnmount = component => {\n\t\tbridge.componentRemoved(component);\n\t\tif (nextBeforeUnmount) nextBeforeUnmount(component);\n\t};\n\n\t// Notify devtools about this instance of \"React\"\n\t__REACT_DEVTOOLS_GLOBAL_HOOK__.inject(bridge);\n\n\treturn () => {\n\t\toptions.afterMount = nextAfterMount;\n\t\toptions.afterUpdate = nextAfterUpdate;\n\t\toptions.beforeUnmount = nextBeforeUnmount;\n\t};\n}\n","import { initDevTools } from './devtools';\n\ninitDevTools();\n\n"],"names":["ATTR_KEY","createReactElement","component","type","constructor","key","ref","props","createReactDOMComponent","node","childNodes","nodeType","Node","ELEMENT_NODE","Array","from","isText","TEXT_NODE","_currentElement","textContent","nodeName","toLowerCase","_renderedChildren","map","child","_component","updateReactComponent","_stringText","_inDevTools","typeName","element","displayName","name","createReactCompositeComponent","base","instance","getPublicInstance","getName","state","forceUpdate","bind","setState","_instance","_renderedComponent","instanceMap","Map","componentOrNode","newInstance","has","inst","get","Object","assign","set","nextRootKey","roots","keys","length","findRoots","forEach","createDevToolsBridge","ComponentTree","getNodeFromInstance","getClosestInstanceFromNode","parentNode","document","body","Mount","_instancesByReactRootID","_renderNewRootComponent","Reconciler","mountComponent","performUpdateIfNecessary","receiveComponent","unmountComponent","componentAdded","isRootComponent","_rootID","visitNonCompositeChildren","childInst","componentUpdated","prevRenderedChildren","push","info","_topLevelWrapper","contains","delete","componentRemoved","_parentComponent","__u","parentElement","visitor","initDevTools","__REACT_DEVTOOLS_GLOBAL_HOOK__","bridge","nextAfterMount","options","afterMount","nextAfterUpdate","afterUpdate","nextBeforeUnmount","beforeUnmount","inject"],"mappings":";;;;;;CAAA;;AAYA,CAAO,IAAMA,WAAW,eAAjB;;CCZP;;CAOA;;;;CAIA,SAASC,kBAAT,CAA4BC,SAA5B,EAAuC;CACtC,QAAO;CACNC,QAAMD,UAAUE,WADV;CAENC,OAAKH,UAAUG,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