8,921 matches across 25 files for func main lang:JavaScript
snippet_mode: auto · sorted by relevance
30 ElementTypeClass,
31 ElementTypeContext,
32▶ ElementTypeFunction,
33 ElementTypeForwardRef,
34 ElementTypeHostComponent,
· · ·
180 Plugins,
181} from 'react-devtools-shared/src/frontend/types';
182▶import type {ReactFunctionLocation} from 'shared/ReactTypes';
183import type {
184 FiberInstance,
· · ·
197import {formatOwnerStack} from '../shared/DevToolsOwnerStack';
198
199▶function createFiberInstance(fiber: Fiber): FiberInstance {
200 return {
201 kind: FIBER_INSTANCE,
· · ·
214
215// This is used to represent a filtered Fiber but still lets us find its host instance.
216▶function createFilteredFiberInstance(fiber: Fiber): FilteredFiberInstance {
217 return {
218 kind: FILTERED_FIBER_INSTANCE,
· · ·
230}
231
232▶function createVirtualInstance(
233 debugEntry: ReactComponentInfo,
234): VirtualInstance {
+ 354 more matches in this file
19import type {ActivityState} from './ReactFiberActivityComponent';
20import type {SuspenseState} from './ReactFiberSuspenseComponent';
21▶import type {FunctionComponentUpdateQueue} from './ReactFiberHooks';
22import type {Transition} from 'react/src/ReactStartTransition';
23import type {
· · ·
148 SuspenseListComponent,
149 OffscreenComponent,
150▶ FunctionComponent,
151 ForwardRef,
152 MemoComponent,
· · ·
232 SelectiveHydrationException,
233 beginWork,
234▶ replayFunctionComponent,
235} from './ReactFiberBeginWork';
236import {completeWork} from './ReactFiberCompleteWork';
· · ·
414import {claimQueuedTransitionTypes} from './ReactFiberTransitionTypes';
415
416▶const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
417
418type ExecutionContext = number;
· · ·
454
455// When this is true, the work-in-progress fiber just suspended (or errored) and
456▶// we've yet to unwind the stack. In some cases, we may yield to the main thread
457// after this happens. If the fiber is pinged before we resume, we can retry
458// immediately instead of unwinding the stack.
+ 200 more matches in this file
79
80import {
81▶ clientRenderBoundary as clientRenderFunction,
82 completeBoundary as completeBoundaryFunction,
83 completeBoundaryUpgradeToViewTransitions as upgradeToViewTransitionsInstruction,
· · ·
82▶ completeBoundary as completeBoundaryFunction,
83 completeBoundaryUpgradeToViewTransitions as upgradeToViewTransitionsInstruction,
84 completeBoundaryWithStyles as styleInsertionFunction,
· · ·
84▶ completeBoundaryWithStyles as styleInsertionFunction,
85 completeSegment as completeSegmentFunction,
86 formReplaying as formReplayingRuntime,
· · ·
85▶ completeSegment as completeSegmentFunction,
86 formReplaying as formReplayingRuntime,
87 markShellTime,
· · ·
126export type InstructionState = number;
127const NothingSent /* */ = 0b000000000;
128▶const SentCompleteSegmentFunction /* */ = 0b000000001;
129const SentCompleteBoundaryFunction /* */ = 0b000000010;
130const SentClientRenderFunction /* */ = 0b000000100;
+ 264 more matches in this file
55} from './ReactFiberDevToolsHook';
56import {
57▶ FunctionComponent,
58 ClassComponent,
59 HostRoot,
· · ·
75 LazyComponent,
76 IncompleteClassComponent,
77▶ IncompleteFunctionComponent,
78 ScopeComponent,
79 OffscreenComponent,
· · ·
110import {
111 disableLegacyContext,
112▶ disableLegacyContextForFunctionComponents,
113 enableProfilerCommitHooks,
114 enableProfilerTimer,
· · ·
134import {setCurrentFiber} from './ReactCurrentFiber';
135import {
136▶ resolveFunctionForHotReloading,
137 resolveForwardRefForHotReloading,
138 resolveClassForHotReloading,
· · ·
264 createFiberFromOffscreen,
265 createWorkInProgress,
266▶ isSimpleFunctionComponent,
267 isFunctionClassComponent,
268} from './ReactFiber';
+ 152 more matches in this file
178import {
179 disableLegacyContext,
180▶ disableLegacyContextForFunctionComponents,
181 enableScopeAPI,
182 enableAsyncIterableChildren,
· · ·
430};
431
432▶function createPreamble(): Preamble {
433 return {
434 content: createPreambleState(),
· · ·
447// as little as 80%. We can receive half of that each 500ms - at best. In practice,
448// a little bandwidth is lost to processing and contention - e.g. CSS and images that
449▶// are downloaded along with the main content. So we estimate about half of that to be
450// the lower end throughput. In other words, we expect that you can at least show
451// about 12.5kb of content per 500ms. Not counting starting latency for the first
· · ·
454const DEFAULT_PROGRESSIVE_CHUNK_SIZE = 12800;
455
456▶function getBlockingRenderMaxSize(request: Request): number {
457 // We want to make sure that we can block the reveal of a well designed complete
458 // shell but if you have constructed a too large shell (e.g. by not adding any
· · ·
489}
490
491▶function isEligibleForOutlining(
492 request: Request,
493 boundary: SuspenseBoundary,
+ 184 more matches in this file
297export * from 'react-reconciler/src/ReactFiberConfigWithNoPersistence';
298
299▶function getOwnerDocumentFromRootContainer(
300 rootContainerElement: Element | Document | DocumentFragment,
301): Document {
· · ·
305}
306
307▶export function getRootHostContext(
308 rootContainerInstance: Container,
309): HostContext {
· · ·
360}
361
362▶function getOwnHostContext(namespaceURI: string): HostContextNamespace {
363 switch (namespaceURI) {
364 case SVG_NAMESPACE:
· · ·
371}
372
373▶function getChildHostContextProd(
374 parentNamespace: HostContextNamespace,
375 type: string,
· · ·
394}
395
396▶export function getChildHostContext(
397 parentHostContext: HostContext,
398 type: string,
+ 257 more matches in this file
47 HostPortal,
48 Fragment,
49▶ FunctionComponent,
50} from './ReactWorkTags';
51import isArray from 'shared/isArray';
· · ·
87let currentDebugInfo: null | ReactDebugInfo = null;
88
89▶function pushDebugInfo(
90 debugInfo: null | ReactDebugInfo,
91): null | ReactDebugInfo {
· · ·
107}
108
109▶function getCurrentDebugTask(): null | ConsoleTask {
110 // Get the debug task of the parent Server Component if there is one.
111 if (__DEV__) {
· · ·
129let didWarnAboutGenerators;
130let ownerHasKeyUseWarning;
131▶let ownerHasFunctionTypeWarning;
132let ownerHasSymbolTypeWarning;
133let warnForMissingKey = (
· · ·
147 */
148 ownerHasKeyUseWarning = {} as {[string]: boolean};
149▶ ownerHasFunctionTypeWarning = {} as {[string]: boolean};
150 ownerHasSymbolTypeWarning = {} as {[string]: boolean};
151
+ 98 more matches in this file
17 ReactIOInfo,
18 ReactStackTrace,
19▶ ReactFunctionLocation,
20 ReactErrorInfoDev,
21} from 'shared/ReactTypes';
· · ·
242
243// $FlowFixMe[missing-this-annot]
244▶function ReactPromise(status: any, value: any, reason: any) {
245 this.status = status;
246 this.value = value;
· · ·
257ReactPromise.prototype = Object.create(Promise.prototype) as any;
258// TODO: This doesn't return a new Promise chain unlike the real .then
259▶ReactPromise.prototype.then = function <T>(
260 this: SomeChunk<T>,
261 resolve: (value: T) => mixed,
· · ·
297 switch (chunk.status) {
298 case INITIALIZED:
299▶ if (typeof resolve === 'function') {
300 resolve(chunk.value);
301 }
· · ·
303 case PENDING:
304 case BLOCKED:
305▶ if (typeof resolve === 'function') {
306 if (chunk.value === null) {
307 chunk.value = [] as Array<InitializationReference | (T => mixed)>;
+ 191 more matches in this file
63 ReactStackTrace,
64 ReactCallSite,
65▶ ReactFunctionLocation,
66 ReactErrorInfo,
67 ReactErrorInfoDev,
· · ·
169const doNotLimit: WeakSet<Reference> = __DEV__ ? new WeakSet() : (null as any);
170
171▶function defaultFilterStackFrame(
172 filename: string,
173 functionName: string,
· · ·
173▶ functionName: string,
174): boolean {
175 return (
· · ·
180}
181
182▶function devirtualizeURL(url: string): string {
183 if (url.startsWith('about://React/')) {
184 // This callsite is a virtual fake callsite that came from another Flight client.
· · ·
195}
196
197▶function isPromiseCreationInternal(url: string, functionName: string): boolean {
198 // Various internals of the JS VM can create Promises but the call frame of the
199 // internals are not very interesting for our purposes so we need to skip those.
+ 253 more matches in this file
47
48import {
49▶ FunctionComponent,
50 ClassComponent,
51 HostRoot,
· · ·
67 LazyComponent,
68 IncompleteClassComponent,
69▶ IncompleteFunctionComponent,
70 ScopeComponent,
71 OffscreenComponent,
· · ·
168 getRenderTargetTime,
169 getWorkInProgressTransitions,
170▶ shouldRemainOnPreviousScreen,
171 markSpawnedRetryLane,
172} from './ReactFiberWorkLoop';
· · ·
197 * a PlacementAndUpdate.
198 */
199▶function markUpdate(workInProgress: Fiber) {
200 workInProgress.flags |= Update;
201}
· · ·
205 * it received an update that requires a clone of the tree above.
206 */
207▶function markCloned(workInProgress: Fiber) {
208 // $FlowFixMe[constant-condition]
209 if (supportsPersistence) {
+ 32 more matches in this file
105 requestDeferredLane,
106 markSkippedUpdateLanes,
107▶ isInvalidExecutionContextForEventFunction,
108} from './ReactFiberWorkLoop';
109
· · ·
200};
201
202▶// The effect "instance" is a shared object that remains the same for the entire
203// lifetime of an effect. In Rust terms, a RefCell. We use it to store the
204// "destroy" function that is returned from an effect, because that is stateful.
· · ·
204▶// "destroy" function that is returned from an effect, because that is stateful.
205// The field is `undefined` if the effect is unmounted, or if the effect ran
206// but is not stateful. We don't explicitly track whether the effect is mounted
· · ·
236};
237
238▶type EventFunctionPayload<Args, Return, F: (...Array<Args>) => Return> = {
239 ref: {
240 eventFn: F,
· · ·
244};
245
246▶export type FunctionComponentUpdateQueue = {
247 lastEffect: Effect | null,
248 events: Array<EventFunctionPayload<any, any, any>> | null,
+ 185 more matches in this file
43 enableProfilerTimer &&
44 typeof console !== 'undefined' &&
45▶ typeof console.timeStamp === 'function' &&
46 (!__DEV__ ||
47 // In DEV we also rely on performance.measure
· · ·
48 (typeof performance !== 'undefined' &&
49 // $FlowFixMe[method-unbinding]
50▶ typeof performance.measure === 'function'));
51
52const COMPONENTS_TRACK = 'Components ⚛';
· · ·
55let currentTrack: string = 'Blocking'; // Lane
56
57▶export function setCurrentTrackFromLanes(lanes: Lanes): void {
58 currentTrack = getGroupNameOfHighestPriorityLane(lanes);
59}
· · ·
60
61▶export function markAllLanesInOrder() {
62 if (supportsUserTiming) {
63 // Ensure we create all tracks in priority order. Currently performance.mark() are in
· · ·
110}
111
112▶function logComponentTrigger(
113 fiber: Fiber,
114 startTime: number,
+ 35 more matches in this file
67var timerQueue: Array<Task> = [];
68
69▶// Incrementing id counter. Used to maintain insertion order.
70var taskIdCounter = 1;
71
· · ·
83 | null
84 | ((
85▶ hasTimeRemaining: boolean,
86 initialTime: DOMHighResTimeStamp | number,
87 ) => boolean) = null;
· · ·
97var disableYieldValue = false;
98
99▶function setDisableYieldValue(newValue: boolean) {
100 disableYieldValue = newValue;
101}
· · ·
102
103▶function advanceTimers(currentTime: number) {
104 // Check for tasks that are no longer delayed and add them to the queue.
105 let timer = peek(timerQueue);
· · ·
119 }
120 } else {
121▶ // Remaining timers are pending.
122 return;
123 }
+ 35 more matches in this file
123 IdleHydrationLane;
124
125▶// This function is used for the experimental timeline (react-devtools-timeline)
126// It should be kept in sync with the Lanes values above.
127export function getLabelForLane(lane: Lane): string | void {
· · ·
127▶export function getLabelForLane(lane: Lane): string | void {
128 if (enableSchedulingProfiler) {
129 if (lane & SyncHydrationLane) {
· · ·
178let nextRetryLane: Lane = RetryLane1;
179
180▶function getHighestPriorityLanes(lanes: Lanes | Lane): Lanes {
181 const pendingSyncLanes = lanes & SyncUpdateLanes;
182 if (pendingSyncLanes !== 0) {
· · ·
247}
248
249▶export function getNextLanes(
250 root: FiberRoot,
251 wipLanes: Lanes,
· · ·
301 }
302 } else {
303▶ // The only remaining work is Idle.
304 // TODO: Idle isn't really used anywhere, and the thinking around
305 // speculative rendering has evolved since this was implemented. Consider
+ 71 more matches in this file
60const hasPerformanceNow =
61 // $FlowFixMe[method-unbinding]
62▶ typeof performance === 'object' && typeof performance.now === 'function';
63
64if (hasPerformanceNow) {
· · ·
80var timerQueue: Array<Task> = [];
81
82▶// Incrementing id counter. Used to maintain insertion order.
83var taskIdCounter = 1;
84
· · ·
95
96// Capture local references to native APIs, in case a polyfill overrides them.
97▶const localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null;
98const localClearTimeout =
99 typeof clearTimeout === 'function' ? clearTimeout : null;
· · ·
99▶ typeof clearTimeout === 'function' ? clearTimeout : null;
100const localSetImmediate =
101 typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom
· · ·
102
103▶function advanceTimers(currentTime: number) {
104 // Check for tasks that are no longer delayed and add them to the queue.
105 let timer = peek(timerQueue);
+ 29 more matches in this file
114let currentEventTransitionLane: Lane = NoLane;
115
116▶export function ensureRootIsScheduled(root: FiberRoot): void {
117 // This function is called whenever a root receives an update. It does two
118 // things 1) it ensures the root is in the root schedule, and 2) it ensures
· · ·
117▶ // This function is called whenever a root receives an update. It does two
118 // things 1) it ensures the root is in the root schedule, and 2) it ensures
119 // there's a pending microtask to process the root schedule.
· · ·
152}
153
154▶export function ensureScheduleIsScheduled(): void {
155 // At the end of the current event, go through each of the roots and ensure
156 // there's a task scheduled for each one at the correct priority.
· · ·
169}
170
171▶export function flushSyncWorkOnAllRoots() {
172 // This is allowed to be called synchronously, but the caller should check
173 // the execution context first.
· · ·
175}
176
177▶export function flushSyncWorkOnLegacyRootsOnly() {
178 // This is allowed to be called synchronously, but the caller should check
179 // the execution context first.
+ 22 more matches in this file
1▶(function () {
2 'use strict';
3
· · ·
4▶ var ReactImage0 = function (x) {
5 if (x === 0) {
6 return React.createElement('i', {
· · ·
233 };
234
235▶ var AbstractLink1 = function (x) {
236 if (x === 1) {
237 return React.createElement(
· · ·
244 href: '#',
245 rel: undefined,
246▶ onClick: function () {},
247 },
248 null,
· · ·
277 href: '#',
278 rel: undefined,
279▶ onClick: function () {},
280 },
281 undefined,
+ 277 more matches in this file
22
23const patchConsoleMethod = (methodName, logged) => {
24▶ const newMethod = function (format, ...args) {
25 // Ignore uncaught errors reported by jsdom
26 // and React addendums because they're too noisy.
· · ·
62
63let logMethod;
64▶export function patchConsoleMethods({includeLog} = {includeLog: false}) {
65 patchConsoleMethod('error', loggedErrors);
66 patchConsoleMethod('warn', loggedWarns);
· · ·
73}
74
75▶export function resetAllUnexpectedConsoleCalls() {
76 loggedErrors.length = 0;
77 loggedWarns.length = 0;
· · ·
81}
82
83▶export function clearLogs() {
84 const logs = Array.from(loggedLogs);
85 loggedLogs.length = 0;
· · ·
87}
88
89▶export function clearWarnings() {
90 const warnings = Array.from(loggedWarns);
91 loggedWarns.length = 0;
+ 18 more matches in this file
27 : () => null;
28
29▶function getTaskName(type) {
30 if (type === REACT_FRAGMENT_TYPE) {
31 return '<>';
· · ·
48}
49
50▶function getOwner() {
51 if (__DEV__) {
52 const dispatcher = ReactSharedInternals.A;
· · ·
68
69/** @noinline */
70▶function UnknownOwner() {
71 /** @noinline */
72 return (() => Error('react-stack-top-frame'))();
· · ·
73}
74const createFakeCallStack = {
75▶ react_stack_bottom_frame: function (callStackForError) {
76 return callStackForError();
77 },
· · ·
87 didWarnAboutElementRef = {};
88
89▶ // We use this technique to trick minifiers to preserve the function name.
90 unknownOwnerDebugStack = createFakeCallStack.react_stack_bottom_frame.bind(
91 createFakeCallStack,
+ 25 more matches in this file
17//
18// Both queues share a persistent, singly-linked list structure. To schedule an
19▶// update, we append it to the end of both queues. Each queue maintains a
20// pointer to first update in the persistent list that hasn't been processed.
21// The work-in-progress pointer always has a position equal to or greater than
· · ·
52// during the render phase, only the updates with sufficient priority are
53// included in the result. If we skip an update because it has insufficient
54▶// priority, it remains in the queue to be processed later, during a lower
55// priority render. Crucially, all updates subsequent to a skipped update also
56// remain in the queue *regardless of their priority*. That means high priority
· · ·
56▶// remain in the queue *regardless of their priority*. That means high priority
57// updates are sometimes processed twice, at two separate priorities. We also
58// keep track of a base state, that represents the state before the first
· · ·
174}
175
176▶export function initializeUpdateQueue<State>(fiber: Fiber): void {
177 const queue: UpdateQueue<State> = {
178 baseState: fiber.memoizedState,
· · ·
189}
190
191▶export function cloneUpdateQueue<State>(
192 current: Fiber,
193 workInProgress: Fiber,
+ 23 more matches in this file
24import {describeDiff} from 'react-reconciler/src/ReactFiberHydrationDiffs';
25
26▶function describeAncestors(
27 ancestor: Fiber,
28 child: Fiber,
· · ·
134 'link',
135 'listing',
136▶ 'main',
137 'marquee',
138 'menu',
· · ·
222};
223
224▶function updatedAncestorInfoDev(
225 oldInfo: null | AncestorInfoDev,
226 tag: string,
· · ·
246 ) {
247 // See rules for 'li', 'dd', 'dt' start tags in
248▶ // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
249 ancestorInfo.listItemTagAutoclosing = null;
250 ancestorInfo.dlItemTagAutoclosing = null;
· · ·
300 * Returns whether
301 */
302▶function isTagValidWithParent(
303 tag: string,
304 parentTag: ?string,
+ 14 more matches in this file
35import type RBush from 'rbush';
36
37▶function ScaledRect({
38 className,
39 rect,
· · ·
79}
80
81▶function SuspenseRects({
82 suspenseID,
83 parentRects,
· · ·
105 const visible = suspense.hasUniqueSuspenders || !uniqueSuspendersOnly;
106
107▶ function handleClick(event: SyntheticMouseEvent) {
108 if (event.defaultPrevented) {
109 // Already clicked on an inner rect
· · ·
118 }
119
120▶ function handleDoubleClick(event: SyntheticMouseEvent) {
121 if (event.defaultPrevented) {
122 // Already clicked on an inner rect
· · ·
130 }
131
132▶ function handlePointerOver(event: SyntheticPointerEvent) {
133 if (event.defaultPrevented) {
134 // Already hovered an inner rect
+ 16 more matches in this file
29import type {SuspenseState, RetryQueue} from './ReactFiberSuspenseComponent';
30import type {UpdateQueue} from './ReactFiberClassUpdateQueue';
31▶import type {FunctionComponentUpdateQueue} from './ReactFiberHooks';
32import type {Wakeable, ViewTransitionProps} from 'shared/ReactTypes';
33import type {
· · ·
64} from 'shared/ReactFeatureFlags';
65import {
66▶ FunctionComponent,
67 ForwardRef,
68 ClassComponent,
· · ·
300let needsFormReset = false;
301
302▶const PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;
303
304let nextEffect: Fiber | null = null;
· · ·
318let rootViewTransitionNameCanceled: boolean = false;
319
320▶function isHydratingParent(current: Fiber, finishedWork: Fiber): boolean {
321 if (finishedWork.tag === ActivityComponent) {
322 const prevState: ActivityState | null = current.memoizedState;
· · ·
341}
342
343▶export function commitBeforeMutationEffects(
344 root: FiberRoot,
345 firstChild: Fiber,
+ 113 more matches in this file
45let trackedTouchCount = 0;
46
47▶function changeResponder(nextResponderInst, blockHostResponder) {
48 const oldResponderInst = responderInst;
49 responderInst = nextResponderInst;
· · ·
151};
152
153▶// Start of inline: the below functions were inlined from
154// EventPropagator.js, as they deviated from ReactDOM's newer
155// implementations.
· · ·
156
157▶function getParent(inst) {
158 do {
159 inst = inst.return;
· · ·
174 * different trees.
175 */
176▶export function getLowestCommonAncestor(instA, instB) {
177 let depthA = 0;
178 for (let tempA = instA; tempA; tempA = getParent(tempA)) {
· · ·
211 * Return if A is an ancestor of B.
212 */
213▶function isAncestor(instA, instB) {
214 while (instB) {
215 if (instA === instB || instA === instB.alternate) {
+ 23 more matches in this file
1▶(function () {
2 'use strict';
3
· · ·
247 href: '#',
248 rel: undefined,
249▶ onClick: function () {},
250 },
251 null,
· · ·
280 href: '#',
281 rel: undefined,
282▶ onClick: function () {},
283 },
284 undefined,
· · ·
294 href: '/ads/manage/billing.php?act=10149999073643408',
295 rel: undefined,
296▶ onClick: function () {},
297 },
298 React.createElement(XUIText29, {x: 48})
· · ·
309 href: '#',
310 rel: undefined,
311▶ onClick: function () {},
312 },
313 null,
+ 96 more matches in this file