pushkin-consortium / pushkin-cli

A CLI designed to facilitate the setup process of a Pushkin stack
MIT License
0 stars 4 forks source link

Avoid unnecessary recompilation of experiments.js #69

Closed jkhartshorne closed 4 years ago

jkhartshorne commented 4 years ago

Every tie pushkin prep is run, experiments.js gets rewritten. This is to ensure that any changes to an experiment's config file are propagated. The downside is that this necessarily results in rebuilding the server (front-end), which triggers recopying the front-end to Docker during docker build.

This is probably OK most of the time, because usually you'll be running pushkin prep because you have changed or updated the front-end (either an experiment web page or the core front end). However, there are some cases where it's completely unnecessary -- Namely, any time the changes are confined to

As of v1, the CLI is a lot faster, so this isn't the end of the world. But time saved is time saved. So as a lowish priority, I suggest figuring out how to rewrite. This could either involve:

  1. Checking whether experiments.js needs to change
  2. Constaining experiments.js to a simple list of experiments similar to the controllers list, and thus wouldn't need updating. All the config information would be included directly in the experiment node packages and read from there ... somehow.
jkhartshorne commented 4 years ago

Actually, there is a crazy-easy solution to this: move experiments.js out of the src folder. I'll see if I can get to that today.