Skip to content

Serve web modules via Django static files #63

@Archmonger

Description

@Archmonger

Current Situation

Currently, we serve our JavaScript web modules (JavaScript Components) via views. This is due to the fact that our current architecture does not let us know what web modules exist until runtime.

However, Django views are less efficient at serving files than a webserver such as Nginx or Apache.

Proposed Actions

Develop a way of integrating with the Django Static File system.

Work Items

We have a couple of paths we could take

  1. Create a static file finder that points to ReactPy's web modules directory
    • This is the preferred implementation if feasible
  2. Develop a collect_modules command, similar to django-compressor's collect_static command
    • This option requires changes in ReactPy to deterministically collect all JavaScript web modules during startup.
    • Also, what should we do if we accidentally did not obtain a static file during startup? Should we fallback to using our Django view, or just throw a 500: Internal Server Error?
  3. Make users put JavaScript modules in dedicated JAVASCRIPT_MODULES = [ ... ] folder(s)
    • User's will need to statically define their ReactPy JavaScript modules with this method.

See #4 for the original issue.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions