Giter Site home page Giter Site logo

ashleymavericks / browser-hot-reloading Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 14 KB

Browser hot-reloading for Python ASGI web frameworks like FastAPI using arel

License: MIT License

Python 68.21% HTML 31.79%
browser-reload fastapi hot-reloading python arel asgi-framework

browser-hot-reloading's Introduction

Browser hot-reloading in FastAPI using arel


License: MIT

Implementaion of lightweight browser hot-reloading for Python ASGI web apps frameworks like FastAPI using arel


What is arel?

arel can be used to implement development-only hot-reload for non-Python files that are not read from disk on each request. This may include HTML templates, GraphQL schemas, cached rendered Markdown content, etc.

How does arel work?

arel watches changes over a set of files. When a file changes, arel notifies the browser (using WebSocket), and an injected client script triggers a page reload. You can register your own reload hooks for any extra server-side operations, such as reloading cached content or re-initializing other server-side resources.

Installation guide

  1. Clone the repo
git clone https://github.com/ashleymavericks/browser-hot-reloading.git
  1. Install dependencies
pipenv install

or

pip install -r requirements.txt
  1. Set environment variable in your shell instance
export DEBUG=True
  1. Verify it using
echo $DEBUG
  1. Test this implementation, and further include it in your projects for a better development experience with Python ASGI web frameworks

LICENSE

This project is licensed under the MIT license

browser-hot-reloading's People

Contributors

ashleymavericks avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.