None
- Removes some unnecessary media that affecting package size PR #8943
- Fixes webpack compiler issue about not being able to find arches-core webpack config #8958
- Removes
webpack/webpack-meta-confg.jsandwebpack/webpack-user-config.jsand instead configures webpack viasettings.py#8958 - Improves performance of
ResourceXResourceinstance management #8974 - Other small improvements to the user interface and error messaging
Python:
Upgraded:
None
Added:
None
JavaScript:
Upgraded:
None
Added:
None
webpack/webpack-meta-confg.jsandwebpack/webpack-user-config.jshave been removed in favor of configuring webpack viasettings.py
-
You must be upgraded to version 7.0.0 before proceeding. If you are on an earlier version, please skip to Upgrading Arches :: If upgrading from version 6.1.x
-
Be sure to backup your database before proceeding.
-
Upgrade to Arches 7.1.0
pip install --upgrade arches
-
You must be upgraded to at least version 6.1.0 before proceeding.
-
Remove django-revproxy
pip uninstall django-revproxy -
Be sure to backup your database before proceeding.
-
Upgrade to Arches 7.1.0
pip install --upgrade arches -
Important: If you are maintaining an Arches package, be sure to export your graphs and resource instance data before re-importing or reloading your package.
-
Elasticsearch 8 (ES 8) enables a feature called xpack security by default. See the elasticsearch 8 documentation for details on the new features and how you can use them to secure your elasticsearch instance.
- By default, xpack security turns on SSL with a self-signed certificate and will expect requests to come from an ES user. Elasticsearch users can be created via the elasticsearch-users command. Uncomment and override
ELASTICSEARCH_CONNECTION_OPTIONSinsettings.pyline as needed (with an appropriate password and certificate settings) in your project settings or settings_local files. - If you choose to turn off xpack security in your ES 8 instance (not recommended) you will need to override the
ELASTICSEARCH_HOSTSsetting and change the scheme to "http".
- By default, xpack security turns on SSL with a self-signed certificate and will expect requests to come from an ES user. Elasticsearch users can be created via the elasticsearch-users command. Uncomment and override
-
Your project must be upgraded to version 7.0.0 before proceeding. If you are on an earlier version, please skip to Upgrading an Arches Project :: If upgrading from version 6.1.x:
-
Be sure to backup your database before proceeding.
-
In your project's
settings.pyfile:- ensure
STATIC_URLhas a valid value - ensure
APP_ROOThas a valid value - update the
package_settingsandsettings_localimport blocks:# 7.0.0 try: from .package_settings import * except ImportError: pass try: from .settings_local import * except ImportError: pass# 7.1.0 try: from .package_settings import * except ImportError: try: from package_settings import * except ImportError as e: pass try: from .settings_local import * except ImportError as e: try: from settings_local import * except ImportError as e: pass - add a return to the bottom of the file that NODEJS can parse:
if __name__ == "__main__": print( json.dumps({ 'ARCHES_NAMESPACE_FOR_DATA_EXPORT': ARCHES_NAMESPACE_FOR_DATA_EXPORT, 'STATIC_URL': STATIC_URL, 'ROOT_DIR': ROOT_DIR, 'APP_ROOT': APP_ROOT, 'WEBPACK_DEVELOPMENT_SERVER_PORT': WEBPACK_DEVELOPMENT_SERVER_PORT, }) ) sys.stdout.flush() - ( optional ) by default
ARCHES_NAMESPACE_FOR_DATA_EXPORTis assigned the value"http://localhost:8000/". If running your Django server elsewhere, overwriteARCHES_NAMESPACE_FOR_DATA_EXPORTin your project'ssettings.pyfile. - ( optional ) by default
WEBPACK_DEVELOPMENT_SERVER_PORTis assigned the value9000. If you want the webpack server to run on a different port, overwriteWEBPACK_DEVELOPMENT_SERVER_PORTin your project'ssettings.pyfile.
- ensure
-
Within your project, with your Python 3 virtual environment activated:
python manage.py migrate python manage.py updateprojectNOTE: Running
python manage.py updateprojectwill delete yourwebpackdirectory and replace it with an updated version from arches-core. -
If you have any project-level JavaScript dependencies, ensure they are aliased correctly in
webpack/webpack-node-modules-aliases.js -
Start your application server.
-
In a seperate terminal with your Python 3 virtual environment activated, navigate to the root directory of the project ( you should be on the same level as
package.json)- run
yarn, this will install updated frontend dependencies in/media/node_modules. - run
yarn build_developmentoryarn_start. This will regenerate yourmedia/builddirectory.yarn build_developmentwill build a development bundle for the frontend assests of the application -- this should complete in less than 2 minutesyarn startwill build the frontend of the application and then start a webpack development server
- run
-
If you are running Arches on Apache, be sure to run:
python manage.py build_productionand restart your server.
sudo service apache2 reload -
Finally, If you are running Celery, you should also restart your Celery worker(s). The process for doing this depends on how Celery is being run.
-
Be sure to backup your database before proceeding.
-
in your project's
settings.pyfile:MOBILE_OAUTH_CLIENT_IDmust be renamed toOAUTH_CLIENT_ID- ensure
webpack_loaderhas been added toINSTALLED_APPS - ensure
APP_NAMEandARCHES_NAMESPACE_FOR_DATA_EXPORThave been defined - ensure the following attributes exist in the file:
STATIC_ROOT = os.path.join(ROOT_DIR, "staticfiles")STATIC_URL = "/static/"STATICFILES_DIRS = ( os.path.join(APP_ROOT, 'media', 'build'), os.path.join(APP_ROOT, 'media'), ) + STATICFILES_DIRSWEBPACK_LOADER = { "DEFAULT": { "STATS_FILE": os.path.join(APP_ROOT, "webpack/webpack-stats.json"), }, } - ensure
STATIC_URLhas a valid value - ensure
APP_ROOThas a valid value - update the
package_settingsandsettings_localimport blocks:# 7.0.0 try: from .package_settings import * except ImportError: pass try: from .settings_local import * except ImportError: pass# 7.1.0 try: from .package_settings import * except ImportError: try: from package_settings import * except ImportError as e: pass try: from .settings_local import * except ImportError as e: try: from settings_local import * except ImportError as e: pass - add a return to the bottom of the file that NODEJS can parse:
if __name__ == "__main__": print( json.dumps({ 'ARCHES_NAMESPACE_FOR_DATA_EXPORT': ARCHES_NAMESPACE_FOR_DATA_EXPORT, 'STATIC_URL': STATIC_URL, 'ROOT_DIR': ROOT_DIR, 'APP_ROOT': APP_ROOT, 'WEBPACK_DEVELOPMENT_SERVER_PORT': WEBPACK_DEVELOPMENT_SERVER_PORT, }) ) sys.stdout.flush() - ( optional ) By default
ARCHES_NAMESPACE_FOR_DATA_EXPORTis assigned the value"http://localhost:8000/". If running your Django server elsewhere, overwriteARCHES_NAMESPACE_FOR_DATA_EXPORTin your project'ssettings.pyfile. - ( optional ) By default
WEBPACK_DEVELOPMENT_SERVER_PORTis assigned the value9000. If you want the webpack server to run on a different port, overwriteWEBPACK_DEVELOPMENT_SERVER_PORTin your project'ssettings.pyfile.
-
Within your project with your Python 3 virtual environment activated:
python manage.py migrate python manage.py es reindex_database -
If you have not yet run
python manage.py updateproject, do so now. It will create a/webpack/directory in your project and copy over the webpack configuration files from arches core. -
If you have any project-level JavaScript dependencies, ensure they are aliased correctly in
webpack/webpack-node-modules-aliases.js. -
Copy
.eslintrc.js,.eslintignore,.babelrc,.browserslistrcand.stylelintrc.jsonfrom arches-core to your project directory. -
Update the project's
.gitignorefile to include:my_project/staticfiles my_project/webpack/webpack-stats.json node_modules -
Update the contents of
.yarnrcto referencenode_modulesinstead ofpackages:--install.modules-folder "./media/node_modules" --add.modules-folder "./media/node_modules" -
The project's
package.jsonfile will need to be manually updated to includedevDependenciesand updated yarnscripts. It should contain the followingscriptsobject anddevDependenciesobject:"scripts": { "build_production": "NODE_PATH=./media/node_modules NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production ./media/node_modules/.bin/webpack --config webpack/webpack.config.prod.js", "build_development": "NODE_PATH=./media/node_modules NODE_OPTIONS=--max_old_space_size=8192 ./media/node_modules/.bin/webpack --config webpack/webpack.config.dev.js", "build_test": "NODE_PATH=./media/node_modules NODE_OPTIONS=--max_old_space_size=8192 ./media/node_modules/.bin/webpack --config webpack/webpack.config.dev.js --env test=true", "start": "NODE_PATH=./media/node_modules NODE_OPTIONS=--max_old_space_size=8192 ./media/node_modules/.bin/webpack serve --config webpack/webpack.config.dev.js" },"devDependencies": { "arches-dev-dependencies": "archesproject/arches-dev-dependencies#dev/7.1.x" }, -
Update the templates in your project:
- If a template is using the
{% load staticfiles %}template tag, it must be updated to{% load static %} - If a template is using the
{% static '/path/to/file' %}template tag, it must be updated to{% webpack_static '/path/to/file' %}- Be sure to include
{% load webpack_static from webpack_loader %}at the top of any template where this change is made
- Be sure to include
- If a template is using the
-
The pattern used for JavaScript component template dependencies has changed, and any project components must be updated as well. Consider the following example with our
reports/default.jscomponent:# dev/6.2.x define(['knockout', 'viewmodels/report'], function(ko, ReportViewModel) { return ko.components.register('default-report', { viewModel: function(params) { params.configKeys = []; ReportViewModel.apply(this, [params]); }, template: { require: 'text!report-templates/default' } }); });# dev/7.1.x define(['knockout', 'viewmodels/report' 'templates/views/report-templates/default.htm'], function(ko, ReportViewModel, defaultReportTemplate) { return ko.components.register('default-report', { viewModel: function(params) { params.configKeys = []; ReportViewModel.apply(this, [params]); }, template: defaultReportTemplate }); }); -
(optional) If internationalization is important to your project, strings in component templates (eg. any template that is a dependency of a JavaScript file) should be moved to
javascript.htmand added as a key-value pair to anarches-translationsHTML object. You must then update your component template to use the new string:# my_project/my_project/templates/javascript.htm {% extends "javascript.htm" %} {% load static %} {% load l10n %} {% load i18n %} {% block arches_translations %} <div class='arches-translations' my-key-name='{% trans "My key value." as myKeyValue %} "{{ myKeyValue|escapejs }}"' ></div> {% endblock arches_translations %}# my_project/my_project/templates/path/to/component.htm <span data-bind="text: $root.translations.textKeyOnArchesTranslationObject"></span> # OR <select data-bind="placeholder: $root.translations.textKeyOnArchesTranslationObject" ></select> # OR <input data-bind="attr:{placeholder: $root.translations.textKeyOnArchesTranslationObject}></input>Note: Keys added to the
arches-translationsHTML object should be dash-delineated, eg.my-key-name. When referenced in a component template, the key should be camelcase instead, eg.myKeyName. -
Update the project's
index.htm/packagereferences to/node_modulesreferences, along with any other references to/media/packaagesin your codebase. -
Start your application server.
-
In a seperate terminal, navigate to the root directory of the project ( you should be on the same level as
package.json)- manually remove the
yarn.lockfile, eg.rm yarn.lock - run
yarn, this will install updated frontend dependencies in/media/node_modules. - (optional) You can remove
/media/packages
- manually remove the
-
In the same terminal window where you ran
yarn, activate your Python 3 virtual environment and runyarn build_developmentoryarn_start. This will generate yourmedia/builddirectory.yarn build_developmentwill build a development bundle for the frontend assests of the application -- this should complete in less than 2 minutesyarn startwill build the frontend of the application and then start a webpack development server
-
If you are running Arches on Apache, be sure to run:
python manage.py build_productionand restart your server.
sudo service apache2 reload -
Finally, If you are running Celery, you should also restart your Celery worker(s). The process for doing this depends on how Celery is being run.