Download the PHP package julien-lin/react-bundle-symfony without Composer

On this page you can find all versions of the php package julien-lin/react-bundle-symfony. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package react-bundle-symfony

ReactBundle v2.0 - Production-Ready React Integration for Symfony

Enterprise-grade Symfony bundle for seamless React + Vite integration

A lightweight, secure, and high-performance bundle that brings modern React development to Symfony, replacing Stimulus with production-ready components.

GitHub PHP Version Symfony GitHub Sponsors

Languages: 🇫🇷 Français


🚀 Why ReactBundle v2.0?

Production-Ready - 152 tests, 88% coverage, 100% security hardening
Performance Monitored - Built-in metrics, logging, and observability
Enterprise Security - XSS protection, command injection prevention, SSRF validation
Zero Configuration - Works out of the box with Symfony Flex
Modern Tooling - Vite-powered HMR for blazing-fast development
Highly Testable - Comprehensive test suite with edge case coverage

💝 Support the project

If this bundle saves you time, consider becoming a sponsor to support ongoing development and maintenance of this open-source project.


⚡ Quick Start (5 minutes)

1. Install via Composer

Composer automatically installs npm dependencies via Symfony Flex.

2. Create React folder structure

3. Configure assets/React/index.js

4. Configure assets/js/app.jsx

5. Use in Twig templates

6. Build and run

✅ Done! Your React component is live.


📋 Table of Contents

  1. Installation
  2. Core Features
  3. TypeScript Support
  4. Advanced Usage
  5. Production Deployment
  6. Configuration
  7. API Reference
  8. Performance & Monitoring
  9. Security
  10. Troubleshooting
  11. Contributing

📦 Installation

Via Composer

The Composer installation script will automatically install npm dependencies.

Configuration

  1. The bundle registers automatically via Symfony Flex.

  2. Configure the bundle in config/packages/react.yaml:

  3. If npm dependencies were not automatically installed:

  4. Create the file structure in your Symfony project (if it doesn't already exist):

  5. Configure assets/React/index.js (entry point for your components):

  6. Configure assets/js/app.jsx (must import from ../React):

Usage

Prerequisites: File Structure

Before using the bundle, make sure you have the following structure in your Symfony project:

In your Twig templates

Important: The component name in react_component() must match exactly the name used in the export of assets/React/index.js.

TypeScript Support

ReactBundleSymfony supports TypeScript out of the box. You can write your React components in TypeScript (.tsx files) for full type safety.

Quick Setup

  1. Install TypeScript:

  2. Create tsconfig.json:

  3. Rename files to .tsx:

    • assets/js/app.jsxassets/js/app.tsx
    • assets/React/Components/*.jsxassets/React/Components/*.tsx
  4. Use TypeScript in components:

See TYPESCRIPT.md for complete TypeScript documentation.

Docker Quick Start

Get started with Docker in 5 minutes:

See QUICK_START_DOCKER.md for complete Docker guide.

Build assets

Development with HMR

Production

Bundle structure

Recommended structure in your Symfony project

Create your React components in your Symfony project, not in the bundle:

Create a new React component

Quick workflow

Step 1: Create the component file

Create your component in assets/React/Components/YourComponent.jsx:

Step 2: Export the component in index.js

Add the export in assets/React/index.js:

Important: The name used in the export (YourComponent) must match exactly the name you will use in Twig.

Step 3: Use the component in a Twig template

In your Twig template:

Step 4: Rebuild assets

After creating or modifying a component:

Complete example

1. Create assets/React/Components/ProductCard.jsx

2. Export in assets/React/index.js

3. Use in Twig

Important notes

Migration from Stimulus

ReactBundleSymfony is designed as a modern replacement for Stimulus in Symfony applications.

Quick migration:

  1. Install ReactBundle: composer require julien-lin/react-bundle-symfony
  2. Convert Stimulus controllers to React components
  3. Replace data-controller="..." with {{ react_component(...) }}

See MIGRATION_STIMULUS.md for complete migration guide with examples.

Advanced configuration

Customize Vite server

In config/packages/react.yaml:

Environment variables

You can define VITE_SERVER_URL in your .env to customize the Vite server URL in development:

Or in config/packages/react.yaml:

Troubleshooting

Components are not displaying

"Component not found" error

HMR is not working

npm/Node.js errors

Path errors (Windows)

Adding npm Packages

To add npm packages (like react-icons, axios, etc.) to your project:

  1. Install the package in your Symfony project root (not in the bundle):

  2. Import and use it in your components:

  3. Rebuild assets:

📖 Full guide: See ADDING_NPM_PACKAGES.md for detailed instructions and examples.

Support

License

MIT


All versions of react-bundle-symfony with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
symfony/framework-bundle Version ^7.0|^8.0
symfony/twig-bundle Version ^7.0|^8.0
symfony/console Version ^7.0|^8.0
symfony/process Version ^7.0|^8.0
twig/twig Version ^3.0|^4.0
symfony/yaml Version ^7.0|^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package julien-lin/react-bundle-symfony contains the following files

Loading the files please wait ...