Contribute

Learn Behind the scenes

This page is for the contributor or anyone who wants to learn how pre-reactJS works

The four scripts::

Everything in pre-reactjs is handled by just 4 javascript files.

1. The Server server.js :

This is the entrypoint of the application. It is a file server written using express and it returns the same index.html for every incoming request to it. It also calls the compiler function that creates the file based routes everytime it is restarted. That is everything it does.

2. The router scripts/router.js :

This file handles everything related to routing in your application. It is added as a script tag in the application and looks for any changes in the window location history, it also handles all the html changes.

3. The loader scripts/loader.js :

This file is used as a the loader of all the page HTML's once the application is loaded. This script stores all the HTML content in the session storage of the browser.

4. Compiler scripts/compile.js :

This does'nt compile anything in the conventional sense but in a loose term. What this script does is it creates the loader and router scripts dynamically i.e. according to the files present in the Pages and Logic directory. That is just about it.