-
Notifications
You must be signed in to change notification settings - Fork 340
Readme revamp #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Readme revamp #298
Conversation
README.md
Outdated
```javascript | ||
new BundleTracker({filename: './webpack-stats.json'}) | ||
``` | ||
During development, when files change a lot, we want to always poll for the updated files (in our case, we'll fetch the files every 0.1s, as defined on `POLL_INTERVAL`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
POLL_INTERVAL
is ignored when CACHE
is True
? If so, please clarify here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this section with more explanation
django-webpack-loader/README.md
Lines 86 to 92 in 1609967
For that setup, we're using the `DEBUG` variable provided by Django when bootstraping a new project. Since in a production environment (`DEBUG = False`) the assets files won't constantly change, we can safely cache the results (`CACHE=True`) and optimize our flow, as `django-webpack-loader` will read the stats file only once and store the assets files paths in memory. From that point pnwards, it will use these stored paths as the source of truth. If `CACHE=False`, we'll always read the stats file to get the assets paths. | |
> If `CACHE=True`, any changes made in the assets files will only be read when the web workers are restarted. | |
During development, when the stats file changes a lot, we want to always poll for its updated version (in our case, we'll fetch it every 0.1s, as defined on `POLL_INTERVAL`). | |
> In production (`DEBUG=False`), we'll only fetch the stats file once, so `POLL_INTERVAL` is ignored. | |
While `CACHE` isn't directly related to `POLL_INTERVAL`, it's interesting to keep `CACHE` binded to the `DEBUG` logic value (in this case, the negation of the logic value) in order to only cache the assets in production, as we'd not continuously poll the stats file in that environment. |
@@ -278,105 +171,8 @@ The `is_preload=True` option in the `render_bundle` template tag can be used to | |||
</html> | |||
``` | |||
|
|||
### Skipping the generation of multiple common chunks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth including this again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was moved to here (the section title changed) https://github.com/django-webpack/django-webpack-loader/pull/298/files/b1b517f29d7ae36a44054e925d68e2426ab0c839#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R196
</head> | ||
``` | ||
|
||
### File URLs instead of html tags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this still exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, re-added this section to the readme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks a lot for this! I tried the tutorial linked in the README a few months ago, but I couldn't get it working. I'll give it a shot following the new README. |
Closes #282
Closes #275
Closes #277