Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
rules: {
/*
* We prefer using const where variables are not reassigned, but occassional mistakes
* We prefer using const where variables are not reassigned, but occasional mistakes
* aren't a major issue
*/
"prefer-const": "off",
Expand Down Expand Up @@ -99,7 +99,7 @@ module.exports = {
},
/*
* If rules need to be disabled then the rule is insufficiently high signal
* and should be diasbled altogether or customized (in either case via a standalone PR)
* and should be disabled altogether or customized (in either case via a standalone PR)
*/
noInlineConfig: true,
reportUnusedDisableDirectives: true,
Expand Down
2 changes: 1 addition & 1 deletion compiler/apps/playground/lib/createContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import React from 'react';
* const StoreDispatchContext = useContext<Dispatch<ReducerAction>>(null);
* const dispatchStore = useContext(StoreDispatchContext);
* ...
* dipatchStore!({ ... });
* dispatchStore!({ ... });
* ```
*
* Instead, it throws an error when `useContext` is not called within a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ function lowerStatement(
const conditionalBlock = builder.reserve('loop');
// Block for code following the loop
const continuationBlock = builder.reserve('block');
// Loop body, executed at least once uncondtionally prior to exit
// Loop body, executed at least once unconditionally prior to exit
const loopBlock = builder.enter('block', _loopBlockId => {
return builder.loop(
label,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ export const EnvironmentConfigSchema = z.object({
* When enabled, the compiler assumes that any values are not subsequently
* modified after they are captured by a function passed to React. For example,
* if a value `x` is referenced inside a function expression passed to `useEffect`,
* then this flag will assume that `x` is not subusequently modified.
* then this flag will assume that `x` is not subsequently modified.
*/
enableTransitivelyFreezeFunctionExpressions: z.boolean().default(true),
enableEmitHookGuards: ExternalFunctionSchema.nullable().default(null),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ TYPED_GLOBALS.push(
'createRef',
addFunction(DEFAULT_SHAPES, [], {
positionalParams: [],
restParam: Effect.Capture, // createRef takes no paramters
restParam: Effect.Capture, // createRef takes no parameters
returnType: {kind: 'Object', shapeId: BuiltInUseRefId},
calleeEffect: Effect.Read,
returnValueKind: ValueKind.Mutable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export type AliasingEffect =
*/
| {kind: 'Impure'; place: Place; error: CompilerDiagnostic}
/**
* Indicates that a given place is accessed during render. Used to distingush
* Indicates that a given place is accessed during render. Used to distinguish
* hook arguments that are known to be called immediately vs those used for
* event handlers/effects, and for JSX values known to be called during render
* (tags, children) vs those that may be events/effect (other props).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ import {retainWhere} from '../Utils/utils';
* StoreLocal to the temporary we allocated before plus a Goto to the fallthrough
* block (code following the CallExpression).
*
* Note that if the inliined function has only one return, we avoid the labeled block
* and fully inline the code. The original return is replaced with an assignmen to the
* Note that if the inlined function has only one return, we avoid the labeled block
* and fully inline the code. The original return is replaced with an assignment to the
* IIFE's call expression lvalue.
*/
export function inlineImmediatelyInvokedFunctionExpressions(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {retainWhere} from '../Utils/utils';

/**
* Optimizes the code for running specifically in an SSR environment. This optimization
* asssumes that setState will not be called during render during initial mount, which
* assumes that setState will not be called during render during initial mount, which
* allows inlining useState/useReducer.
*
* Optimizations:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ import {
* Note that PropagateScopeDependencies propagates scope dependencies upwards. This ensures
* that parent scopes have the union of their own direct dependencies as well as those of
* their (transitive) children. As a result nested scopes may have the same or fewer
* dependencies than their parents, but not more dependencies. If they have fewer dependncies,
* dependencies than their parents, but not more dependencies. If they have fewer dependencies,
* it means that the inner scope does not always invalidate with the parent and we should not
* flatten. If they inner scope has the exact same dependencies, however, then it's always
* better to flatten.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ import {getFunctionCallSignature} from '../Inference/InferMutationAliasingEffect
* scopes and inputs involved in creating that identifier. Individual nodes are marked
* as definitely aliased, conditionally aliased, or unaliased:
* a. Arrays, objects, function calls all produce a new value and are always marked as aliased
* b. Conditional and logical expressions (and a few others) are conditinally aliased,
* b. Conditional and logical expressions (and a few others) are conditionally aliased,
* depending on whether their result value is aliased.
* c. JSX is always unaliased (though its props children may be)
* 2. The same pass which builds the graph also stores the set of returned identifiers and set of
Expand Down Expand Up @@ -1026,7 +1026,7 @@ class PruneScopesTransform extends ReactiveFunctionTransform<

/**
* Scopes may initially appear "empty" because the value being memoized
* is early-returned from within the scope. For now we intentionaly keep
* is early-returned from within the scope. For now we intentionally keep
* these scopes, and let them get pruned later by PruneUnusedScopes
* _after_ handling the early-return case in PropagateEarlyReturns.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class SSABuilder {

if (block.preds.size == 0) {
/*
* We're at the entry block and haven't found our defintion yet.
* We're at the entry block and haven't found our definition yet.
* console.log(
* `Unable to find "${printPlace(
* oldPlace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function validateHooksUsage(fn: HIRFunction): void {

/*
* In some circumstances such as optional calls, we may first encounter a "hook may not be referenced as normal values" error.
* If that same place is also used as a conditional call, upgrade the error to a conditonal hook error
* If that same place is also used as a conditional call, upgrade the error to a conditional hook error
*/
if (previousError === undefined || previousError.reason !== reason) {
trackError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function validateNoSetStateInEffects(
const setState = setStateFunctions.get(arg.identifier.id);
if (setState !== undefined) {
/**
* This effect event function calls setState synchonously,
* This effect event function calls setState synchronously,
* treat it as a setState function for transitive tracking
*/
setStateFunctions.set(instr.lvalue.identifier.id, setState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function validateNoSetStateInRenderImpl(
isSetStateType(operand.identifier) ||
unconditionalSetStateFunctions.has(operand.identifier.id),
) &&
// if yes, does it unconditonally call it?
// if yes, does it unconditionally call it?
validateNoSetStateInRenderImpl(
instr.value.loweredFunc.func,
unconditionalSetStateFunctions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ function compareDeps(
* identifier must be also named in source, as DropManualMemoization, which
* runs before any renaming passes, only records loads from named variables.
* - and one of the following holds:
* - pathA and pathB are identifical
* - pathA and pathB are identical
* - pathB is a subpath of pathA and neither read into a `ref` type*
*
* We do not allow for partial matches on ref types because they are not immutable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Component() {
* if we don't bail out of effect mutation derivation tracking, isChanged
* will inherit the sources of the effect's function expression.
*
* This is innacurate and with the multiple passes ends up causing an infinite loop.
* This is inaccurate and with the multiple passes ends up causing an infinite loop.
*/
useEffect(() => {
let isChanged = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function Component(props) {
// a can be independently memoized, is not mutated later
// but a is a dependnecy of b, which is a dependency of c.
// but a is a dependency of b, which is a dependency of c.
// we have to memoize a to avoid breaking memoization of b,
// to avoid breaking memoization of c.
const a = [props.a];
Expand Down