@samitouri / QOS-React-1 / commits / f33e63838d

Update copyrights to reference Meta instead of Facebook

Thanks @zpao!!! This was mostly his work, i just fixed up the last bit.

Joe Savona committed Apr 3, 2024 at 08:43 UTC f33e63838d99aac5efc84a38cde84966f15801a1
185 files changed +552 -161
compiler/LICENSE
+1 -1
@@ -1,6 +1,6 @@
1 MIT License
2
3 -Copyright (c) Facebook, Inc. and its affiliates.
3 +Copyright (c) Meta Platforms, Inc. and affiliates.
4
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
compiler/apps/playground/colors.js
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 /**
10 * Sync from <https://github.com/reactjs/reactjs.org/blob/main/beta/colors.js>.
compiler/apps/playground/components/Editor/Input.tsx
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 import MonacoEditor, { loader, type Monaco } from "@monaco-editor/react";
10 import { CompilerErrorDetail } from "babel-plugin-react-forget/src";
compiler/apps/playground/components/Editor/monacoOptions.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 import type { EditorProps } from "@monaco-editor/react";
10
compiler/apps/playground/components/Header.tsx
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 import { RefreshIcon, ShareIcon, TrashIcon } from "@heroicons/react/outline";
10 import { CheckIcon } from "@heroicons/react/solid";
compiler/apps/playground/components/Logo.tsx
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 // https://github.com/reactjs/reactjs.org/blob/main/beta/src/components/Logo.tsx
10
compiler/apps/playground/components/StoreContext.tsx
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 import type { Dispatch, ReactNode } from "react";
10 import { useReducer } from "react";
compiler/apps/playground/components/index.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 export { default as Editor } from "./Editor";
10 export { default as Header } from "./Header";
compiler/apps/playground/hooks/index.ts
-3
@@ -5,8 +5,5 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 export { default as useMountEffect } from "./useMountEffect";
compiler/apps/playground/hooks/useMountEffect.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 import type { EffectCallback } from "react";
10 import { useEffect } from "react";
compiler/apps/playground/lib/createContext.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 import React from "react";
10
compiler/apps/playground/lib/defaultStore.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 import type { Store } from "./stores";
10
compiler/apps/playground/lib/forgetMonacoDiagnostics.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 import { Monaco } from "@monaco-editor/react";
10 import {
compiler/apps/playground/lib/stores/index.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 export * from "./messages";
10 export * from "./store";
compiler/apps/playground/lib/stores/messages.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 export enum MessageSource {
10 Babel,
compiler/apps/playground/lib/stores/store.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 import invariant from "invariant";
10 import { defaultStore } from "../defaultStore";
compiler/apps/playground/lib/utils.ts
-3
@@ -5,9 +5,6 @@
5 * LICENSE file in the root directory of this source tree.
6 */
7
8 -/*
9 - * Copyright (c) Facebook, Inc. and its affiliates.
10 - */
8
9 /**
10 * Unicode-Base64 Codec.
compiler/apps/playground/next-env.d.ts
+7
@@ -1,3 +1,10 @@
1 +/**
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 /// <reference types="next" />
9 /// <reference types="next/image-types/global" />
10
compiler/apps/playground/styles/globals.css
+5 -2
@@ -1,5 +1,8 @@
1 -/*
2 - * Copyright (c) Facebook, Inc. and its affiliates.
1 +/**
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 */
7
8 @tailwind base;
compiler/crates/react_build_hir/src/build.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::collections::HashSet;
9
10 use react_diagnostics::Diagnostic;
compiler/crates/react_build_hir/src/builder.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::cell::RefCell;
9 use std::rc::Rc;
10
compiler/crates/react_build_hir/src/context.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::collections::HashSet;
9
10 use react_estree::IntoFunction;
compiler/crates/react_build_hir/src/error.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use thiserror::Error;
9
10 /// Errors which can occur during HIR construction
compiler/crates/react_build_hir/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod build;
9 mod builder;
10 mod context;
compiler/crates/react_diagnostics/src/diagnostic.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::error::Error;
9 use std::fmt::{Debug, Display, Write};
10
compiler/crates/react_diagnostics/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod diagnostic;
9
10 pub use diagnostic::*;
compiler/crates/react_estree/build.rs
+19 -1
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use react_estree_codegen::estree;
9
10 // Example custom build script.
@@ -9,5 +16,16 @@ fn main() {
16 println!("cargo:rerun-if-changed=../react_estree_codegen");
17
18 let src = estree();
12 - std::fs::write("src/generated.rs", src).unwrap();
19 + let copyright = "
20 +/*
21 + * Copyright (c) Meta Platforms, Inc. and affiliates.
22 + *
23 + * This source code is licensed under the MIT license found in the
24 + * LICENSE file in the root directory of this source tree.
25 + */
26 + "
27 + .to_string();
28 + let trimmed_copyright = copyright.trim();
29 + let contents = format!("{trimmed_copyright}\n{src}");
30 + std::fs::write("src/generated.rs", contents).unwrap();
31 }
compiler/crates/react_estree/src/binding.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use serde::{Deserialize, Serialize};
9
10 #[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Eq, Hash)]
compiler/crates/react_estree/src/generated.rs
+6
@@ -1,3 +1,9 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 // @generated
8 #![cfg_attr(rustfmt, rustfmt_skip)]
9 #![allow(dead_code)]
compiler/crates/react_estree/src/generated_extensions.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 // Manual extensions to generated types
9 use crate::{
10 ArrowFunctionExpression, Class, ClassDeclaration, ClassExpression, Function,
compiler/crates/react_estree/src/js_value.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use serde::de::Visitor;
9 use serde::{Deserialize, Serialize};
10
compiler/crates/react_estree/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod binding;
9 mod generated;
10 mod generated_extensions;
compiler/crates/react_estree/src/range.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::num::NonZeroU32;
9
10 use serde::ser::SerializeTuple;
compiler/crates/react_estree/src/visit.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use crate::{
9 AssignmentPropertyOrRestElement, AssignmentTarget, Class, ClassItem, ClassPrivateProperty,
10 ClassProperty, Declaration, DeclarationOrExpression, ExportAllDeclaration,
compiler/crates/react_estree_codegen/src/codegen.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::collections::HashSet;
9
10 use indexmap::IndexMap;
compiler/crates/react_estree_codegen/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod codegen;
9
10 pub use codegen::{estree, estree_hermes};
compiler/crates/react_fixtures/src/lib.rs
+6 -1
@@ -1 +1,6 @@
1 -
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
compiler/crates/react_fixtures/tests/fixtures_test.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::env;
9 use std::fmt::Write;
10
compiler/crates/react_hermes_parser/build.rs
+19 -1
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use react_estree_codegen::estree_hermes;
9
10 // Example custom build script.
@@ -9,5 +16,16 @@ fn main() {
16 println!("cargo:rerun-if-changed=../react_estree_codegen");
17
18 let src = estree_hermes();
12 - std::fs::write("src/generated.rs", src).unwrap();
19 + let copyright = "
20 +/*
21 + * Copyright (c) Meta Platforms, Inc. and affiliates.
22 + *
23 + * This source code is licensed under the MIT license found in the
24 + * LICENSE file in the root directory of this source tree.
25 + */
26 + "
27 + .to_string();
28 + let trimmed_copyright = copyright.trim();
29 + let contents = format!("{trimmed_copyright}\n{src}");
30 + std::fs::write("src/generated.rs", contents).unwrap();
31 }
compiler/crates/react_hermes_parser/src/generated.rs
+6
@@ -1,3 +1,9 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 // @generated
8 #![cfg_attr(rustfmt, rustfmt_skip)]
9 #![allow(dead_code)]
compiler/crates/react_hermes_parser/src/generated_extension.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::num::NonZeroU32;
9
10 use hermes::parser::{
compiler/crates/react_hermes_parser/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod generated;
9 mod generated_extension;
10
compiler/crates/react_hermes_parser/tests/parser_test.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::env;
9
10 use insta::{assert_snapshot, glob};
compiler/crates/react_hir/src/basic_block.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::fmt::Display;
9
10 use indexmap::{IndexMap, IndexSet};
compiler/crates/react_hir/src/environment.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::cell::{Cell, RefCell};
9 use std::collections::HashMap;
10 use std::rc::Rc;
compiler/crates/react_hir/src/features.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use serde::{Deserialize, Serialize};
9
10 /// Describes the feature flags available to control compilation and validation.
compiler/crates/react_hir/src/function.rs
+6
@@ -1,3 +1,9 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 use indexmap::IndexMap;
8 use react_diagnostics::Diagnostic;
9
compiler/crates/react_hir/src/id_types.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::fmt::Display;
9
10 /// Unique identifier for a basic block. Values are unique only with respect to
compiler/crates/react_hir/src/initialize.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::collections::HashSet;
9
10 use react_diagnostics::{invariant, Diagnostic};
compiler/crates/react_hir/src/inline_use_memo.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::cell::RefCell;
9 use std::collections::{HashMap, HashSet};
10 use std::rc::Rc;
compiler/crates/react_hir/src/instruction.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::cell::RefCell;
9 use std::fmt::Display;
10 use std::rc::Rc;
compiler/crates/react_hir/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod basic_block;
9 mod environment;
10 mod features;
compiler/crates/react_hir/src/merge_consecutive_blocks.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::collections::HashMap;
9
10 use react_diagnostics::{invariant, Diagnostic};
compiler/crates/react_hir/src/print.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::fmt::{Result, Write};
9
10 use react_estree::JsValue;
compiler/crates/react_hir/src/registry.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 /// TODO: merge GlobalRegistry and ShapeRegistry into a single
9 /// data structure
10 #[derive(Debug)]
compiler/crates/react_hir/src/terminal.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use crate::instruction::IdentifierOperand;
9 use crate::{BlockId, InstructionId};
10
compiler/crates/react_hir/src/types.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use crate::{FunctionId, ObjectId, TypeVarId};
9
10 #[derive(Clone, Debug)]
compiler/crates/react_napi/build.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 fn main() {
9 napi_build::setup();
10 }
compiler/crates/react_napi/src/lib.rs
+6
@@ -1,3 +1,9 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 use napi_derive::napi;
8 use react_diagnostics::Diagnostic;
9 use react_semantic_analysis::{analyze, AnalyzeOptions};
compiler/crates/react_optimization/src/constant_propagation.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::collections::HashMap;
9
10 use react_diagnostics::Diagnostic;
compiler/crates/react_optimization/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod constant_propagation;
9
10 pub use constant_propagation::constant_propagation;
compiler/crates/react_semantic_analysis/src/analyzer.rs
+6
@@ -1,3 +1,9 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 use react_diagnostics::Diagnostic;
8 use react_estree::{
9 AssignmentOperator, AssignmentPropertyOrRestElement, AssignmentTarget, Expression,
compiler/crates/react_semantic_analysis/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod analyzer;
9 mod scope_manager;
10 mod scope_view;
compiler/crates/react_semantic_analysis/src/scope_manager.rs
+6
@@ -1,3 +1,9 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 use indexmap::IndexMap;
8 use react_diagnostics::Diagnostic;
9 use react_estree::{
compiler/crates/react_semantic_analysis/src/scope_view.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use indexmap::IndexMap;
9
10 use crate::{
compiler/crates/react_semantic_analysis/tests/analysis_test.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::fmt::Write;
9
10 use insta::{assert_snapshot, glob};
compiler/crates/react_ssa/src/eliminate_redundant_phis.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::collections::{HashMap, HashSet};
9
10 use react_hir::{BlockId, Environment, Function, Identifier, IdentifierId, InstructionValue};
compiler/crates/react_ssa/src/enter.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 use std::cell::RefCell;
9 use std::rc::Rc;
10
compiler/crates/react_ssa/src/leave.rs
+6
@@ -1,3 +1,9 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 use react_hir::{Environment, HIR};
8
9 pub fn leave_ssa(_env: &Environment, _hir: &mut HIR) {
compiler/crates/react_ssa/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod eliminate_redundant_phis;
9 mod enter;
10 mod leave;
compiler/crates/react_utils/src/lib.rs
+7
@@ -1,3 +1,10 @@
1 +/*
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 mod ensure_sufficient_stack;
9 mod pointer_address;
10
compiler/packages/babel-plugin-react-forget/.eslintrc.js
+7
@@ -1,3 +1,10 @@
1 +/**
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 /**
9 * Our philosophy for linting is that lints should be very high-signal:
10 * - Error, don't warn. If it's worth mentioning it's worth fixing.
compiler/packages/babel-plugin-react-forget/scripts/babel-plugin-annotate-react-code.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/scripts/ts-analyze-trace.sh
+7
@@ -1,4 +1,11 @@
1 #!/usr/bin/env bash
2 +#
3 +# Copyright (c) Meta Platforms, Inc. and affiliates.
4 +#
5 +# This source code is licensed under the MIT license found in the
6 +# LICENSE file in the root directory of this source tree.
7 +#
8 +
9 # Generates a TypeScript performance trace in a tmp folder, then runs the analyze-trace npm module
10 # to identify any hotspots that might cause slow compilation
11 # See https://github.com/microsoft/typescript-analyze-trace for CLI args
compiler/packages/babel-plugin-react-forget/src/Babel/BabelPlugin.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Babel/RunReactForgetBabelPlugin.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/CompilerError.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Gating.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Imports.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Pipeline.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Program.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Entrypoint/Suppression.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Entrypoint/index.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/AssertConsistentIdentifiers.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/AssertTerminalSuccessorsExist.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/AssertValidMutableRanges.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/BuildHIR.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/ComputeUnconditionalBlocks.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/Dominator.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/Environment.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/FindContextIdentifiers.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/Globals.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/HIR.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/HIRBuilder.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/MergeConsecutiveBlocks.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/ObjectShape.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/PrintHIR.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/Types.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/index.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/HIR/visitors.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/AnalyseFunctions.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/DropManualMemoization.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferAlias.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferAliasForPhis.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferAliasForStores.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferMutableContextVariables.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferMutableLifetimes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferMutableRanges.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferMutableRangesForAlias.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferReactivePlaces.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferReferenceEffects.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InferTryCatchAliases.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/InlineImmediatelyInvokedFunctionExpressions.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Inference/index.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Optimization/ConstantPropagation.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Optimization/DeadCodeElimination.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Optimization/PruneMaybeThrows.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Optimization/index.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/AlignMethodCallScopes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/AlignObjectMethodScopes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/AlignReactiveScopesToBlockScopes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/AssertScopeInstructionsWithinScope.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/BuildReactiveBlocks.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/BuildReactiveFunction.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CodegenReactiveFunction.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CollectReactiveIdentifiers.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/CollectReferencedGlobals.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/DeriveMinimalDependencies.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/ExtractScopeDeclarationsFromDestructuring.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/FlattenReactiveLoops.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/FlattenScopesWithHooksOrUse.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/InferReactiveScopeVariables.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/MemoizeFbtOperandsInSameScope.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/MergeOverlappingReactiveScopes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/MergeReactiveScopesThatInvalidateTogether.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PrintReactiveFunction.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PromoteUsedTemporaries.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PropagateEarlyReturns.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PropagateScopeDependencies.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneAllReactiveScopes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneAlwaysInvalidatingScopes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneHoistedContexts.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneNonEscapingScopes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneNonReactiveDependencies.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneTemporaryLValues.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneUnusedLabels.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PruneUnusedScopes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/RenameVariables.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/index.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/visitors.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/SSA/EliminateRedundantPhi.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/SSA/EnterSSA.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/SSA/LeaveSSA.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/SSA/index.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/TypeInference/InferTypes.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/TypeInference/index.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Utils/ComponentDeclaration.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Utils/DisjointSet.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Utils/HookDeclaration.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Utils/Result.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Utils/RuntimeDiagnosticConstants.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Utils/Stack.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Utils/logger.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Utils/todo.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Utils/utils.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Validation/ValidateContextVariableLValues.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Validation/ValidateHooksUsage.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Validation/ValidateMemoizedEffectDependencies.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Validation/ValidateNoCapitalizedCalls.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Validation/ValidateNoRefAccesInRender.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Validation/ValidateNoSetStateInRender.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Validation/ValidatePreservedManualMemoization.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Validation/ValidateUseMemo.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/Validation/index.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/babel-plugin-react-forget/src/index.ts
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
compiler/packages/snap/src/runner-watch.ts
+7
@@ -1,3 +1,10 @@
1 +/**
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 import watcher from "@parcel/watcher";
9 import path from "path";
10 import ts from "typescript";
compiler/packages/snap/src/sprout/ReactForgetFeatureFlag.ts
+7
@@ -1,3 +1,10 @@
1 +/**
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 export function isForgetEnabled_Fixtures(): boolean {
9 return true;
10 }
compiler/packages/snap/src/sprout/index.ts
+7
@@ -1,3 +1,10 @@
1 +/**
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 import { EvaluatorResult, doEval } from "./evaluator";
9
10 export type SproutResult =
compiler/packages/snap/src/types.d.ts
+7
@@ -1,3 +1,10 @@
1 +/**
2 + * Copyright (c) Meta Platforms, Inc. and affiliates.
3 + *
4 + * This source code is licensed under the MIT license found in the
5 + * LICENSE file in the root directory of this source tree.
6 + */
7 +
8 // v0.17.1
9 declare module "hermes-parser" {
10 type HermesParserOptions = {
compiler/scripts/build-packages-forget-feedback.sh
+1 -1
@@ -1,5 +1,5 @@
1 #!/bin/sh
2 -# Copyright (c) Facebook, Inc. and its affiliates.
2 +# Copyright (c) Meta Platforms, Inc. and affiliates.
3 #
4 # This source code is licensed under the MIT license found in the
5 # LICENSE file in the root directory of this source tree.
compiler/scripts/copyright.js
+1 -1
@@ -18,7 +18,7 @@ const META_COPYRIGHT_COMMENT_BLOCK =
18 * LICENSE file in the root directory of this source tree.
19 */`.trim() + "\n\n";
20
21 -const files = glob.sync("**/*.{js,ts,tsx,jsx}", {
21 +const files = glob.sync("**/*.{js,ts,tsx,jsx,rs}", {
22 ignore: [
23 "**/dist/**",
24 "**/node_modules/**",
compiler/scripts/hash.sh
+5
@@ -1,4 +1,9 @@
1 #!/usr/bin/env bash
2 +# Copyright (c) Meta Platforms, Inc. and affiliates.
3 +#
4 +# This source code is licensed under the MIT license found in the
5 +# LICENSE file in the root directory of this source tree.
6 +
7 set -eo pipefail
8
9 # Hashes JS files in the provided directory to create a cache-breaker
compiler/scripts/rustfmt.sh
+6 -1
@@ -1,7 +1,12 @@
1 #!/usr/bin/env bash
2 +# Copyright (c) Meta Platforms, Inc. and affiliates.
3 +#
4 +# This source code is licensed under the MIT license found in the
5 +# LICENSE file in the root directory of this source tree.
6 +
7 set -eo pipefail
8
9 # Executes rustfmt using a nightly build of the compiler
10 # NOTE: this command must exactly match the Rust Lint command in .github/workflows/rust.yml
11 rustup toolchain list | grep -q nightly-2023-08-01 || (echo "Expected Rust version missing, try running: 'rustup toolchain install nightly-2023-08-01'" && exit 1)
7 -grep -r --include "*.rs" --files-without-match "@generated" crates | xargs rustup run nightly-2023-08-01 rustfmt --config="skip_children=true" "$@"
\ No newline at end of file
12 +grep -r --include "*.rs" --files-without-match "@generated" crates | xargs rustup run nightly-2023-08-01 rustfmt --config="skip_children=true" "$@"
compiler/scripts/update-commit-message.js
+1 -1
@@ -1,4 +1,4 @@
1 -/*
1 +/**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the