Git Product home page Git Product logo

docker-react's People

Contributors

danielemery avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

docker-react's Issues

Invalidate environment variable file using hash

Currently when you deploy a new version of a docker-react app the browser caches the window.env.js file.

There are many ways this could be solved but the proposal I'm going with is to include a hash of the file's contents in the filename.

This will mean the index.html script tag will need to be updated each time the environment variables are changed, so this should be done as part of the npx docker-react prep command on container start.

This means this overlaps a little with #7

Add nix development flake

Include a flake.nix and lock to help developers using nix

  • Sync the version of node with the flake version
  • Also include a .nvmrc specifying the same version

Replace Joi validation with zod

zod is quickly becoming the leading option in the validation library space (when Typescript is in play).

Originally it was planned to support multiple forms of validation (rather than only Joi like now). However the complexity in providing separate Dockerfiles etc for each doesn't seem worth it.

Instead we should replace the Joi with zod and put plans to support other options (like Joi and yup) on hold until when/if the project is adoped.

Automate the project setup steps

Update the docker-react cli tool to be able to:

  • Validate that each of the project setup steps have been performed
  • Perform the project setup steps

The steps as documented in the README are:

  • Install docker-react package and validation library
  • Creating an environment variable schema
  • Importing generated environment variable file into index.html (this has some overlap with #8)
  • Creating a Dockerfile and .dockerignore
  • Updating npm scripts
  • Replacing references to build time environment variables with new window env

Basic e2e test

Single e2e test should:

  • Bootstrap a new project with vite
  • Apply all the steps in the README to the project
  • Include an example of an environment variable being used
  • Build the dependent project with it's Dockerfile
  • Start the container
  • Curl the container, validate that it serves the app and the environment variable has been correctly set

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.