Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
class Component {
_renderMessage = () => {
const Message = () => {
Expand All @@ -22,7 +22,7 @@ class Component {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
class Component {
_renderMessage = () => {
const Message = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
class Component {
_renderMessage = () => {
const Message = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @customOptOutDirectives:["use todo memo"]
// @expectNothingCompiled @customOptOutDirectives:["use todo memo"]
function Component() {
'use todo memo';
return <div>hello world!</div>;
Expand All @@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
## Code

```javascript
// @customOptOutDirectives:["use todo memo"]
// @expectNothingCompiled @customOptOutDirectives:["use todo memo"]
function Component() {
"use todo memo";
return <div>hello world!</div>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @customOptOutDirectives:["use todo memo"]
// @expectNothingCompiled @customOptOutDirectives:["use todo memo"]
function Component() {
'use todo memo';
return <div>hello world!</div>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer" @enablePreserveExistingMemoizationGuarantees @validatePreserveExistingMemoizationGuarantees
// @expectNothingCompiled @compilationMode:"infer" @enablePreserveExistingMemoizationGuarantees @validatePreserveExistingMemoizationGuarantees
import {useMemo} from 'react';
import {makeObject_Primitives, ValidateMemoization} from 'shared-runtime';

Expand Down Expand Up @@ -37,7 +37,7 @@ export const FIXTURE_ENTRYPOINT = {
## Code

```javascript
// @compilationMode:"infer" @enablePreserveExistingMemoizationGuarantees @validatePreserveExistingMemoizationGuarantees
// @expectNothingCompiled @compilationMode:"infer" @enablePreserveExistingMemoizationGuarantees @validatePreserveExistingMemoizationGuarantees
import { useMemo } from "react";
import { makeObject_Primitives, ValidateMemoization } from "shared-runtime";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer" @enablePreserveExistingMemoizationGuarantees @validatePreserveExistingMemoizationGuarantees
// @expectNothingCompiled @compilationMode:"infer" @enablePreserveExistingMemoizationGuarantees @validatePreserveExistingMemoizationGuarantees
import {useMemo} from 'react';
import {makeObject_Primitives, ValidateMemoization} from 'shared-runtime';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @gating
// @expectNothingCompiled @gating
import {isForgetEnabled_Fixtures} from 'ReactForgetFeatureFlag';

export default 42;
Expand All @@ -12,7 +12,7 @@ export default 42;
## Code

```javascript
// @gating
// @expectNothingCompiled @gating
import { isForgetEnabled_Fixtures } from "ReactForgetFeatureFlag";

export default 42;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @gating
// @expectNothingCompiled @gating
import {isForgetEnabled_Fixtures} from 'ReactForgetFeatureFlag';

export default 42;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Takes multiple parameters - not a component!
function Component(foo, bar) {
return <div />;
Expand All @@ -18,7 +18,7 @@ export const FIXTURE_ENTRYPOINT = {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Takes multiple parameters - not a component!
function Component(foo, bar) {
return <div />;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Takes multiple parameters - not a component!
function Component(foo, bar) {
return <div />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
import {useIdentity, identity} from 'shared-runtime';

function Component(fakeProps: number) {
Expand All @@ -20,7 +20,7 @@ export const FIXTURE_ENTRYPOINT = {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
import { useIdentity, identity } from "shared-runtime";

function Component(fakeProps: number) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
import {useIdentity, identity} from 'shared-runtime';

function Component(fakeProps: number) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
function Component(props) {
const result = f(props);
function helper() {
Expand All @@ -26,7 +26,7 @@ export const FIXTURE_ENTRYPOINT = {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
function Component(props) {
const result = f(props);
function helper() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
function Component(props) {
const result = f(props);
function helper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
function Component(props) {
const ignore = <foo />;
return {foo: f(props)};
Expand All @@ -22,7 +22,7 @@ export const FIXTURE_ENTRYPOINT = {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
function Component(props) {
const ignore = <foo />;
return { foo: f(props) };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
function Component(props) {
const ignore = <foo />;
return {foo: f(props)};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// This component is skipped bc it doesn't call any hooks or
// use JSX:
function Component(props) {
Expand All @@ -14,7 +14,7 @@ function Component(props) {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// This component is skipped bc it doesn't call any hooks or
// use JSX:
function Component(props) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// This component is skipped bc it doesn't call any hooks or
// use JSX:
function Component(props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Regression test for some internal code.
// This shows how the "callback rule" is more relaxed,
// and doesn't kick in unless we're confident we're in
Expand All @@ -20,7 +20,7 @@ function makeListener(instance) {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Regression test for some internal code.
// This shows how the "callback rule" is more relaxed,
// and doesn't kick in unless we're confident we're in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Regression test for some internal code.
// This shows how the "callback rule" is more relaxed,
// and doesn't kick in unless we're confident we're in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Valid because hooks can call hooks.
function createHook() {
return function useHook() {
Expand All @@ -16,7 +16,7 @@ function createHook() {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Valid because hooks can call hooks.
function createHook() {
return function useHook() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Valid because hooks can call hooks.
function createHook() {
return function useHook() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Valid because hooks can use hooks.
function createHook() {
return function useHookWithHook() {
Expand All @@ -15,7 +15,7 @@ function createHook() {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Valid because hooks can use hooks.
function createHook() {
return function useHookWithHook() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Valid because hooks can use hooks.
function createHook() {
return function useHookWithHook() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Valid because components can use hooks.
function createComponentWithHook() {
return function ComponentWithHook() {
Expand All @@ -15,7 +15,7 @@ function createComponentWithHook() {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Valid because components can use hooks.
function createComponentWithHook() {
return function ComponentWithHook() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// Valid because components can use hooks.
function createComponentWithHook() {
return function ComponentWithHook() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
## Input

```javascript
// @expectNothingCompiled
// Valid because they're not matching use[A-Z].
fooState();
_use();
Expand All @@ -15,6 +16,7 @@ jest.useFakeTimer();
## Code

```javascript
// @expectNothingCompiled
// Valid because they're not matching use[A-Z].
fooState();
_use();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @expectNothingCompiled
// Valid because they're not matching use[A-Z].
fooState();
_use();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
## Input

```javascript
// @expectNothingCompiled
// Valid because classes can call functions.
// We don't consider these to be hooks.
class C {
Expand All @@ -16,6 +17,7 @@ class C {
## Code

```javascript
// @expectNothingCompiled
// Valid because classes can call functions.
// We don't consider these to be hooks.
class C {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @expectNothingCompiled
// Valid because classes can call functions.
// We don't consider these to be hooks.
class C {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// This is valid because "use"-prefixed functions called in
// unnamed function arguments are not assumed to be hooks.
unknownFunction(function (foo, bar) {
Expand All @@ -16,7 +16,7 @@ unknownFunction(function (foo, bar) {
## Code

```javascript
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// This is valid because "use"-prefixed functions called in
// unnamed function arguments are not assumed to be hooks.
unknownFunction(function (foo, bar) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @compilationMode:"infer"
// @expectNothingCompiled @compilationMode:"infer"
// This is valid because "use"-prefixed functions called in
// unnamed function arguments are not assumed to be hooks.
unknownFunction(function (foo, bar) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Input

```javascript
// @skip
// @expectNothingCompiled @skip
// Passed but should have failed

// Invalid because it's dangerous.
Expand All @@ -22,7 +22,7 @@ useCustomHook();
## Code

```javascript
// @skip
// @expectNothingCompiled @skip
// Passed but should have failed

// Invalid because it's dangerous.
Expand Down
Loading
Loading