markfinger / python-react

Server-side rendering of React components
MIT License
1.62k stars 116 forks source link

Allow invalidating module cache on each request - #12 #13

Closed matthewryanscott closed 9 years ago

matthewryanscott commented 9 years ago

Useful to set to True when you have DEBUG=True.

Defaults to False.

markfinger commented 9 years ago

Cooooool, nice catch.

markfinger commented 9 years ago

There's probably a performance overhead with scrapping Node's cache of the module, but this would be pretty essential in development.

Hmm, I wonder if this works recursively. Ultimately we might need something like http://stackoverflow.com/a/14801711 which walks along and removes everything that the entry point required as well.

Might be worth calling require.resolve(...) to get the real path to the file and checking the last modified date. http://stackoverflow.com/a/7559586