2015-06-09 16:40:42 +00:00
|
|
|
matrix-react-sdk
|
|
|
|
================
|
|
|
|
|
|
|
|
This is a react-based SDK for inserting a Matrix chat client into a web page
|
2015-06-24 15:33:53 +00:00
|
|
|
|
2015-07-03 14:56:04 +00:00
|
|
|
Getting started with the trivial example
|
|
|
|
========================================
|
2015-06-24 16:58:13 +00:00
|
|
|
|
|
|
|
1. Install or update `node.js` so that your `npm` is at least at version `2.0.0`
|
|
|
|
2. Clone the repo: `git clone https://github.com/matrix-org/matrix-react-sdk.git`
|
2015-07-06 17:58:32 +00:00
|
|
|
3. Switch to the SDK directory: `cd matrix-react-sdk`
|
2015-07-03 14:56:04 +00:00
|
|
|
4. Install the prerequisites: `npm install`
|
2015-07-06 17:58:32 +00:00
|
|
|
5. Switch to the example directory: `cd examples/trivial`
|
|
|
|
6. Install the example app prerequisites: `npm install`
|
|
|
|
7. Build the example and start a server: `npm start`
|
2015-06-24 16:58:13 +00:00
|
|
|
|
2015-07-03 14:56:04 +00:00
|
|
|
Now open http://127.0.0.1:8080/ in your browser to see your newly built
|
|
|
|
Matrix client.
|
2015-06-24 16:58:13 +00:00
|
|
|
|
|
|
|
Using the example app for development
|
|
|
|
=====================================
|
|
|
|
|
2015-07-03 15:15:23 +00:00
|
|
|
To work on the CSS and Javascript and have the bundle files update as you
|
|
|
|
change the source files, you'll need to do two extra things:
|
2015-06-24 16:58:13 +00:00
|
|
|
|
2015-07-03 15:15:23 +00:00
|
|
|
1. Link the react sdk package into the example:
|
2015-07-06 17:29:24 +00:00
|
|
|
`cd matrix-react-sdk/examples/trivial; npm link ../../`
|
2015-07-03 15:15:23 +00:00
|
|
|
2. Start a watcher for the CSS files:
|
|
|
|
`cd matrix-react-sdk; npm run start:css`
|
2015-07-03 14:56:04 +00:00
|
|
|
|
|
|
|
Note that you may need to restart the CSS builder if you add a new file. Note
|
|
|
|
that `npm start` builds debug versions of the the javascript and CSS, which are
|
|
|
|
much larger than the production versions build by the `npm run build` commands.
|
2015-06-24 15:33:53 +00:00
|
|
|
|
2015-07-06 13:13:02 +00:00
|
|
|
IMPORTANT: If you customise components in your application (and hence require
|
|
|
|
react from your app) you must be sure to:
|
|
|
|
|
|
|
|
1. Make your app depend on react directly
|
|
|
|
2. If you `npm link` matrix-react-sdk, manually remove the 'react' directory
|
|
|
|
from matrix-react-sdk's `node_modules` folder, otherwise browserify will
|
|
|
|
pull in both copies of react which causes the app to break.
|