Download the PHP package sasab/react-bridge without Composer

On this page you can find all versions of the php package sasab/react-bridge. 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-bridge

React Bridge

A small library that helps you make hybrid apps by integrating React.js into full stack PHP frameworks.

Inspired by react-rails gem

Getting started

All you need to do to integrate React into your favorite full stack MVC project is:

  1. npm install react or yarn add react

  2. composer require sasab/react-bridge

  3. Call the react_component or rc function somewhere in your views

  4. Finally, add the generated file(s) to your bundle or directly into your html via the script tag

If you are a Laravel user you can start using it out of the box, it uses Laravel's folder structure by default.

The "bundling" react.js file will be generated in /resources/assets/js and it will look for your React component files in the /resources/assets/js/components folder by default.

This function will detect the environment of your app from the .env file, if it is in production it will just return the <div id='my-component' data-props='{"foo":"bar"}'> file required by React. If it is in development it will write/append to the react.js file.

You can override the defaults by either using the .env file or providing the overrides as the third param to the react_component function.

.env:

Options

  1. ref - if you set it to true your component will have have a reference on the global window object window._components.MyComponent
  2. component - by default the first parameter to the react_component function represents the html id attribute which will be turned into the StudlyCase name of your component, and the function will look into the root of the ../components/ folder for your actual React.jsx component file.

    If you want to provide a custom name or a custom path or both you can provide it as this parameter e.g.:

    Dot-notation is also supported so you can write it like this as well:

    From v1.1 first parameter can be an array, so you can provide the id and the custom component as a list: :

  3. path - base path where your bundling file(s) will be generated

  4. folder - folder name inside the path where your React.jsx components will be located

  5. filename - name of your bundling file(s)

Conventions

The first parameter to the react_component expects a slug that will be the id of the element which, as previously noted, will be turned into the StudlyCase name of the component, e.g.:

react_component('my-component');

If the name of the component is actually a folder the function will look for a container component inside of the folder /MyComponent/MyComponentContainer. You can read more about this React pattern here


All versions of react-bridge with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
vlucas/phpdotenv Version ^2.5
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 sasab/react-bridge contains the following files

Loading the files please wait ....