Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1902 commits
Select commit Hold shift + click to select a range
56d96ba
[forget-runtime] Remove invariant dep
poteto Mar 11, 2024
b666bd1
[lint] do not report issues when a matching flow suppression is present
kassens Mar 13, 2024
dc7ed06
Fix missing declaration invariant for "for" within try/catch
josephsavona Mar 13, 2024
79e3fc0
Fix for method call not memoizing in same scope as outer call
josephsavona Mar 13, 2024
2940440
Fix for mutable ranges ended early with interleaving
josephsavona Mar 13, 2024
d5e2d9f
Handle fbt:param with only leading or trailing whitespace
josephsavona Mar 13, 2024
fe29f46
Repro for multiple declarations in for initializer codegen issue
josephsavona Mar 13, 2024
ca8e0d4
Support multiple declarations in for init
josephsavona Mar 13, 2024
1b5ae06
Fix block scoping of declarations with early return
josephsavona Mar 14, 2024
459679f
Support type alias syntax
josephsavona Mar 14, 2024
d70b2c2
Repro for unexpected label as value block terminal
josephsavona Mar 14, 2024
1301e68
Add todo for label as value block terminal
josephsavona Mar 14, 2024
ec3d36b
Convert unhandled value block terminal to todo
josephsavona Mar 14, 2024
72d374e
[linter] rename ReactForgetDiagnostics to ReactCompilerRule
kassens Mar 14, 2024
f7ca10a
Repro for "no value for temporary"
josephsavona Mar 14, 2024
d5eca2e
Repro for scope with no declarations (already fixed on this stack)
josephsavona Mar 15, 2024
bf64a82
Repro for fbt with unexpected child count
josephsavona Mar 13, 2024
81695f6
[refactor] Refactor Memoize to two instructions: Start and Finish
mofeiZ Mar 18, 2024
cea84a4
validatePreserveExistingMemoizationGuarantees ensures compiler preser…
mofeiZ Mar 18, 2024
8c8e318
Remove private header from playground
kassens Mar 18, 2024
3745208
[ez] CompilerError: optional description and suggestions
mofeiZ Mar 18, 2024
9358aea
[scripts] Add script to pull commit message from PR description
gsathya Mar 19, 2024
b5a7fe4
[hir] Improve error message for mutating state
gsathya Mar 19, 2024
57fcf7d
Repro for nonproblematic unreachable code
josephsavona Mar 19, 2024
c03f1c8
Extract shared-runtime helper for validating memoization
josephsavona Mar 19, 2024
93e0815
Remove unnecessary scopes for value blocks
josephsavona Mar 19, 2024
7257c9b
Fix for <fbt> with local import
josephsavona Mar 19, 2024
501481c
Repro for fbt:enum source location issue
josephsavona Mar 19, 2024
f2b0b65
More accurate source locations for JSX opening/closing tags
josephsavona Mar 19, 2024
346f6c1
Todo for fbt with multiple fbt:enum
josephsavona Mar 19, 2024
b35779c
[logger] Add CompilerDiagnostic category, thread Logger into environment
mofeiZ Mar 20, 2024
63bb781
[validation] Reduce false positives in validatePreserveExistingMemo
mofeiZ Mar 20, 2024
4daa4ec
[validation] More detailed error diagnostics for validatePreserveExis…
mofeiZ Mar 20, 2024
14d5486
[patch][codegen] don't reuse babel nodes in codegen for dependencies
mofeiZ Mar 20, 2024
1cf8d9b
Repro for missing predecessor with try/catch
josephsavona Mar 20, 2024
241b354
Fix PruneMaybeThrows to update phi operand predecessor ids
josephsavona Mar 21, 2024
4bc676d
Repro for undefined "hoisted" variable from type alias
josephsavona Mar 21, 2024
d31e10b
Fix for type aliases in function inferring as function deps
josephsavona Mar 21, 2024
a6b3adb
Repro for unsupported recursive function expressions
josephsavona Mar 21, 2024
1b6afa1
Repro for uninitialized value due to shadowed function name
josephsavona Mar 21, 2024
0e72e2a
Repro for nested method calls causing promoted property load invariant
josephsavona Mar 21, 2024
21bb8f9
Repro for inconsistent context/local variable reference
josephsavona Mar 22, 2024
231f29f
Fix using context variable as JSX element tag
josephsavona Mar 22, 2024
e8073ff
Repro for destructure declaration of context variable
josephsavona Mar 22, 2024
f18a01b
Add todo for destructuring to context variables
josephsavona Mar 22, 2024
3a6a2e7
Repro for "context variables are always mutable" error w callbacks
josephsavona Mar 22, 2024
e047db8
[repro] Repro for control flow bug in PropagateScopeDependency
mofeiZ Mar 21, 2024
7dc08d7
PropagateScopeDeps treats switch w only default as unconditional
josephsavona Mar 22, 2024
bc51640
Repro of for loop with context variable iterator variable
josephsavona Mar 22, 2024
e7d0c81
Add todo for for loops with context iterator variable
josephsavona Mar 22, 2024
fb0f7e5
Repro for closures reassigning hoisted let variables
josephsavona Mar 22, 2024
f647252
[repro] Fixture for incorrect lowering for break (label within loop)
mofeiZ Mar 22, 2024
ee93b62
[ez] Patch BuildHIR to match unlabeled breaks to switch and loops
mofeiZ Mar 22, 2024
3229302
Repro for "expect trees to be >=2 elements long" invariant
josephsavona Mar 22, 2024
4575c8a
Detect hoisting where the reference is a reassignment
josephsavona Mar 22, 2024
d7d82e7
Correct eslint-plugin-react-compiler dependencies
kassens Mar 22, 2024
73fa712
Repro for destructuring with partial context variables
josephsavona Mar 22, 2024
f4ff1a2
Fix for destructuring with partial context variables
josephsavona Mar 22, 2024
200d2c3
Fix for loops with value block index initial value
josephsavona Mar 22, 2024
1f45b13
Update yarn.lock
poteto Mar 22, 2024
db7e7c7
Support method call when validating useEffect
gsathya Mar 22, 2024
2ce112d
Repro for missing dep with while/if using externally declared "index"…
josephsavona Mar 23, 2024
7030204
Update yarn.lock
gsathya Mar 25, 2024
15abd38
Cleanup unused eslint-browser and js-fuzzer packages
poteto Mar 25, 2024
e6ce5e4
[eslint] Update devDep to match types
poteto Mar 25, 2024
29ab0f8
Repro for scopes from AnalyzeFunction influencing outer compilation
josephsavona Mar 25, 2024
48ecaf9
Reset scopes from AnalyzeFunctions in InferReactiveScopeVariables
josephsavona Mar 25, 2024
fbd68ee
Fix for invalid mutable range in phi with backedge
josephsavona Mar 26, 2024
91f7bc8
Ensure valid mutable ranges for all scopes; fix ranges for context vars
josephsavona Mar 26, 2024
4d37a59
[be][tests] Move PropagateScopeDep fixtures to separate directory
mofeiZ Mar 28, 2024
1515cb3
[be][sprout] Add ErrorBoundary to test exceptions in sequentialRenders
mofeiZ Mar 28, 2024
877c490
[visitors] Visit loop body before update
mofeiZ Mar 28, 2024
2782fa2
[rhir] Preserve block labels + target blockIds for break/continue ter…
mofeiZ Mar 28, 2024
b98b569
[DeriveMinimalDeps] Account for conditional / poisoned accesses within
mofeiZ Mar 28, 2024
5166869
[patch] Fix control flow bug in PropagateScopeDeps
mofeiZ Mar 28, 2024
a6c6855
[be] Remove unused properties arg from addHook
gsathya Mar 28, 2024
0a3d1c3
Add type defs for reanimated
gsathya Mar 28, 2024
fd3ae0c
[type] Conservatively type return values from reanimated
gsathya Mar 28, 2024
a37f242
[be][DeriveMinimalDeps] Check current assumptions for conditional con…
mofeiZ Mar 28, 2024
638f8e3
Remove [ReactForget] prefix from error messages
poteto Mar 28, 2024
f4229cd
Rename error type
poteto Mar 28, 2024
df5ff97
Fix jest script
poteto Mar 28, 2024
7748ce8
Update compiler naming in remaining error text
poteto Mar 28, 2024
9d20aa2
Don't compile node_modules on playground
poteto Mar 28, 2024
5656d5f
[config] Change compiler defaults to prepare for oss
mofeiZ Mar 29, 2024
8d2cd32
Include package.json when bundling for oss
poteto Mar 29, 2024
832285f
Only create mutable ranges for phis *mutated* later
josephsavona Apr 1, 2024
1c33137
ReactiveTerminal: add loc and id to all variants
josephsavona Apr 1, 2024
b00300c
Remove disableAllMemoization flag
josephsavona Apr 1, 2024
ef285e0
Remove memoizeJsxElements flag
josephsavona Apr 1, 2024
f0806c4
Remove flag for enableEarlyReturnInReactiveScopes (always enable)
josephsavona Apr 1, 2024
d5b6e58
[hir] Add support for directives
gsathya Apr 2, 2024
cd3f56b
[eslint] Enforce generic array type syntax
gsathya Apr 2, 2024
69f03dc
Remove unused environment flags
josephsavona Apr 1, 2024
0af58d6
[ez] Clean up unused test filters
poteto Apr 2, 2024
5516cbb
[ez] Fix unneeded path in copyright script
poteto Apr 2, 2024
4e6aa42
Upgrade to typescript 5.4.3
poteto Apr 2, 2024
ba661c8
Remove comments in builds
poteto Apr 2, 2024
1de6c5a
[eslint] Don't lint generated files
gsathya Apr 2, 2024
91826d4
Configure rollup to strip comments and whitespace
poteto Apr 2, 2024
b4eeae6
Share rollup packages across workspace
poteto Apr 2, 2024
f01f74d
Also build react-forget-runtime with rollup
poteto Apr 2, 2024
5485ed0
Standardize on banner2 plugin
poteto Apr 2, 2024
e61f983
Fix yarn dev
poteto Apr 2, 2024
8b9edaf
Support use operator
josephsavona Apr 2, 2024
a53f208
Fixture for conditional use()
josephsavona Apr 2, 2024
284f776
[be] Clean up already fixed "bug" fixtures
josephsavona Apr 2, 2024
8a43e95
s/Forget/React Compiler/ in Rust port
josephsavona Apr 2, 2024
8523018
Remove reactive_ir crate
josephsavona Apr 3, 2024
0846daa
Commit message script captures non-ghstack messages
josephsavona Apr 3, 2024
94156d7
Repro for unmemoized value due to assignment to a context variable
josephsavona Apr 3, 2024
4c1aae4
[be] Cleanup removed directories from prettier script
josephsavona Apr 3, 2024
90dd208
ValidateNoCapitalizedCalls checks capitalized methods
josephsavona Apr 3, 2024
5ec3f02
Rename docs/architecture.md to design_goals per contents
josephsavona Apr 2, 2024
f33e638
Update copyrights to reference Meta instead of Facebook
josephsavona Apr 3, 2024
ee24e3f
Dogfood uMC polyfill in playground
poteto Apr 3, 2024
07a3404
Add basic playwright e2e test to playground
poteto Apr 3, 2024
9a9e03b
Add playground e2e to ci
poteto Apr 3, 2024
76bb13c
First attempt at making the linter work with advanced TypeScript syntax
kassens Apr 4, 2024
9a6cb24
[ez] Fix comments to be star blocks
poteto Apr 8, 2024
1f35f7e
Add new ErrorSeverity.CannotPreserveMemoization
poteto Apr 8, 2024
0d0f7c2
Update ValidatePreservedManualMemoization severity to
poteto Apr 8, 2024
5bf2323
Fix missing playground snapshot
poteto Apr 8, 2024
f4fbeb8
HIR-based AlignReactiveScopesToBlockScopes
josephsavona Apr 8, 2024
f707cb5
HIR-based MergeOverlappingScopes
josephsavona Apr 9, 2024
0c6fe1b
Cleanup range printing
josephsavona Apr 9, 2024
57d746e
HIR terminal for representing reactive scopes
josephsavona Apr 9, 2024
2f66d37
Use lz-string for playground state uri param
poteto Apr 10, 2024
594f335
Show alert when url copied
poteto Apr 10, 2024
9ae3e74
Rename references to "forget" in playground
poteto Apr 10, 2024
b6c01f7
Remove playground wipe button
poteto Apr 10, 2024
7083231
Add link to GitHub repo in playground header
poteto Apr 10, 2024
ed3bad0
Add aria-label to playground header buttons
poteto Apr 10, 2024
f990948
Small style tweaks to playground vertical tabs
poteto Apr 10, 2024
200b0f2
Add aria-label to playground tabs
poteto Apr 10, 2024
9cdd6b2
Fix playground e2e test
poteto Apr 10, 2024
ec05176
Make string values for config case-insensitive
poteto Apr 11, 2024
d2018c5
[playground] Editing input shouldn't toggle diff view
mofeiZ Apr 10, 2024
6e65445
Fix playground e2e test for real
poteto Apr 11, 2024
c836a01
Fix usage of renamed React internals
poteto Apr 11, 2024
4410243
[polyfill] Add sentinel to array
gsathya Apr 12, 2024
b28bb19
[codegen] Don't drop directives in simple arrow fn
gsathya Apr 15, 2024
5bceb3c
[.gitignore] Add bundle script
gsathya Apr 16, 2024
6bf64df
[babel] Add a sources option
gsathya Apr 16, 2024
fc7467a
[dx] Update error messages for config parsing
josephsavona Apr 18, 2024
4666bf8
[dx] Improve BuildHIR error messages
josephsavona Apr 18, 2024
87993f3
[dx] Update suppression error messages
josephsavona Apr 18, 2024
c84ff16
[dx] Update error message for reassigning globals
josephsavona Apr 18, 2024
8c8bd00
[dx] Update error messages for manual memo validation
josephsavona Apr 18, 2024
e3d0f4b
[dx] Update NoRefAccessInRender error messages
josephsavona Apr 18, 2024
da6c461
[dx] Consistently use backticks for quoting input in error messages
josephsavona Apr 18, 2024
a9732d6
[dx] Improve error messages for unpreserved memoization
josephsavona Apr 18, 2024
682f5a9
[dx] Update capitalized call error messages
josephsavona Apr 18, 2024
d870c97
Add StoreGlobal instruction
josephsavona Apr 18, 2024
a78da09
Move global reassignment validation to InferReferenceEffects
josephsavona Apr 18, 2024
07ba52b
Repro for false positive gating mode hoisting check
josephsavona Apr 19, 2024
9f9f4a9
Fix gating mode hoisting check to skip type references
josephsavona Apr 19, 2024
12f314f
Extend ValueReason w context identifiers
josephsavona Apr 20, 2024
f7a643c
Add ContextMutation variant of FunctionEffect
josephsavona Apr 20, 2024
c98c02f
InferReferenceEffects propagates context effects with precise locations
josephsavona Apr 20, 2024
f39dd1b
InferReferenceEffects s/reference/referenceAndRecordEffects/
josephsavona Apr 20, 2024
b110747
InferReferenceEffects defers function effects until used
josephsavona Apr 22, 2024
896d1b0
[dx] Improve error message from InferReferenceEffects
josephsavona Apr 22, 2024
b21ca44
[repro] bug repro
mofeiZ Apr 23, 2024
d87ba1b
[be] Stabilize block ids
mofeiZ Apr 23, 2024
1efb3ca
[HIR] Add new unreachable terminal
mofeiZ Apr 23, 2024
555100c
[HIR] Nonnullable block fallthroughs
mofeiZ Apr 23, 2024
40474b8
[HIR] Naive implementation of pruneUnusedLabels in HIR
mofeiZ Apr 23, 2024
10e11c4
[HIR] Assert program blocks and scopes are properly nested
mofeiZ Apr 23, 2024
6019ef0
[healthcheck] New package for checking violations
gsathya Apr 23, 2024
706e047
[healthcheck] Init tsconfig
gsathya Apr 23, 2024
a6cc5bc
[healthcheck] Read glob of src path
gsathya Apr 23, 2024
9e15ade
[healthcheck] Read files from globbed path
gsathya Apr 23, 2024
8d234c6
[hir] Remove hermes parser
gsathya Apr 23, 2024
dff0523
[healthcheck] Compile sources
gsathya Apr 23, 2024
e0dbe47
[healthcheck] Only count actionable failures
gsathya Apr 23, 2024
f8c0363
[healthcheck] Rename package to healthcheck
gsathya Apr 23, 2024
6304e98
Repro for for..of scoping bug
josephsavona Apr 24, 2024
da004f1
Add GetIterator instruction
josephsavona Apr 24, 2024
21b2af8
More precisely model for..of semantics with separate init/test blocks
josephsavona Apr 24, 2024
08b777d
[be] Rename NextIterableOf -> AdvanceIterator
josephsavona Apr 24, 2024
f22dd62
[HIR] Followup to pruneUnusedLabelsHIR (#2866)
mofeiZ Apr 23, 2024
89f2f7f
Make DropManualMemoization error message more accurate
poteto Apr 25, 2024
2d569a3
Add detection of dynamic hooks
josephsavona Apr 24, 2024
f196e1f
[hir][patch] Fix small bug in duplicate scope merging logic
mofeiZ Apr 25, 2024
1c7e34c
Stop reporting errors on mutations of primitives (and associated fals…
josephsavona Apr 25, 2024
a44559b
[hir] Re-implement mergeOverlappingReactiveScopes (+ bugfix)
mofeiZ Apr 26, 2024
59e37b0
[HIR] Detect more cases of invalid block nesting
mofeiZ Apr 26, 2024
0a7f442
Fix invariant on mutable context values
josephsavona Apr 25, 2024
2b2d305
[hir] Rewrite buildReactiveBlocks -> buildReactiveScopeTerminalsHIR
mofeiZ Apr 29, 2024
6db5f36
[tests] Add fixtures showing HIR rewrite changes
mofeiZ Apr 29, 2024
18f4a38
[hir-rewrite] Remove breaks to HIR ScopeTerminal after converting to …
mofeiZ Apr 29, 2024
1181043
Disable ValidateNoCapitalizedCalls by default
poteto Apr 25, 2024
86e0f87
Dynamically detect reanimated plugin
poteto Apr 30, 2024
fddc015
Remove duplicated hermes-parser
poteto May 1, 2024
c88d356
[healthcheck] Add status message
gsathya May 1, 2024
36d7755
[healthcheck] Check for StrictMode
gsathya May 1, 2024
c464445
[healthcheck] Check for incompatible libraries
gsathya May 1, 2024
4ce5c56
[healthcheck] Refactor checks into separate files
gsathya May 1, 2024
85e6e9b
[hir] Mark MethodCalls as escaping
gsathya May 1, 2024
ebe58ee
Update babel plugin to use runtime from react/compiler-runtime (#2918)
kassens May 1, 2024
f93529e
Don't compile node_modules by default
poteto May 1, 2024
48e0c70
Rename babel plugin
josephsavona May 2, 2024
b844766
Update references to Forget to React Compiler
josephsavona May 2, 2024
95e3cdc
Rename {r,R}unReactForgetBabelPlugin
josephsavona May 3, 2024
1c8f8bf
Rename ReactForgetBabelPlugin locals
josephsavona May 3, 2024
82137ec
Rename react-compiler-runtime
josephsavona May 3, 2024
90863be
Expand the architecture doc
josephsavona May 3, 2024
738ddf7
Support <fbs> in addition to <fbt>
pieterv May 3, 2024
e177154
Remove domain from playground font sources (#2934)
kassens May 6, 2024
95ba7dc
Update readme and other docs
josephsavona May 6, 2024
e63d3d1
Upgrade to React 19 beta (#2938)
kassens May 6, 2024
3708c36
[easy] remove unstable_useMemoCache reference from a snapshot file (#…
kassens May 6, 2024
e2d4734
Use default runtimeModule setting in Snap tests (#2940)
kassens May 6, 2024
84d28eb
Default to raising all errors in eslint plugin
poteto May 7, 2024
d0a51e7
Allow eslint rule reportable severity to be set
poteto May 7, 2024
b28c53d
Clarify how to address ValidateNoCapitalizedCalls errors
poteto May 7, 2024
7caf071
Add failing test for eslint-plugin false positive
poteto May 7, 2024
55d6c6e
CI: move .github directory back to root (#2941)
kassens May 7, 2024
90a5d48
CI: fix Rust CI workflows (#2942)
kassens May 7, 2024
fd873e8
Rust: add stub for ensure_sufficient_stack (#2943)
kassens May 7, 2024
257f22a
CI: fix Compiler TypeScript workflow (#2946)
kassens May 7, 2024
f4c12cc
CI: fix Compiler Playground workflow (#2945)
kassens May 7, 2024
5a1cbc7
CI: remove react.yml integration test workflow (#2947)
kassens May 7, 2024
6b23c25
Support HMR
josephsavona May 9, 2024
c58142b
ReAnimated -> Reanimated
poteto May 11, 2024
9b0044e
Better detection for reanimated
poteto May 11, 2024
db34843
[healthcheck] Build with rollup
poteto May 11, 2024
9a6ce33
[healthcheck] Fix build
poteto May 11, 2024
63e5330
[healthcheck] Rename to react-compiler-healthcheck
poteto May 11, 2024
76b7331
[healthcheck] Only glob files with certain extensions by default
poteto May 11, 2024
78da5be
[healthcheck] Remove console.error
poteto May 11, 2024
9ef7557
[healthcheck] Don't compile mjs
poteto May 11, 2024
669e8d0
[healthcheck] Refine glob pattern
poteto May 11, 2024
7e3be12
Use unique name for c import local identifier
josephsavona May 13, 2024
4cf7ee2
CI: remove non-functional Rust compiler benchmark workflow (#2948)
kassens May 13, 2024
ce0c08e
[healthcheck] Clean up ignorelist and check if deps exist
poteto May 13, 2024
b956024
Fix Jest tests
josephsavona May 13, 2024
5a842db
Fix healthcheck package.json bin field
poteto May 14, 2024
67ea821
[publish] Fix `files` field for packages, invalid version range
poteto May 14, 2024
6948639
[publish] Add script to publish packages
poteto May 14, 2024
6457343
Don't emit types for babel-plugin-react-compiler
poteto May 14, 2024
ecccaf6
Fix CI for compiler paths
poteto May 14, 2024
41142f3
Unthrow publish script
poteto May 15, 2024
d794e4a
Bump version to 0.0.0-experimental-4690415-20240515
poteto May 15, 2024
5501ebc
Bump version to 0.0.0-experimental-e04a001-20240515
poteto May 15, 2024
740b7c1
Bump version to 0.0.0-experimental-410375f-20240515
poteto May 15, 2024
575477a
Publish React Compiler to open source
josephsavona May 15, 2024
4c2bbc6
docs: add complete React Compiler review viewers
sandoche Nov 13, 2026
5701572
docs: preserve full review bundle and delivery records
sandoche Nov 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
34 changes: 34 additions & 0 deletions .github/workflows/compiler-playground.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Compiler Playground

on:
push:
branches: [main]
pull_request:
paths:
- "compiler/**"
- .github/workflows/compiler-playground.yml

defaults:
run:
working-directory: compiler

jobs:
playground:
name: Test playground
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "yarn"
cache-dependency-path: compiler/yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: npx playwright install --with-deps chromium
- run: yarn workspace playground test
72 changes: 72 additions & 0 deletions .github/workflows/compiler-rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: React Compiler (Rust)

on:
push:
branches: ["main"]
paths:
- .github/workflows/**
- compiler/crates/**
- compiler/Cargo.*
- compiler/*.toml
pull_request:
paths:
- .github/workflows/**
- compiler/crates/**
- compiler/Cargo.*
- compiler/*.toml

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings

defaults:
run:
working-directory: compiler

jobs:
test:
name: Rust Test (${{ matrix.target.os }})
strategy:
matrix:
target:
- target: ubuntu-latest
os: ubuntu-latest
# TODO: run on more platforms
# - target: macos-latest
# os: macos-latest
# - target: windows-latest
# os: windows-latest
runs-on: ${{ matrix.target.os }}
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: cargo test
run: cargo test --manifest-path=Cargo.toml --locked ${{ matrix.target.features && '--features' }} ${{ matrix.target.features }}

lint:
name: Rust Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
# NOTE: use `rustup run <toolchain> <command>` in commands below
# with this exact same toolchain value
toolchain: nightly-2023-08-01
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: rustfmt
run: grep -r --include "*.rs" --files-without-match "@generated" crates | xargs rustup run nightly-2023-08-01 rustfmt --check --config="skip_children=true"
# - name: cargo clippy
# run: rustup run nightly-2023-08-01 cargo clippy -- -Dclippy::correctness

build:
name: Rust Build
runs-on: ubuntu-latest
# TODO: build on more platforms, deploy, etc
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: cargo build
run: cargo build --release
88 changes: 88 additions & 0 deletions .github/workflows/compiler-typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: React Compiler (TypeScript)

on:
push:
branches: [main]
pull_request:
paths:
- "compiler/**"
- .github/workflows/compiler-typescript.yml

defaults:
run:
working-directory: compiler

jobs:
discover_yarn_workspaces:
name: Discover yarn workspaces
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- id: set-matrix
run: echo "matrix=$(find packages -mindepth 1 -maxdepth 1 -type d | sed 's!packages/!!g' | tr '\n' ',' | sed s/.$// | jq -Rsc '. / "," - [""]')" >> $GITHUB_OUTPUT

# Hardcoded to improve parallelism for babel-plugin-react-compiler
lint:
name: Lint babel-plugin-react-compiler
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "yarn"
cache-dependency-path: compiler/yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
with:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn workspace babel-plugin-react-compiler prettier:ci
- run: yarn workspace babel-plugin-react-compiler lint

# Hardcoded to improve parallelism for babel-plugin-react-compiler
jest:
name: Jest babel-plugin-react-compiler
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "yarn"
cache-dependency-path: compiler/yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn workspace babel-plugin-react-compiler jest

test:
name: Test ${{ matrix.workspace_name }}
needs: discover_yarn_workspaces
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
workspace_name: ${{ fromJSON(needs.discover_yarn_workspaces.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "yarn"
cache-dependency-path: compiler/yarn.lock
- name: Restore cached node_modules
uses: actions/cache@v4
id: node_modules
with:
path: "**/node_modules"
key: ${{ runner.arch }}-${{ runner.os }}-modules-${{ hashFiles('compiler/**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- run: yarn workspace ${{ matrix.workspace_name }} test
28 changes: 28 additions & 0 deletions code-unpacked-artifacts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# React Compiler: Code Unpacked showcase

This archive contains the complete five-format bundle generated for [sandoche/react#1](https://github.com/sandoche/react/pull/1).
The source snapshot is pinned to `575477a2e8f9db57ef4a1bf0d3b449e4f8244af8`. Artifact commits do not replace that analyzed revision.

Extract this archive, then open `.code-unpacked/pr/1/<format>/index.html` in a browser.
Each HTML viewer works offline. The context, analysis, authoring content, diagrams, comics, transcripts, manifests, and delivery records are included.

Published PR comments:

- [walkthrough](https://github.com/sandoche/react/pull/1#issuecomment-6840893396)
- [reverse-design](https://github.com/sandoche/react/pull/1#issuecomment-6840894392)
- [code-map](https://github.com/sandoche/react/pull/1#issuecomment-6840896940)
- [review-quiz](https://github.com/sandoche/react/pull/1#issuecomment-6840897317)
- [xkcd](https://github.com/sandoche/react/pull/1#issuecomment-6840898078)

The manifests separate generation completeness from delivery, and retain the source and tool limitations.
The bundle is an explanation and review aid; it does not establish correctness or test-suite success for the upstream project.

[Download the complete offline bundle](./react-pr-1-complete-bundle.zip?raw=1).

Individual offline viewers:

- [walkthrough](./walkthrough.html.zip?raw=1)
- [reverse-design](./reverse-design.html.zip?raw=1)
- [code-map](./code-map.html.zip?raw=1)
- [review-quiz](./review-quiz.html.zip?raw=1)
- [xkcd](./xkcd.html.zip?raw=1)
41 changes: 41 additions & 0 deletions code-unpacked-artifacts/artifact-index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"repository": "sandoche/react",
"pr": 1,
"formats": {
"walkthrough": {
"download": "walkthrough.html.zip",
"originalHtmlSha256": "047c87928dcf7dfb2dc24993cbcbc31f7f2f9c0a17d6111bdb850b94bc3b807e",
"sourceHead": "575477a2e8f9db57ef4a1bf0d3b449e4f8244af8",
"contextHash": "ec23463eedd3df46a881a81b38d486e8f7b2d1ff6fae59d7e01b6f4800eef174"
},
"reverse-design": {
"download": "reverse-design.html.zip",
"originalHtmlSha256": "8ca0f05ce3f56d68d21503f4bc6c3d47c930a3aa85b297a13d9b72dfed50ca78",
"sourceHead": "575477a2e8f9db57ef4a1bf0d3b449e4f8244af8",
"contextHash": "ec23463eedd3df46a881a81b38d486e8f7b2d1ff6fae59d7e01b6f4800eef174"
},
"code-map": {
"download": "code-map.html.zip",
"originalHtmlSha256": "0166087d07b371c668275371549eb755a5358f96005d9a6ff3e06abc0ff34512",
"sourceHead": "575477a2e8f9db57ef4a1bf0d3b449e4f8244af8",
"contextHash": "ec23463eedd3df46a881a81b38d486e8f7b2d1ff6fae59d7e01b6f4800eef174"
},
"review-quiz": {
"download": "review-quiz.html.zip",
"originalHtmlSha256": "0be164d16369d4416b316a3968eaded34f274bfeba2b919ecbc4e90374841597",
"sourceHead": "575477a2e8f9db57ef4a1bf0d3b449e4f8244af8",
"contextHash": "ec23463eedd3df46a881a81b38d486e8f7b2d1ff6fae59d7e01b6f4800eef174"
},
"xkcd": {
"download": "xkcd.html.zip",
"originalHtmlSha256": "0fbd1d5b8fe8e11d9f8746e02ca953f8df05b4913cfccafaa26cfc1e88089a4c",
"sourceHead": "575477a2e8f9db57ef4a1bf0d3b449e4f8244af8",
"contextHash": "ec23463eedd3df46a881a81b38d486e8f7b2d1ff6fae59d7e01b6f4800eef174",
"images": [
"comic-01.png",
"comic-02.png",
"comic-03.png"
]
}
}
}
Binary file added code-unpacked-artifacts/code-map.html.zip
Binary file not shown.
Binary file added code-unpacked-artifacts/comic-01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added code-unpacked-artifacts/comic-02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added code-unpacked-artifacts/comic-03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file added code-unpacked-artifacts/reverse-design.html.zip
Binary file not shown.
Binary file added code-unpacked-artifacts/review-quiz.html.zip
Binary file not shown.
Binary file added code-unpacked-artifacts/walkthrough.html.zip
Binary file not shown.
Binary file added code-unpacked-artifacts/xkcd.html.zip
Binary file not shown.
2 changes: 2 additions & 0 deletions compiler/.git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
741ae6e3aa10735722a442a3c8be77af7c951204
59cba458af27d936df8feabf641f545f431529ad
24 changes: 24 additions & 0 deletions compiler/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.DS_Store
.spr.yml

# Generated by Cargo
# will have compiled files and executables
debug/
target/

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

node_modules
.watchmanconfig
.watchman-cookie-*
dist
.vscode
!packages/playground/.vscode
.spr.yml
testfilter.txt

bundle-oss.sh
Empty file added compiler/.gitmodules
Empty file.
12 changes: 12 additions & 0 deletions compiler/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.fixtures/
bench/
**/dist
**/__tests__/fixtures/**/*.expect.md
**/__tests__/fixtures/**/*.flow.js
**/.next
test262/
*.md
*.json
*.css
*.webmanifest
packages/js-fuzzer
4 changes: 4 additions & 0 deletions compiler/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"requirePragma": false,
"parser": "babel-ts"
}
8 changes: 8 additions & 0 deletions compiler/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.formatOnSave": true,
"[typescript][typescriptreact]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
}
}
}
1 change: 1 addition & 0 deletions compiler/.watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading