Apostrophe 2.105 and other updates: end of Node 6 support, npm audit fixes, lean mode improvements, static i18n namespaces and more

apostrophe 2.105.0

  • Security: Node 6.x has not been supported by its creators since April 2019, and Node 8.x reached its end of support date in December 2019. As of this release of Apostrophe, we are officially acknowledging that it is not possible to maintain support for Node 6.x in Apostrophe and it is unlikely to work on that version, since both the testing frameworks on which we rely and common sub-dependencies of essential open source modules used by Apostrophe now require Node 8 at a minimum. While we will make a good-faith effort to maintain Node 8.x usability as long as possible, we expect to similarly be forced to drop Node 8 compatibility soon. Both Node 6 and Node 8 might not be safe to use for reasons entirely unrelated to Apostrophe , so you should upgrade your servers as soon as practical. Few or no code changes should be needed in Apostrophe 2.x projects. We strongly recommend moving to Node 12.x, the most up to date LTS (Long-Term Support) release of Node. In the future, we recommend becoming familiar with the Node.js release schedule so you can better plan for such upgrades.

  • Security: all of the recently new npm audit warnings were fixed. These were considered low risk according to the npm audit tool. In the process we removed dependencies on the tar and prompt modules in favor of simpler solutions with fewer moving parts.

  • Lean mode: the apos.utils.get and apos.utils.post methods no longer prepend the site’s global prefix when the call targets a different origin (another site’s API, for instance). This is a bug fix to match the behavior of $.jsonCall() which set the standard for this in Apostrophe.

  • Lean mode: apos.utils.emit(el, name, data) has been introduced. This method emits a custom DOM event with the given name and adds the properties of the data object to the event. The event is emitted on el . When emitting events with global significance, our convention is to emit them on document.body . To listen for such events one uses the standard browser method document.body.addEventListener('eventname', function(event) { ... }) .

  • Lean mode: apos.utils.get now emits an apos-before-get event with uri , data and request properties just before the request is actually sent. You may use this hook to add headers to request .

  • Cloud deployment: when starting up a site with APOS_BUNDLE=1 , the asset bundle is by default extracted to the root of the project so that the assets can be found in the filesystem of each server if needed. New feature: for the benefit of environments in which the bundle files are already present and the root of the project is not writable, APOS_EXTRACT_BUNDLE=0 may now be set to disable the extraction (note 0 , not 1 ).

  • Localization: Apostrophe’s static i18n of its user interface can now be “namespaced,” opening the door to giving your translators better guidance on whether to translate it or ignore it when working with the JSON files in the locales/ folder of your site. You can turn this on by enabling the namespaces: true option for the apostrophe-i18n module. When you do, Apostrophe’s i18n phrases will be prefaced with apostrophe<:> in the JSON files (not in the browser). You can create your own namespaced translations by calling __ns('namespacename', 'phrase') rather than __('phrase') , __ns_n rather than __n , etc. Note that if the namespaces option is not actually turned on, these new helpers are still available in templates; they just don’t prefix a namespace. The forthcoming apostrophe-static-i18n module, which allows for editing static translations as pieces, will also have an option to ignore a namespace, which is helpful if you wish to avoid showing our user interface phrases to your translation team at all.

apostrophe-workflow 2.33.0

  • Send the Apostrophe-Locale header in all Apostrophe lean mode API calls, just like we do in jQuery-based API calls. When logged out and using URL prefixes for locales, this is necessary to affect the right locale without making every single API call that any developer makes specifically locale aware, because APIs are not URL-prefixed by locale. This change fixes apostrophe-forms submissions for such locales.

apostrophe-forms 1.7.1

  • This update adds error handling to the confirmation email handler that was already on the notification email handler. The primary source of risk was if apostrophe-email was not configured with an email transport, but the forms module was configured to try to send emails.

apostrophe-multisite 2.6.1 — 2.6.3

  • In order to work around memory leaks observed in some environments during apostrophe-migrations:migrate when run with the --without-forking option, if there are more than ten sites, groups of ten at a time are run this way in a subprocess. This allows some benefit from process reuse without hitting memory limits.

  • The listDatabases mongodb command is now called with nameOnly: true to greatly improve the speed with which it returns.

1 Like