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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/tester-app-rspack1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# standalone lab - its install artifacts stay out of the repository
node_modules/
pnpm-lock.yaml
callstack-repack.tgz
.repack-pack/
build/
ios/Pods/
ios/*.xcworkspace/
.xcode.env
5 changes: 5 additions & 0 deletions apps/tester-app-rspack1/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# The lockfile is intentionally untracked (see .gitignore): it pins the
# locally packed callstack-repack.tgz, whose contents change on every
# `pnpm run pack-repack`. Installs can therefore never be frozen - override
# pnpm's CI default so `pnpm install` behaves the same everywhere.
frozen-lockfile=false
15 changes: 15 additions & 0 deletions apps/tester-app-rspack1/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>= 2.6.10'

# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'

# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
118 changes: 118 additions & 0 deletions apps/tester-app-rspack1/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.8)
activesupport (7.1.3.3)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.3.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
claide (1.1.0)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.3.1)
connection_pool (2.4.1)
drb (2.2.1)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.17.0)
ffi (1.17.0-arm64-darwin)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.7.2)
logger (1.7.0)
minitest (5.23.1)
molinillo (0.8.0)
mutex_m (0.2.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.7)
rexml (3.4.4)
ruby-macho (2.5.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.25.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (>= 3.3.6, < 4.0)

PLATFORMS
arm64-darwin-21
arm64-darwin-22
ruby

DEPENDENCIES
activesupport (>= 6.1.7.5, != 7.1.0)
benchmark
bigdecimal
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
logger
mutex_m
xcodeproj (< 1.26.0)

RUBY VERSION
ruby 2.7.6p219

BUNDLED WITH
2.4.20
62 changes: 62 additions & 0 deletions apps/tester-app-rspack1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# tester-app-rspack1

Standalone validation app pinned to **Rspack 1**, deliberately **outside the
pnpm workspace** (excluded via a negation glob in the root
`pnpm-workspace.yaml`, and marked as its own workspace root by the local
`pnpm-workspace.yaml`).

## Why outside the workspace

`packages/repack` has `@rspack/core@^2` as a devDependency (needed for types
and unit tests). Inside the workspace, repack is symlinked, so its published
code's plain `require('@rspack/core')` resolves that devDependency **before**
any version an app pins - every workspace app effectively runs Rspack 2,
regardless of its manifest. The shipped code intentionally stays free of
monorepo-aware resolution workarounds (decision 2026-07-03), so the Rspack 1
validation surface has to be a project where resolution works like a real
user project:

- own `node_modules` (nothing hoisted from the workspace),
- repack installed from a **packed tarball** (`file:./callstack-repack.tgz`)
- a tarball install has no nested `node_modules`, so `@rspack/core`
resolves to this app's own `^1.x` copy.

One consequence: runtime dependencies resolve from the npm registry, not the
workspace - notably `@callstack/repack-dev-server`, because `pnpm pack`
rewrites repack's `workspace:*` dependency to the published version. This app
therefore validates the locally packed repack against **published** runtime
deps; changes to `packages/dev-server` are not exercised here and need
re-validation via [`tester-app`](../tester-app/) (or an additional
dev-server pack step).

The src is intentionally minimal and **not** shared with `tester-app`
(sharing src across the workspace boundary would resolve `react`/
`react-native` from two different installs). It covers the bundler-major
surface: dev server, HMR/React Refresh (the vendored-runtime path under v1),
async local chunks via ScriptManager, and production bundling. Full feature
coverage (NativeWind, Reanimated, remote chunks/mini-apps, assets matrix)
lives in [`tester-app`](../tester-app/) - the **Rspack 2** example.

## Setup

```sh
pnpm run pack-repack # builds packages/repack and packs it to ./callstack-repack.tgz
pnpm install # standalone install (own lockfile, gitignored)
Comment thread
dannyhw marked this conversation as resolved.
```

Re-run both steps after changing `packages/repack` - the tarball is a
snapshot, not a link.

The lockfile is intentionally untracked: it pins the locally packed tarball,
which changes on every `pack-repack`. The local `.npmrc` sets
`frozen-lockfile=false` so plain `pnpm install` also works in CI (where pnpm
would otherwise default to a frozen lockfile).

## Usage

```sh
pnpm start # dev server (Rspack 1)
pnpm bundle:android # production bundle - should print "(Rspack 1.x)"
pnpm android / pnpm ios # native shells (react-native-test-app)
pnpm pods # iOS pods (see tester-app notes re: ruby version)
```
43 changes: 43 additions & 0 deletions apps/tester-app-rspack1/android/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
buildscript {
apply(from: {
def searchDir = rootDir.toPath()
do {
def p = searchDir.resolve("node_modules/react-native-test-app/android/dependencies.gradle")
if (p.toFile().exists()) {
return p.toRealPath().toString()
}
} while (searchDir = searchDir.getParent())
throw new GradleException("Could not find `react-native-test-app`");
}())

repositories {
mavenCentral()
google()
}

dependencies {
getReactNativeDependencies().each { dependency ->
classpath(dependency)
}
}
}

allprojects {
repositories {
{
def searchDir = rootDir.toPath()
do {
def p = searchDir.resolve("node_modules/react-native/android")
if (p.toFile().exists()) {
maven {
url(p.toRealPath().toString())
}
break
}
} while (searchDir = searchDir.getParent())
// As of 0.80, React Native is no longer installed from npm
}()
mavenCentral()
google()
}
}
Binary file added apps/tester-app-rspack1/android/debug.keystore
Binary file not shown.
55 changes: 55 additions & 0 deletions apps/tester-app-rspack1/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the Gradle Daemon. The setting is
# particularly useful for configuring JVM memory settings for build performance.
# This does not affect the JVM settings for the Gradle client VM.
# The default is `-Xmx512m -XX:MaxMetaspaceSize=256m`.
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

# When configured, Gradle will fork up to org.gradle.workers.max JVMs to execute
# projects in parallel. To learn more about parallel task execution, see the
# section on Gradle build performance:
# https://docs.gradle.org/current/userguide/performance.html#parallel_execution.
# Default is `false`.
#org.gradle.parallel=true

# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64

# Use this property to enable support to the new architecture.
# This will allow you to use TurboModules and the Fabric render in
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
# Note that this is incompatible with web debugging.
newArchEnabled=true
bridgelessEnabled=true
hermesEnabled=true

# Uncomment the line below to build React Native from source.
#react.buildFromSource=true

# Version of Android NDK to build against.
#ANDROID_NDK_VERSION=26.1.10909125

# Version of Kotlin to build against.
#KOTLIN_VERSION=1.8.22

# Use this property to enable edge-to-edge display support.
# This allows your app to draw behind system bars for an immersive UI.
# Note: Only works with ReactActivity and should not be used with custom Activity.
edgeToEdgeEnabled=true
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading