![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
django_bundles is a media bundler for Django. It can be used to bundle groups of media files (e.g. CSS, JavaScript) into a single file with a hash in the filename (to play nicely with browser caching) whilst keeping the files separate during development.
There are ideas taken from a lot of the other media bundlers - none of them worked quite how I wanted and I fancied writing my own.
I think Django 1.4 is required, but possibly only because of the assignment tag decorator used.
IMPORTANT NOTE: 0.3.0 is not backwards compatible with 0.2.5
The main settings are USE_BUNDLES
which is True/False to enable/disable bundling in the template (defaults to not settings.DEBUG
), BUNDLES_VERSION_FILE
which is where versions are stored (in a python file) and BUNDLES
which looks like:
BUNDLES = (
('master_css', {
'type': 'css',
'files': (
'css/*.css',
'css/more/test3.css',
'less/test.less',
),
}),
('master_js', {
'type': 'js',
'files': (
'js/*.js',
)
}),
('script_loader_example', {
'type': 'js',
'files': (
'script_loader_example.js',
),
'processors': (
'django_bundles.processors.django_template.DjangoTemplateProcessor',
)
}),
)
All of the BUNDLES
options can be found in django_bundles/core.py on the Bundle
and BundleFile
classes.
The {% render_bundle bundle_name %}
template tag can then be used to render the HTML (e.g. script or link tag) in place. django_bundles/templates needs to be in your template directories list (or copy them in).
Other settings are (check out django_bundles/conf/default_settings.py):
DEFAULT_PREPROCESSORS
- dict of file type to list of processors (default is LessCSS for .less files)DEFAULT_POSTPROCESSORS
- dict of bundle type to list of processors (default is UglifyJS for .js bundles)If you define a BUNDLES_LINTING
setting you can use the lint_bundles
management command to lint your files. e.g.
BUNDLES_LINTING = {
'js': {
'command': '/path/to/jslint/bin/jslint.js {infile}',
'default': True,
},
}
It currently expects output like JSLint.
{% if not settings.USE_BUNDLES %}
so you don't use it in production)I think it should be pretty simple to use this with staticfiles with clever use of files_url_root
, files_root
, bundle_url_root
and bundle_file_root
as long as collectstatic
management command is run before create_bundles
in the deployment process.
FAQs
Another Django media bundler
We found that django-bundles demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.