code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === void 0) { try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ""; } } return "\n" + prefix + name; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
describeBuiltInComponentFrame
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function describeNativeComponentFrame(fn, construct) { if (!fn || reentry) { return ""; } { var frame = componentFrameCache.get(fn); if (frame !== void 0) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher.current; ReactCurrentDispatcher.current = null; disableLogs(); } try { if (construct) { var Fake = function() { throw Error(); }; Object.defineProperty(Fake.prototype, "props", { set: function() { throw Error(); } }); if (typeof Reflect === "object" && Reflect.construct) { try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { if (sample && control && typeof sample.stack === "string") { var sampleLines = sample.stack.split("\n"); var controlLines = control.stack.split("\n"); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { c--; } for (; s >= 1 && c >= 0; s--, c--) { if (sampleLines[s] !== controlLines[c]) { if (s !== 1 || c !== 1) { do { s--; c--; if (c < 0 || sampleLines[s] !== controlLines[c]) { var _frame = "\n" + sampleLines[s].replace(" at new ", " at "); if (fn.displayName && _frame.includes("<anonymous>")) { _frame = _frame.replace("<anonymous>", fn.displayName); } { if (typeof fn === "function") { componentFrameCache.set(fn, _frame); } } return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } var name = fn ? fn.displayName || fn.name : ""; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ""; { if (typeof fn === "function") { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
describeNativeComponentFrame
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
Fake = function() { throw Error(); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
Fake
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function describeClassComponentFrame(ctor, source, ownerFn) { { return describeNativeComponentFrame(ctor, true); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
describeClassComponentFrame
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
describeFunctionComponentFrame
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function shouldConstruct(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
shouldConstruct
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ""; } if (typeof type === "function") { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === "string") { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame("Suspense"); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame("SuspenseList"); } if (typeof type === "object") { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) { } } } } return ""; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
describeUnknownElementTypeFrameInDEV
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function setCurrentlyValidatingElement(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame.setExtraStackFrame(null); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
setCurrentlyValidatingElement
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function checkPropTypes(typeSpecs, values, location, componentName, element) { { var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error$1 = void 0; try { if (typeof typeSpecs[typeSpecName] !== "function") { var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); err.name = "Invariant Violation"; throw err; } error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (ex) { error$1 = ex; } if (error$1 && !(error$1 instanceof Error)) { setCurrentlyValidatingElement(element); error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1); setCurrentlyValidatingElement(null); } if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { loggedTypeFailures[error$1.message] = true; setCurrentlyValidatingElement(element); error("Failed %s type: %s", location, error$1.message); setCurrentlyValidatingElement(null); } } } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
checkPropTypes
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function getMaskedContext(type, unmaskedContext) { { var contextTypes = type.contextTypes; if (!contextTypes) { return emptyContextObject; } var context = {}; for (var key in contextTypes) { context[key] = unmaskedContext[key]; } { var name = getComponentNameFromType(type) || "Unknown"; checkPropTypes(contextTypes, context, "context", name); } return context; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getMaskedContext
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function processChildContext(instance, type, parentContext, childContextTypes) { { if (typeof instance.getChildContext !== "function") { { var componentName = getComponentNameFromType(type) || "Unknown"; if (!warnedAboutMissingGetChildContext[componentName]) { warnedAboutMissingGetChildContext[componentName] = true; error("%s.childContextTypes is specified but there is no getChildContext() method on the instance. You can either define getChildContext() on %s or remove childContextTypes from it.", componentName, componentName); } } return parentContext; } var childContext = instance.getChildContext(); for (var contextKey in childContext) { if (!(contextKey in childContextTypes)) { throw new Error((getComponentNameFromType(type) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'); } } { var name = getComponentNameFromType(type) || "Unknown"; checkPropTypes(childContextTypes, childContext, "child context", name); } return assign({}, parentContext, childContext); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
processChildContext
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function popNode(prev) { { prev.context._currentValue2 = prev.parentValue; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
popNode
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function pushNode(next) { { next.context._currentValue2 = next.value; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushNode
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function popToNearestCommonAncestor(prev, next) { if (prev === next) ; else { popNode(prev); var parentPrev = prev.parent; var parentNext = next.parent; if (parentPrev === null) { if (parentNext !== null) { throw new Error("The stacks must reach the root at the same time. This is a bug in React."); } } else { if (parentNext === null) { throw new Error("The stacks must reach the root at the same time. This is a bug in React."); } popToNearestCommonAncestor(parentPrev, parentNext); } pushNode(next); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
popToNearestCommonAncestor
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function popAllPrevious(prev) { popNode(prev); var parentPrev = prev.parent; if (parentPrev !== null) { popAllPrevious(parentPrev); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
popAllPrevious
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function pushAllNext(next) { var parentNext = next.parent; if (parentNext !== null) { pushAllNext(parentNext); } pushNode(next); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushAllNext
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function popPreviousToCommonLevel(prev, next) { popNode(prev); var parentPrev = prev.parent; if (parentPrev === null) { throw new Error("The depth must equal at least at zero before reaching the root. This is a bug in React."); } if (parentPrev.depth === next.depth) { popToNearestCommonAncestor(parentPrev, next); } else { popPreviousToCommonLevel(parentPrev, next); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
popPreviousToCommonLevel
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function popNextToCommonLevel(prev, next) { var parentNext = next.parent; if (parentNext === null) { throw new Error("The depth must equal at least at zero before reaching the root. This is a bug in React."); } if (prev.depth === parentNext.depth) { popToNearestCommonAncestor(prev, parentNext); } else { popNextToCommonLevel(prev, parentNext); } pushNode(next); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
popNextToCommonLevel
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function switchContext(newSnapshot) { var prev = currentActiveSnapshot; var next = newSnapshot; if (prev !== next) { if (prev === null) { pushAllNext(next); } else if (next === null) { popAllPrevious(prev); } else if (prev.depth === next.depth) { popToNearestCommonAncestor(prev, next); } else if (prev.depth > next.depth) { popPreviousToCommonLevel(prev, next); } else { popNextToCommonLevel(prev, next); } currentActiveSnapshot = next; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
switchContext
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function pushProvider(context, nextValue) { var prevValue; { prevValue = context._currentValue2; context._currentValue2 = nextValue; { if (context._currentRenderer2 !== void 0 && context._currentRenderer2 !== null && context._currentRenderer2 !== rendererSigil) { error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."); } context._currentRenderer2 = rendererSigil; } } var prevNode = currentActiveSnapshot; var newNode = { parent: prevNode, depth: prevNode === null ? 0 : prevNode.depth + 1, context, parentValue: prevValue, value: nextValue }; currentActiveSnapshot = newNode; return newNode; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushProvider
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function popProvider(context) { var prevSnapshot = currentActiveSnapshot; if (prevSnapshot === null) { throw new Error("Tried to pop a Context at the root of the app. This is a bug in React."); } { if (prevSnapshot.context !== context) { error("The parent context is not the expected context. This is probably a bug in React."); } } { var _value = prevSnapshot.parentValue; if (_value === REACT_SERVER_CONTEXT_DEFAULT_VALUE_NOT_LOADED) { prevSnapshot.context._currentValue2 = prevSnapshot.context._defaultValue; } else { prevSnapshot.context._currentValue2 = _value; } { if (context._currentRenderer2 !== void 0 && context._currentRenderer2 !== null && context._currentRenderer2 !== rendererSigil) { error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."); } context._currentRenderer2 = rendererSigil; } } return currentActiveSnapshot = prevSnapshot.parent; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
popProvider
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function getActiveContext() { return currentActiveSnapshot; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getActiveContext
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function readContext(context) { var value = context._currentValue2; return value; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
readContext
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function get(key) { return key._reactInternals; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
get
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function set(key, value) { key._reactInternals = value; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
set
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function warnNoop(publicInstance, callerName) { { var _constructor = publicInstance.constructor; var componentName = _constructor && getComponentNameFromType(_constructor) || "ReactClass"; var warningKey = componentName + "." + callerName; if (didWarnAboutNoopUpdateForComponent[warningKey]) { return; } error("%s(...): Can only update a mounting component. This usually means you called %s() outside componentWillMount() on the server. This is a no-op.\n\nPlease check the code for the %s component.", callerName, callerName, componentName); didWarnAboutNoopUpdateForComponent[warningKey] = true; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
warnNoop
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function applyDerivedStateFromProps(instance, ctor, getDerivedStateFromProps, prevState, nextProps) { var partialState = getDerivedStateFromProps(nextProps, prevState); { warnOnUndefinedDerivedState(ctor, partialState); } var newState = partialState === null || partialState === void 0 ? prevState : assign({}, prevState, partialState); return newState; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
applyDerivedStateFromProps
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function constructClassInstance(ctor, props, maskedLegacyContext) { var context = emptyContextObject; var contextType = ctor.contextType; { if ("contextType" in ctor) { var isValid = ( // Allow null for conditional declaration contextType === null || contextType !== void 0 && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === void 0 ); if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) { didWarnAboutInvalidateContextType.add(ctor); var addendum = ""; if (contextType === void 0) { addendum = " However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file."; } else if (typeof contextType !== "object") { addendum = " However, it is set to a " + typeof contextType + "."; } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) { addendum = " Did you accidentally pass the Context.Provider instead?"; } else if (contextType._context !== void 0) { addendum = " Did you accidentally pass the Context.Consumer instead?"; } else { addendum = " However, it is set to an object with keys {" + Object.keys(contextType).join(", ") + "}."; } error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", getComponentNameFromType(ctor) || "Component", addendum); } } } if (typeof contextType === "object" && contextType !== null) { context = readContext(contextType); } else { context = maskedLegacyContext; } var instance = new ctor(props, context); { if (typeof ctor.getDerivedStateFromProps === "function" && (instance.state === null || instance.state === void 0)) { var componentName = getComponentNameFromType(ctor) || "Component"; if (!didWarnAboutUninitializedState.has(componentName)) { didWarnAboutUninitializedState.add(componentName); error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.", componentName, instance.state === null ? "null" : "undefined", componentName); } } if (typeof ctor.getDerivedStateFromProps === "function" || typeof instance.getSnapshotBeforeUpdate === "function") { var foundWillMountName = null; var foundWillReceivePropsName = null; var foundWillUpdateName = null; if (typeof instance.componentWillMount === "function" && instance.componentWillMount.__suppressDeprecationWarning !== true) { foundWillMountName = "componentWillMount"; } else if (typeof instance.UNSAFE_componentWillMount === "function") { foundWillMountName = "UNSAFE_componentWillMount"; } if (typeof instance.componentWillReceiveProps === "function" && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { foundWillReceivePropsName = "componentWillReceiveProps"; } else if (typeof instance.UNSAFE_componentWillReceiveProps === "function") { foundWillReceivePropsName = "UNSAFE_componentWillReceiveProps"; } if (typeof instance.componentWillUpdate === "function" && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { foundWillUpdateName = "componentWillUpdate"; } else if (typeof instance.UNSAFE_componentWillUpdate === "function") { foundWillUpdateName = "UNSAFE_componentWillUpdate"; } if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { var _componentName = getComponentNameFromType(ctor) || "Component"; var newApiName = typeof ctor.getDerivedStateFromProps === "function" ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()"; if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://reactjs.org/link/unsafe-component-lifecycles", _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : "", foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : "", foundWillUpdateName !== null ? "\n " + foundWillUpdateName : ""); } } } } return instance; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
constructClassInstance
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function checkClassInstance(instance, ctor, newProps) { { var name = getComponentNameFromType(ctor) || "Component"; var renderPresent = instance.render; if (!renderPresent) { if (ctor.prototype && typeof ctor.prototype.render === "function") { error("%s(...): No `render` method found on the returned component instance: did you accidentally return an object from the constructor?", name); } else { error("%s(...): No `render` method found on the returned component instance: you may have forgotten to define `render`.", name); } } if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) { error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?", name); } if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) { error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.", name); } if (instance.propTypes) { error("propTypes was defined as an instance property on %s. Use a static property to define propTypes instead.", name); } if (instance.contextType) { error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.", name); } { if (instance.contextTypes) { error("contextTypes was defined as an instance property on %s. Use a static property to define contextTypes instead.", name); } if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { didWarnAboutContextTypeAndContextTypes.add(ctor); error("%s declares both contextTypes and contextType static properties. The legacy contextTypes property will be ignored.", name); } } if (typeof instance.componentShouldUpdate === "function") { error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.", name); } if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== "undefined") { error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", getComponentNameFromType(ctor) || "A pure component"); } if (typeof instance.componentDidUnmount === "function") { error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", name); } if (typeof instance.componentDidReceiveProps === "function") { error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().", name); } if (typeof instance.componentWillRecieveProps === "function") { error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name); } if (typeof instance.UNSAFE_componentWillRecieveProps === "function") { error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", name); } var hasMutatedProps = instance.props !== newProps; if (instance.props !== void 0 && hasMutatedProps) { error("%s(...): When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", name, name); } if (instance.defaultProps) { error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.", name, name); } if (typeof instance.getSnapshotBeforeUpdate === "function" && typeof instance.componentDidUpdate !== "function" && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", getComponentNameFromType(ctor)); } if (typeof instance.getDerivedStateFromProps === "function") { error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name); } if (typeof instance.getDerivedStateFromError === "function") { error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", name); } if (typeof ctor.getSnapshotBeforeUpdate === "function") { error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", name); } var _state = instance.state; if (_state && (typeof _state !== "object" || isArray(_state))) { error("%s.state: must be set to an object or null", name); } if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") { error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", name); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
checkClassInstance
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function callComponentWillMount(type, instance) { var oldState = instance.state; if (typeof instance.componentWillMount === "function") { { if (instance.componentWillMount.__suppressDeprecationWarning !== true) { var componentName = getComponentNameFromType(type) || "Unknown"; if (!didWarnAboutDeprecatedWillMount[componentName]) { warn( // keep this warning in sync with ReactStrictModeWarning.js "componentWillMount has been renamed, and is not recommended for use. See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n* Move code from componentWillMount to componentDidMount (preferred in most cases) or the constructor.\n\nPlease update the following components: %s", componentName ); didWarnAboutDeprecatedWillMount[componentName] = true; } } } instance.componentWillMount(); } if (typeof instance.UNSAFE_componentWillMount === "function") { instance.UNSAFE_componentWillMount(); } if (oldState !== instance.state) { { error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", getComponentNameFromType(type) || "Component"); } classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
callComponentWillMount
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function processUpdateQueue(internalInstance, inst, props, maskedLegacyContext) { if (internalInstance.queue !== null && internalInstance.queue.length > 0) { var oldQueue = internalInstance.queue; var oldReplace = internalInstance.replace; internalInstance.queue = null; internalInstance.replace = false; if (oldReplace && oldQueue.length === 1) { inst.state = oldQueue[0]; } else { var nextState = oldReplace ? oldQueue[0] : inst.state; var dontMutate = true; for (var i = oldReplace ? 1 : 0; i < oldQueue.length; i++) { var partial = oldQueue[i]; var partialState = typeof partial === "function" ? partial.call(inst, nextState, props, maskedLegacyContext) : partial; if (partialState != null) { if (dontMutate) { dontMutate = false; nextState = assign({}, nextState, partialState); } else { assign(nextState, partialState); } } } inst.state = nextState; } } else { internalInstance.queue = null; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
processUpdateQueue
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function mountClassInstance(instance, ctor, newProps, maskedLegacyContext) { { checkClassInstance(instance, ctor, newProps); } var initialState = instance.state !== void 0 ? instance.state : null; instance.updater = classComponentUpdater; instance.props = newProps; instance.state = initialState; var internalInstance = { queue: [], replace: false }; set(instance, internalInstance); var contextType = ctor.contextType; if (typeof contextType === "object" && contextType !== null) { instance.context = readContext(contextType); } else { instance.context = maskedLegacyContext; } { if (instance.state === newProps) { var componentName = getComponentNameFromType(ctor) || "Component"; if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { didWarnAboutDirectlyAssigningPropsToState.add(componentName); error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.", componentName); } } } var getDerivedStateFromProps = ctor.getDerivedStateFromProps; if (typeof getDerivedStateFromProps === "function") { instance.state = applyDerivedStateFromProps(instance, ctor, getDerivedStateFromProps, initialState, newProps); } if (typeof ctor.getDerivedStateFromProps !== "function" && typeof instance.getSnapshotBeforeUpdate !== "function" && (typeof instance.UNSAFE_componentWillMount === "function" || typeof instance.componentWillMount === "function")) { callComponentWillMount(ctor, instance); processUpdateQueue(internalInstance, instance, newProps, maskedLegacyContext); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
mountClassInstance
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function getTreeId(context) { var overflow = context.overflow; var idWithLeadingBit = context.id; var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit); return id.toString(32) + overflow; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getTreeId
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function pushTreeContext(baseContext, totalChildren, index) { var baseIdWithLeadingBit = baseContext.id; var baseOverflow = baseContext.overflow; var baseLength = getBitLength(baseIdWithLeadingBit) - 1; var baseId = baseIdWithLeadingBit & ~(1 << baseLength); var slot = index + 1; var length = getBitLength(totalChildren) + baseLength; if (length > 30) { var numberOfOverflowBits = baseLength - baseLength % 5; var newOverflowBits = (1 << numberOfOverflowBits) - 1; var newOverflow = (baseId & newOverflowBits).toString(32); var restOfBaseId = baseId >> numberOfOverflowBits; var restOfBaseLength = baseLength - numberOfOverflowBits; var restOfLength = getBitLength(totalChildren) + restOfBaseLength; var restOfNewBits = slot << restOfBaseLength; var id = restOfNewBits | restOfBaseId; var overflow = newOverflow + baseOverflow; return { id: 1 << restOfLength | id, overflow }; } else { var newBits = slot << baseLength; var _id = newBits | baseId; var _overflow = baseOverflow; return { id: 1 << length | _id, overflow: _overflow }; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushTreeContext
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function getBitLength(number) { return 32 - clz32(number); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getBitLength
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function getLeadingBit(id) { return 1 << getBitLength(id) - 1; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getLeadingBit
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function clz32Fallback(x) { var asUint = x >>> 0; if (asUint === 0) { return 32; } return 31 - (log(asUint) / LN2 | 0) | 0; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
clz32Fallback
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function is(x, y) { return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
is
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function resolveCurrentlyRenderingComponent() { if (currentlyRenderingComponent === null) { throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); } { if (isInHookUserCodeInDev) { error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://reactjs.org/link/rules-of-hooks"); } } return currentlyRenderingComponent; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
resolveCurrentlyRenderingComponent
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function areHookInputsEqual(nextDeps, prevDeps) { if (prevDeps === null) { { error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.", currentHookNameInDev); } return false; } { if (nextDeps.length !== prevDeps.length) { error("The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", currentHookNameInDev, "[" + nextDeps.join(", ") + "]", "[" + prevDeps.join(", ") + "]"); } } for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { if (objectIs(nextDeps[i], prevDeps[i])) { continue; } return false; } return true; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
areHookInputsEqual
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function createHook() { if (numberOfReRenders > 0) { throw new Error("Rendered more hooks than during the previous render"); } return { memoizedState: null, queue: null, next: null }; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
createHook
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function createWorkInProgressHook() { if (workInProgressHook === null) { if (firstWorkInProgressHook === null) { isReRender = false; firstWorkInProgressHook = workInProgressHook = createHook(); } else { isReRender = true; workInProgressHook = firstWorkInProgressHook; } } else { if (workInProgressHook.next === null) { isReRender = false; workInProgressHook = workInProgressHook.next = createHook(); } else { isReRender = true; workInProgressHook = workInProgressHook.next; } } return workInProgressHook; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
createWorkInProgressHook
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function prepareToUseHooks(task, componentIdentity) { currentlyRenderingComponent = componentIdentity; currentlyRenderingTask = task; { isInHookUserCodeInDev = false; } localIdCounter = 0; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
prepareToUseHooks
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function finishHooks(Component, props, children, refOrContext) { while (didScheduleRenderPhaseUpdate) { didScheduleRenderPhaseUpdate = false; localIdCounter = 0; numberOfReRenders += 1; workInProgressHook = null; children = Component(props, refOrContext); } resetHooksState(); return children; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
finishHooks
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function checkDidRenderIdHook() { var didRenderIdHook = localIdCounter !== 0; return didRenderIdHook; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
checkDidRenderIdHook
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function resetHooksState() { { isInHookUserCodeInDev = false; } currentlyRenderingComponent = null; currentlyRenderingTask = null; didScheduleRenderPhaseUpdate = false; firstWorkInProgressHook = null; numberOfReRenders = 0; renderPhaseUpdates = null; workInProgressHook = null; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
resetHooksState
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function readContext$1(context) { { if (isInHookUserCodeInDev) { error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); } } return readContext(context); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
readContext$1
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useContext(context) { { currentHookNameInDev = "useContext"; } resolveCurrentlyRenderingComponent(); return readContext(context); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useContext
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function basicStateReducer(state, action) { return typeof action === "function" ? action(state) : action; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
basicStateReducer
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useState(initialState) { { currentHookNameInDev = "useState"; } return useReducer( basicStateReducer, // useReducer has a special case to support lazy useState initializers initialState ); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useState
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useReducer(reducer, initialArg, init) { { if (reducer !== basicStateReducer) { currentHookNameInDev = "useReducer"; } } currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); if (isReRender) { var queue = workInProgressHook.queue; var dispatch = queue.dispatch; if (renderPhaseUpdates !== null) { var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); if (firstRenderPhaseUpdate !== void 0) { renderPhaseUpdates.delete(queue); var newState = workInProgressHook.memoizedState; var update = firstRenderPhaseUpdate; do { var action = update.action; { isInHookUserCodeInDev = true; } newState = reducer(newState, action); { isInHookUserCodeInDev = false; } update = update.next; } while (update !== null); workInProgressHook.memoizedState = newState; return [newState, dispatch]; } } return [workInProgressHook.memoizedState, dispatch]; } else { { isInHookUserCodeInDev = true; } var initialState; if (reducer === basicStateReducer) { initialState = typeof initialArg === "function" ? initialArg() : initialArg; } else { initialState = init !== void 0 ? init(initialArg) : initialArg; } { isInHookUserCodeInDev = false; } workInProgressHook.memoizedState = initialState; var _queue = workInProgressHook.queue = { last: null, dispatch: null }; var _dispatch = _queue.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue); return [workInProgressHook.memoizedState, _dispatch]; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useReducer
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useMemo(nextCreate, deps) { currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); var nextDeps = deps === void 0 ? null : deps; if (workInProgressHook !== null) { var prevState = workInProgressHook.memoizedState; if (prevState !== null) { if (nextDeps !== null) { var prevDeps = prevState[1]; if (areHookInputsEqual(nextDeps, prevDeps)) { return prevState[0]; } } } } { isInHookUserCodeInDev = true; } var nextValue = nextCreate(); { isInHookUserCodeInDev = false; } workInProgressHook.memoizedState = [nextValue, nextDeps]; return nextValue; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useMemo
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useRef(initialValue) { currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); workInProgressHook = createWorkInProgressHook(); var previousRef = workInProgressHook.memoizedState; if (previousRef === null) { var ref = { current: initialValue }; { Object.seal(ref); } workInProgressHook.memoizedState = ref; return ref; } else { return previousRef; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useRef
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useLayoutEffect(create, inputs) { { currentHookNameInDev = "useLayoutEffect"; error("useLayoutEffect does nothing on the server, because its effect cannot be encoded into the server renderer's output format. This will lead to a mismatch between the initial, non-hydrated UI and the intended UI. To avoid this, useLayoutEffect should only be used in components that render exclusively on the client. See https://reactjs.org/link/uselayouteffect-ssr for common fixes."); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useLayoutEffect
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function dispatchAction(componentIdentity, queue, action) { if (numberOfReRenders >= RE_RENDER_LIMIT) { throw new Error("Too many re-renders. React limits the number of renders to prevent an infinite loop."); } if (componentIdentity === currentlyRenderingComponent) { didScheduleRenderPhaseUpdate = true; var update = { action, next: null }; if (renderPhaseUpdates === null) { renderPhaseUpdates = /* @__PURE__ */ new Map(); } var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue); if (firstRenderPhaseUpdate === void 0) { renderPhaseUpdates.set(queue, update); } else { var lastRenderPhaseUpdate = firstRenderPhaseUpdate; while (lastRenderPhaseUpdate.next !== null) { lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; } lastRenderPhaseUpdate.next = update; } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
dispatchAction
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useCallback(callback, deps) { return useMemo(function() { return callback; }, deps); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useCallback
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useMutableSource(source, getSnapshot, subscribe) { resolveCurrentlyRenderingComponent(); return getSnapshot(source._source); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useMutableSource
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { if (getServerSnapshot === void 0) { throw new Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."); } return getServerSnapshot(); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useSyncExternalStore
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useDeferredValue(value) { resolveCurrentlyRenderingComponent(); return value; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useDeferredValue
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function unsupportedStartTransition() { throw new Error("startTransition cannot be called during server rendering."); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
unsupportedStartTransition
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useTransition() { resolveCurrentlyRenderingComponent(); return [false, unsupportedStartTransition]; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useTransition
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function useId() { var task = currentlyRenderingTask; var treeId = getTreeId(task.treeContext); var responseState = currentResponseState; if (responseState === null) { throw new Error("Invalid hook call. Hooks can only be called inside of the body of a function component."); } var localId = localIdCounter++; return makeId(responseState, treeId, localId); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
useId
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function setCurrentResponseState(responseState) { currentResponseState = responseState; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
setCurrentResponseState
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function getStackByComponentStackNode(componentStack) { try { var info = ""; var node = componentStack; do { switch (node.tag) { case 0: info += describeBuiltInComponentFrame(node.type, null, null); break; case 1: info += describeFunctionComponentFrame(node.type, null, null); break; case 2: info += describeClassComponentFrame(node.type, null, null); break; } node = node.parent; } while (node); return info; } catch (x) { return "\nError generating stack: " + x.message + "\n" + x.stack; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getStackByComponentStackNode
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function defaultErrorHandler(error2) { console["error"](error2); return null; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
defaultErrorHandler
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function createRequest(children, responseState, rootFormatContext, progressiveChunkSize, onError2, onAllReady, onShellReady, onShellError, onFatalError) { var pingedTasks = []; var abortSet = /* @__PURE__ */ new Set(); var request = { destination: null, responseState, progressiveChunkSize: progressiveChunkSize === void 0 ? DEFAULT_PROGRESSIVE_CHUNK_SIZE : progressiveChunkSize, status: OPEN, fatalError: null, nextSegmentId: 0, allPendingTasks: 0, pendingRootTasks: 0, completedRootSegment: null, abortableTasks: abortSet, pingedTasks, clientRenderedBoundaries: [], completedBoundaries: [], partialBoundaries: [], onError: onError2 === void 0 ? defaultErrorHandler : onError2, onAllReady: onAllReady === void 0 ? noop$1 : onAllReady, onShellReady: onShellReady === void 0 ? noop$1 : onShellReady, onShellError: onShellError === void 0 ? noop$1 : onShellError, onFatalError: onFatalError === void 0 ? noop$1 : onFatalError }; var rootSegment = createPendingSegment( request, 0, null, rootFormatContext, // Root segments are never embedded in Text on either edge false, false ); rootSegment.parentFlushed = true; var rootTask = createTask(request, children, null, rootSegment, abortSet, emptyContextObject, rootContextSnapshot, emptyTreeContext); pingedTasks.push(rootTask); return request; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
createRequest
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function pingTask(request, task) { var pingedTasks = request.pingedTasks; pingedTasks.push(task); if (pingedTasks.length === 1) { scheduleWork(function() { return performWork(request); }); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pingTask
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function createSuspenseBoundary(request, fallbackAbortableTasks) { return { id: UNINITIALIZED_SUSPENSE_BOUNDARY_ID, rootSegmentID: -1, parentFlushed: false, pendingTasks: 0, forceClientRender: false, completedSegments: [], byteSize: 0, fallbackAbortableTasks, errorDigest: null }; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
createSuspenseBoundary
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function createTask(request, node, blockedBoundary, blockedSegment, abortSet, legacyContext, context, treeContext) { request.allPendingTasks++; if (blockedBoundary === null) { request.pendingRootTasks++; } else { blockedBoundary.pendingTasks++; } var task = { node, ping: function() { return pingTask(request, task); }, blockedBoundary, blockedSegment, abortSet, legacyContext, context, treeContext }; { task.componentStack = null; } abortSet.add(task); return task; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
createTask
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function createPendingSegment(request, index, boundary, formatContext, lastPushedText, textEmbedded) { return { status: PENDING, id: -1, // lazily assigned later index, parentFlushed: false, chunks: [], children: [], formatContext, boundary, lastPushedText, textEmbedded }; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
createPendingSegment
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function getCurrentStackInDEV() { { if (currentTaskInDEV === null || currentTaskInDEV.componentStack === null) { return ""; } return getStackByComponentStackNode(currentTaskInDEV.componentStack); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
getCurrentStackInDEV
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function pushBuiltInComponentStackInDEV(task, type) { { task.componentStack = { tag: 0, parent: task.componentStack, type }; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushBuiltInComponentStackInDEV
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function pushFunctionComponentStackInDEV(task, type) { { task.componentStack = { tag: 1, parent: task.componentStack, type }; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushFunctionComponentStackInDEV
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function pushClassComponentStackInDEV(task, type) { { task.componentStack = { tag: 2, parent: task.componentStack, type }; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
pushClassComponentStackInDEV
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function popComponentStackInDEV(task) { { if (task.componentStack === null) { error("Unexpectedly popped too many stack frames. This is a bug in React."); } else { task.componentStack = task.componentStack.parent; } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
popComponentStackInDEV
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function captureBoundaryErrorDetailsDev(boundary, error2) { { var errorMessage; if (typeof error2 === "string") { errorMessage = error2; } else if (error2 && typeof error2.message === "string") { errorMessage = error2.message; } else { errorMessage = String(error2); } var errorComponentStack = lastBoundaryErrorComponentStackDev || getCurrentStackInDEV(); lastBoundaryErrorComponentStackDev = null; boundary.errorMessage = errorMessage; boundary.errorComponentStack = errorComponentStack; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
captureBoundaryErrorDetailsDev
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function logRecoverableError(request, error2) { var errorDigest = request.onError(error2); if (errorDigest != null && typeof errorDigest !== "string") { throw new Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' + typeof errorDigest + '" instead'); } return errorDigest; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
logRecoverableError
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function fatalError(request, error2) { var onShellError = request.onShellError; onShellError(error2); var onFatalError = request.onFatalError; onFatalError(error2); if (request.destination !== null) { request.status = CLOSED; closeWithError(request.destination, error2); } else { request.status = CLOSING; request.fatalError = error2; } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
fatalError
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderSuspenseBoundary(request, task, props) { pushBuiltInComponentStackInDEV(task, "Suspense"); var parentBoundary = task.blockedBoundary; var parentSegment = task.blockedSegment; var fallback = props.fallback; var content = props.children; var fallbackAbortSet = /* @__PURE__ */ new Set(); var newBoundary = createSuspenseBoundary(request, fallbackAbortSet); var insertionIndex = parentSegment.chunks.length; var boundarySegment = createPendingSegment( request, insertionIndex, newBoundary, parentSegment.formatContext, // boundaries never require text embedding at their edges because comment nodes bound them false, false ); parentSegment.children.push(boundarySegment); parentSegment.lastPushedText = false; var contentRootSegment = createPendingSegment( request, 0, null, parentSegment.formatContext, // boundaries never require text embedding at their edges because comment nodes bound them false, false ); contentRootSegment.parentFlushed = true; task.blockedBoundary = newBoundary; task.blockedSegment = contentRootSegment; try { renderNode(request, task, content); pushSegmentFinale$1(contentRootSegment.chunks, request.responseState, contentRootSegment.lastPushedText, contentRootSegment.textEmbedded); contentRootSegment.status = COMPLETED; queueCompletedSegment(newBoundary, contentRootSegment); if (newBoundary.pendingTasks === 0) { popComponentStackInDEV(task); return; } } catch (error2) { contentRootSegment.status = ERRORED; newBoundary.forceClientRender = true; newBoundary.errorDigest = logRecoverableError(request, error2); { captureBoundaryErrorDetailsDev(newBoundary, error2); } } finally { task.blockedBoundary = parentBoundary; task.blockedSegment = parentSegment; } var suspendedFallbackTask = createTask(request, fallback, parentBoundary, boundarySegment, fallbackAbortSet, task.legacyContext, task.context, task.treeContext); { suspendedFallbackTask.componentStack = task.componentStack; } request.pingedTasks.push(suspendedFallbackTask); popComponentStackInDEV(task); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderSuspenseBoundary
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderHostElement(request, task, type, props) { pushBuiltInComponentStackInDEV(task, type); var segment = task.blockedSegment; var children = pushStartInstance(segment.chunks, type, props, request.responseState, segment.formatContext); segment.lastPushedText = false; var prevContext = segment.formatContext; segment.formatContext = getChildFormatContext(prevContext, type, props); renderNode(request, task, children); segment.formatContext = prevContext; pushEndInstance(segment.chunks, type); segment.lastPushedText = false; popComponentStackInDEV(task); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderHostElement
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function shouldConstruct$1(Component) { return Component.prototype && Component.prototype.isReactComponent; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
shouldConstruct$1
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderWithHooks(request, task, Component, props, secondArg) { var componentIdentity = {}; prepareToUseHooks(task, componentIdentity); var result = Component(props, secondArg); return finishHooks(Component, props, result, secondArg); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderWithHooks
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function finishClassComponent(request, task, instance, Component, props) { var nextChildren = instance.render(); { if (instance.props !== props) { if (!didWarnAboutReassigningProps) { error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", getComponentNameFromType(Component) || "a component"); } didWarnAboutReassigningProps = true; } } { var childContextTypes = Component.childContextTypes; if (childContextTypes !== null && childContextTypes !== void 0) { var previousContext = task.legacyContext; var mergedContext = processChildContext(instance, Component, previousContext, childContextTypes); task.legacyContext = mergedContext; renderNodeDestructive(request, task, nextChildren); task.legacyContext = previousContext; return; } } renderNodeDestructive(request, task, nextChildren); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
finishClassComponent
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderClassComponent(request, task, Component, props) { pushClassComponentStackInDEV(task, Component); var maskedContext = getMaskedContext(Component, task.legacyContext); var instance = constructClassInstance(Component, props, maskedContext); mountClassInstance(instance, Component, props, maskedContext); finishClassComponent(request, task, instance, Component, props); popComponentStackInDEV(task); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderClassComponent
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderIndeterminateComponent(request, task, Component, props) { var legacyContext; { legacyContext = getMaskedContext(Component, task.legacyContext); } pushFunctionComponentStackInDEV(task, Component); { if (Component.prototype && typeof Component.prototype.render === "function") { var componentName = getComponentNameFromType(Component) || "Unknown"; if (!didWarnAboutBadClass[componentName]) { error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.", componentName, componentName); didWarnAboutBadClass[componentName] = true; } } } var value = renderWithHooks(request, task, Component, props, legacyContext); var hasId = checkDidRenderIdHook(); { if (typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0) { var _componentName = getComponentNameFromType(Component) || "Unknown"; if (!didWarnAboutModulePatternComponent[_componentName]) { error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName, _componentName, _componentName); didWarnAboutModulePatternComponent[_componentName] = true; } } } if ( // Run these checks in production only if the flag is off. // Eventually we'll delete this branch altogether. typeof value === "object" && value !== null && typeof value.render === "function" && value.$$typeof === void 0 ) { { var _componentName2 = getComponentNameFromType(Component) || "Unknown"; if (!didWarnAboutModulePatternComponent[_componentName2]) { error("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.", _componentName2, _componentName2, _componentName2); didWarnAboutModulePatternComponent[_componentName2] = true; } } mountClassInstance(value, Component, props, legacyContext); finishClassComponent(request, task, value, Component, props); } else { { validateFunctionComponentInDev(Component); } if (hasId) { var prevTreeContext = task.treeContext; var totalChildren = 1; var index = 0; task.treeContext = pushTreeContext(prevTreeContext, totalChildren, index); try { renderNodeDestructive(request, task, value); } finally { task.treeContext = prevTreeContext; } } else { renderNodeDestructive(request, task, value); } } popComponentStackInDEV(task); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderIndeterminateComponent
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function validateFunctionComponentInDev(Component) { { if (Component) { if (Component.childContextTypes) { error("%s(...): childContextTypes cannot be defined on a function component.", Component.displayName || Component.name || "Component"); } } if (typeof Component.getDerivedStateFromProps === "function") { var _componentName3 = getComponentNameFromType(Component) || "Unknown"; if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) { error("%s: Function components do not support getDerivedStateFromProps.", _componentName3); didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true; } } if (typeof Component.contextType === "object" && Component.contextType !== null) { var _componentName4 = getComponentNameFromType(Component) || "Unknown"; if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { error("%s: Function components do not support contextType.", _componentName4); didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; } } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
validateFunctionComponentInDev
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function resolveDefaultProps(Component, baseProps) { if (Component && Component.defaultProps) { var props = assign({}, baseProps); var defaultProps = Component.defaultProps; for (var propName in defaultProps) { if (props[propName] === void 0) { props[propName] = defaultProps[propName]; } } return props; } return baseProps; }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
resolveDefaultProps
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderForwardRef(request, task, type, props, ref) { pushFunctionComponentStackInDEV(task, type.render); var children = renderWithHooks(request, task, type.render, props, ref); var hasId = checkDidRenderIdHook(); if (hasId) { var prevTreeContext = task.treeContext; var totalChildren = 1; var index = 0; task.treeContext = pushTreeContext(prevTreeContext, totalChildren, index); try { renderNodeDestructive(request, task, children); } finally { task.treeContext = prevTreeContext; } } else { renderNodeDestructive(request, task, children); } popComponentStackInDEV(task); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderForwardRef
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderMemo(request, task, type, props, ref) { var innerType = type.type; var resolvedProps = resolveDefaultProps(innerType, props); renderElement(request, task, innerType, resolvedProps, ref); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderMemo
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderContextConsumer(request, task, context, props) { { if (context._context === void 0) { if (context !== context.Consumer) { if (!hasWarnedAboutUsingContextAsConsumer) { hasWarnedAboutUsingContextAsConsumer = true; error("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"); } } } else { context = context._context; } } var render = props.children; { if (typeof render !== "function") { error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."); } } var newValue = readContext(context); var newChildren = render(newValue); renderNodeDestructive(request, task, newChildren); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderContextConsumer
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderContextProvider(request, task, type, props) { var context = type._context; var value = props.value; var children = props.children; var prevSnapshot; { prevSnapshot = task.context; } task.context = pushProvider(context, value); renderNodeDestructive(request, task, children); task.context = popProvider(context); { if (prevSnapshot !== task.context) { error("Popping the context provider did not return back to the original snapshot. This is a bug in React."); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderContextProvider
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderLazyComponent(request, task, lazyComponent, props, ref) { pushBuiltInComponentStackInDEV(task, "Lazy"); var payload = lazyComponent._payload; var init = lazyComponent._init; var Component = init(payload); var resolvedProps = resolveDefaultProps(Component, props); renderElement(request, task, Component, resolvedProps, ref); popComponentStackInDEV(task); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderLazyComponent
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderElement(request, task, type, props, ref) { if (typeof type === "function") { if (shouldConstruct$1(type)) { renderClassComponent(request, task, type, props); return; } else { renderIndeterminateComponent(request, task, type, props); return; } } if (typeof type === "string") { renderHostElement(request, task, type, props); return; } switch (type) { case REACT_LEGACY_HIDDEN_TYPE: case REACT_DEBUG_TRACING_MODE_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_PROFILER_TYPE: case REACT_FRAGMENT_TYPE: { renderNodeDestructive(request, task, props.children); return; } case REACT_SUSPENSE_LIST_TYPE: { pushBuiltInComponentStackInDEV(task, "SuspenseList"); renderNodeDestructive(request, task, props.children); popComponentStackInDEV(task); return; } case REACT_SCOPE_TYPE: { throw new Error("ReactDOMServer does not yet support scope components."); } case REACT_SUSPENSE_TYPE: { { renderSuspenseBoundary(request, task, props); } return; } } if (typeof type === "object" && type !== null) { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: { renderForwardRef(request, task, type, props, ref); return; } case REACT_MEMO_TYPE: { renderMemo(request, task, type, props, ref); return; } case REACT_PROVIDER_TYPE: { renderContextProvider(request, task, type, props); return; } case REACT_CONTEXT_TYPE: { renderContextConsumer(request, task, type, props); return; } case REACT_LAZY_TYPE: { renderLazyComponent(request, task, type, props); return; } } } var info = ""; { if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) { info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."; } } throw new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) " + ("but got: " + (type == null ? type : typeof type) + "." + info)); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderElement
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function validateIterable(iterable, iteratorFn) { { if (typeof Symbol === "function" && // $FlowFixMe Flow doesn't know about toStringTag iterable[Symbol.toStringTag] === "Generator") { if (!didWarnAboutGenerators) { error("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."); } didWarnAboutGenerators = true; } if (iterable.entries === iteratorFn) { if (!didWarnAboutMaps) { error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."); } didWarnAboutMaps = true; } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
validateIterable
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderNodeDestructive(request, task, node) { { try { return renderNodeDestructiveImpl(request, task, node); } catch (x) { if (typeof x === "object" && x !== null && typeof x.then === "function") ; else { lastBoundaryErrorComponentStackDev = lastBoundaryErrorComponentStackDev !== null ? lastBoundaryErrorComponentStackDev : getCurrentStackInDEV(); } throw x; } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderNodeDestructive
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderNodeDestructiveImpl(request, task, node) { task.node = node; if (typeof node === "object" && node !== null) { switch (node.$$typeof) { case REACT_ELEMENT_TYPE: { var element = node; var type = element.type; var props = element.props; var ref = element.ref; renderElement(request, task, type, props, ref); return; } case REACT_PORTAL_TYPE: throw new Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render."); case REACT_LAZY_TYPE: { var lazyNode = node; var payload = lazyNode._payload; var init = lazyNode._init; var resolvedNode; { try { resolvedNode = init(payload); } catch (x) { if (typeof x === "object" && x !== null && typeof x.then === "function") { pushBuiltInComponentStackInDEV(task, "Lazy"); } throw x; } } renderNodeDestructive(request, task, resolvedNode); return; } } if (isArray(node)) { renderChildrenArray(request, task, node); return; } var iteratorFn = getIteratorFn(node); if (iteratorFn) { { validateIterable(node, iteratorFn); } var iterator = iteratorFn.call(node); if (iterator) { var step = iterator.next(); if (!step.done) { var children = []; do { children.push(step.value); step = iterator.next(); } while (!step.done); renderChildrenArray(request, task, children); return; } return; } } var childString = Object.prototype.toString.call(node); throw new Error("Objects are not valid as a React child (found: " + (childString === "[object Object]" ? "object with keys {" + Object.keys(node).join(", ") + "}" : childString) + "). If you meant to render a collection of children, use an array instead."); } if (typeof node === "string") { var segment = task.blockedSegment; segment.lastPushedText = pushTextInstance$1(task.blockedSegment.chunks, node, request.responseState, segment.lastPushedText); return; } if (typeof node === "number") { var _segment = task.blockedSegment; _segment.lastPushedText = pushTextInstance$1(task.blockedSegment.chunks, "" + node, request.responseState, _segment.lastPushedText); return; } { if (typeof node === "function") { error("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it."); } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderNodeDestructiveImpl
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderChildrenArray(request, task, children) { var totalChildren = children.length; for (var i = 0; i < totalChildren; i++) { var prevTreeContext = task.treeContext; task.treeContext = pushTreeContext(prevTreeContext, totalChildren, i); try { renderNode(request, task, children[i]); } finally { task.treeContext = prevTreeContext; } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderChildrenArray
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function spawnNewSuspendedTask(request, task, x) { var segment = task.blockedSegment; var insertionIndex = segment.chunks.length; var newSegment = createPendingSegment( request, insertionIndex, null, segment.formatContext, // Adopt the parent segment's leading text embed segment.lastPushedText, // Assume we are text embedded at the trailing edge true ); segment.children.push(newSegment); segment.lastPushedText = false; var newTask = createTask(request, task.node, task.blockedBoundary, newSegment, task.abortSet, task.legacyContext, task.context, task.treeContext); { if (task.componentStack !== null) { newTask.componentStack = task.componentStack.parent; } } var ping = newTask.ping; x.then(ping, ping); }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
spawnNewSuspendedTask
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function renderNode(request, task, node) { var previousFormatContext = task.blockedSegment.formatContext; var previousLegacyContext = task.legacyContext; var previousContext = task.context; var previousComponentStack = null; { previousComponentStack = task.componentStack; } try { return renderNodeDestructive(request, task, node); } catch (x) { resetHooksState(); if (typeof x === "object" && x !== null && typeof x.then === "function") { spawnNewSuspendedTask(request, task, x); task.blockedSegment.formatContext = previousFormatContext; task.legacyContext = previousLegacyContext; task.context = previousContext; switchContext(previousContext); { task.componentStack = previousComponentStack; } return; } else { task.blockedSegment.formatContext = previousFormatContext; task.legacyContext = previousLegacyContext; task.context = previousContext; switchContext(previousContext); { task.componentStack = previousComponentStack; } throw x; } } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
renderNode
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT
function erroredTask(request, boundary, segment, error2) { var errorDigest = logRecoverableError(request, error2); if (boundary === null) { fatalError(request, error2); } else { boundary.pendingTasks--; if (!boundary.forceClientRender) { boundary.forceClientRender = true; boundary.errorDigest = errorDigest; { captureBoundaryErrorDetailsDev(boundary, error2); } if (boundary.parentFlushed) { request.clientRenderedBoundaries.push(boundary); } } } request.allPendingTasks--; if (request.allPendingTasks === 0) { var onAllReady = request.onAllReady; onAllReady(); } }
Sets a subset of the state. This only exists because _pendingState is internal. This provides a merging strategy that is not available to deep properties which is confusing. TODO: Expose pendingState or don't use it during the merge. @param {ReactClass} publicInstance The instance that should rerender. @param {object} partialState Next partial state to be merged with state. @param {?function} callback Called after component is updated. @param {?string} Name of the calling function in the public API. @internal
erroredTask
javascript
wasmerio/winterjs
benchmark/complex.js
https://github.com/wasmerio/winterjs/blob/master/benchmark/complex.js
MIT