This is the core of the retax framework. Its role is to bootstrap your universal react / redux application and to setup everything if you want to use optionnal retax modules.
Check theses projects to learn how to use retax: retax-client or retax-server.
When you bootstrap a retax application (whether on client or on server: the code of retax-core is 100% universal), these lifecycle events will happened in order:
- Read the initial app state
- on the client, from a
window.__INITIAL_STATE__
- on the client, from a
- Read the
authentication cookie
- on the client, from the dom cookie (using
js-cookie
) - on the server, from the request
- on the client, from the dom cookie (using
- Initialize the redux store and initialize a retax reducer
- Run an optionnal hook (set by the user) to allow user to dispatch early actions
- Initialize react-router and do the route matching
- Run an optionnal hook (set by the user) to allow user to dispatch actions impacting rendererd components
- Generate the JSX of the corresponding app
- on the server, retax-core populate
window.__INITIAL_STATE__
with the corresponding initial state.
- on the server, retax-core populate
The rendering is delegated to these modules retax-client or retax-server.
retax-core literally just build the application.
Your application will be wrapped by a component <RetaxProvider />
. This component exposes to its children a IoC container.
This allows them to use dependency injection. This is highly used by all retax modules.
Check builder and builder-ts-library
This project is shipped with typescript typings. If you are using typescript@^1.6, you don't have to do anything, it will detect the definition types automatically.
Thanks to remojansen for the project inversify. This project is intensively used by retax-core and allow it to be 100% universal.
##License MIT License (MIT)