Skip to content

[LiveComponent] Add LiveResponse::remove() to trigger component deletion #226

[LiveComponent] Add LiveResponse::remove() to trigger component deletion

[LiveComponent] Add LiveResponse::remove() to trigger component deletion #226

Workflow file for this run

name: App Bundler
on:
push:
branches-ignore:
- 'dependabot/**'
paths-ignore:
- 'src/*/doc/**'
- 'src/**/*.md'
pull_request:
paths-ignore:
- 'src/*/doc/**'
- 'src/**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: {}
jobs:
test:
name: ${{ matrix.bundler }} / ${{ matrix.ux-packages-source }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bundler: ['encore', 'vite', 'rsbuild']
ux-packages-source: ['php-vendor', 'js-packages']
include:
- bundler: encore
dev-deps: '@symfony/webpack-encore @symfony/stimulus-bridge@^4.0.1 webpack@^5.109.2 webpack-cli@^7.2.2 vue-loader@^17.0.0 @babel/core@^8.0.1 @babel/preset-env@^8.0.2 @babel/preset-react@^8.0.1'
build-command: 'npx encore dev && npx encore production'
- bundler: vite
dev-deps: '@symfony/reprise vite@^8.2.1 @vitejs/plugin-react@^6.0.5 @vitejs/plugin-vue@^6.0.8'
build-command: 'npx vite build --mode development && npx vite build'
- bundler: rsbuild
dev-deps: '@symfony/reprise @rsbuild/core@^2.1.11 @rsbuild/plugin-react@^2.1.0 @rsbuild/plugin-vue@^2.0.1'
build-command: 'npx rsbuild build --mode development && npx rsbuild build'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: pnpm/setup@84cb39b217b10273981911c288cd62326dc7c6d2 # v2.0.2
with:
install: false
- uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
- name: Install root PHP dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
with:
working-directory: ${{ github.workspace }}
- name: Build root PHP packages
run: php .github/build-packages.php
# We always install PHP deps because of the UX Translator, which requires `var/translations` to exists
- name: Install app dependencies
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
with:
working-directory: apps/bundler
dependency-versions: highest
- working-directory: apps/bundler
run: npm install --install-links
- name: Install "${{ matrix.bundler }}" dependencies
working-directory: apps/bundler
run: npm add --save-dev --install-links ${{ matrix.dev-deps }}
- if: matrix.ux-packages-source == 'js-packages'
name: Install UX JS packages with a JS package manager
working-directory: apps/bundler
run: |
PACKAGES_TO_INSTALL=''
for PACKAGE_DATA in $(pnpm ls -r --json --depth -1 | jq 'map(select(.private != true))' | jq -c '.[]'); do
PACKAGE_PATH=$(echo $PACKAGE_DATA | jq -r '.path')
PACKAGES_TO_INSTALL="$PACKAGES_TO_INSTALL file:$(realpath --relative-to=. "$PACKAGE_PATH")"
done
echo "Installing packages: $PACKAGES_TO_INSTALL"
npm add --save-dev --install-links $PACKAGES_TO_INSTALL
- name: Ensure UX packages are installed from "${{ env.EXPECTED_PATTERN }}"
working-directory: apps/bundler
run: |
for PACKAGE_DATA in $(cat package.json | jq -c '(.dependencies // {}) + (.devDependencies // {}) | to_entries[] | select(.key | startswith("@symfony/ux-")) | {name: .key, version: .value}'); do
PACKAGE=$(echo $PACKAGE_DATA | jq -r '.name')
PACKAGE_VERSION=$(echo $PACKAGE_DATA | jq -r '.version')
echo -n "Checking $PACKAGE@$PACKAGE_VERSION..."
if [[ $PACKAGE_VERSION == $EXPECTED_PATTERN* ]]; then
echo "✅ OK"
else
echo "❌ KO"
echo "ℹ️ The package version of $PACKAGE must starts with the pattern (e.g.: $EXPECTED_PATTERN), got $PACKAGE_VERSION instead."
exit 1
fi
done;
env:
EXPECTED_PATTERN: ${{ matrix.ux-packages-source == 'php-vendor' && 'file:vendor/symfony/*' || 'file:../../src/*' }}
- name: Ensure project can be built in dev and prod modes
working-directory: apps/bundler
run: ${{ matrix.build-command }}