Skip to content

Commit

Permalink
[compiler] Add enablePropagateDepsInHIR flag
Browse files Browse the repository at this point in the history
Adding new feature flag in preparation for #30894

ghstack-source-id: 59278028cf178d6b2c28732ded751e9c838183d2
Pull Request resolved: #30893
  • Loading branch information
mofeiZ committed Sep 6, 2024
1 parent 7b98a16 commit bd788b4
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ const EnvironmentConfigSchema = z.object({
*/
enableUseTypeAnnotations: z.boolean().default(false),

enablePropagateDepsInHIR: z.boolean().default(true),

/**
* Enables inference of optional dependency chains. Without this flag
* a property chain such as `props?.items?.foo` will infer as a dep on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
function Component(props) {
const data = useMemo(() => {
return props?.items.edges?.nodes.map();
Expand All @@ -15,7 +15,7 @@ function Component(props) {
## Code
```javascript
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
function Component(props) {
const $ = _c(4);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
function Component(props) {
const data = useMemo(() => {
return props?.items.edges?.nodes.map();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand All @@ -19,7 +19,7 @@ function Component(props) {
## Code
```javascript
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import { ValidateMemoization } from "shared-runtime";
function Component(props) {
const $ = _c(2);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand All @@ -19,7 +19,7 @@ function Component(props) {
## Code
```javascript
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import { ValidateMemoization } from "shared-runtime";
function Component(props) {
const $ = _c(7);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand All @@ -18,7 +18,7 @@ function Component(props) {
## Code
```javascript
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import { ValidateMemoization } from "shared-runtime";
function Component(props) {
const $ = _c(7);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand All @@ -23,7 +23,7 @@ function Component(props) {
## Code
```javascript
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import { ValidateMemoization } from "shared-runtime";
function Component(props) {
const $ = _c(9);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand All @@ -23,7 +23,7 @@ function Component(props) {
## Code
```javascript
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
import { c as _c } from "react/compiler-runtime"; // @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import { ValidateMemoization } from "shared-runtime";
function Component(props) {
const $ = _c(9);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies
// @validatePreserveExistingMemoizationGuarantees @enableOptionalDependencies @enablePropagateDepsInHIR:false
import {ValidateMemoization} from 'shared-runtime';
function Component(props) {
const data = useMemo(() => {
Expand Down

0 comments on commit bd788b4

Please sign in to comment.