apostrophe
Advanced tools
Changelog
3.6.0 - 2021-10-13
context-editing
apostrophe admin UI bus event can now take a boolean parameter, explicitly indicating whether the user is actively typing or performing a similar active manipulation of controls right now. If a boolean parameter is not passed, the existing 1100-millisecond debounced timeout is used.modifiers
array. This is combined with the schema modifiers, allowing for finer grained control of field rendering.sk
locale to use this. Many thanks to Michael Huna for the contribution.es
locale to use this. Many thanks to Eugenio Gonzalez for the contribution.pt-BR
locale to use this. Many thanks to Pietro Rutzen for the contribution.improve
for the same module name. For example, options set by the @apostrophecms/seo-global
improvement that ships with @apostrophecms/seo
can now be overridden at project level by /modules/@apostrophecms/global/index.js
in the way one would expect.__t()
, getOptions
and other features passed to regular templates.if
option), is required, but the condition has not been met, it no longer throws a validation error.busy: true
to apos.http.post
and related methods no longer produces an error if invoked when logged out, however note that there will likely never be a UI for this when logged out, so indicate busy state in your own way.testModule
is true on the app.Changelog
3.5.0 - 2021-09-23
vue-material-design-icons
to fix apos-build.js
build error in production.self
as an argument.styles
option rather than always starting with an unclassed <p>
tag.package.json
in its root directory, the package.json
in the closest ancestor directory is consulted.css-loader
now ignores url()
in css files inside assets
so that paths are left intact, i.e. url(/images/file.svg)
will now find a static file at /public/images/file.svg
(static assets in /public
are served by express.static
). Thanks to Matic Tersek.ui/src/index.js
JavaScript code, i.e. you can write apos.alias
where alias
matches the alias
option configured for that module. Previously one had to write apos.modules['module-name']
or wait until next tick. However, note that most modules do not push any data to the browser when a user is not logged in. You can do so in a custom module by calling self.enableBrowserData('public')
from init
and implementing or extending the getBrowserData(req)
method (note that page, piece and widget types already have one, so it is important to extend in those cases).options.testModule
works properly when implementing unit tests for an npm module that is namespaced.basics
group, that field will be added to the default basics
group fields. Previously the new group would have replaced the old, leaving inherited fields in the "Ungrouped" section.block
modifier now less login-specificdef
property for specifying the default style the editor should instantiate with.area
is missing its options
property.Changelog
3.4.1 - 2021-09-13
No changes. Publishing to correctly mark the latest 3.x release as "latest" in npm.
Changelog
3.4.0 - 2021-09-13
img
tag, which ignores XSS vectors, an XSS attack might still be possible if the image were opened directly via the Apostrophe media library's convenience link for doing so. All SVG uploads are now sanitized via DOMPurify to remove XSS attack vectors. In addition, all existing SVG attachments not already validated are passed through DOMPurify during a one-time migration.apos.attachment.each
method, intended for migrations, now respects its criteria
argument. This was necessary to the above security fix.@apostrophecms/express
bodyParser.json
options that prevented adding custom options to the body parser.req.clone
consistently when creating a new req
object with a different mode or locale for localization purposes, etc.req.session
object now exists in task req
objects, for better compatibility. It has no actual persistence.localize: false
option). UI for this is under discussion, this is just a bug fix for the back end feature which already existed.apostrophe-
prefixes even if they don't have a module directory (e.g., only in app.js
).warnDev
messages with a line break and warning symbol (⚠️) to stand out in the console.apos.util.onReady
aliases apos.util.onReadyAndRefresh
for brevity. The apos.util.onReadyAndRefresh
method name will be deprecated in the next major version.trace
method from the @apostrophecms/db
module.apostrophe:modulesReady
event has been renamed apostrophe:modulesRegistered
, and the apostrophe:afterInit
event has been renamed apostrophe:ready
. This better reflects their actual roles. The old event names are accepted for backwards compatibility. See the documentation for more information.Changelog
3.3.1 - 2021-09-01
Changelog
3.3.0 - 2021-08-30
AposCellDate
, which can be optionally used in manage views of pieces. Thanks to Miro Yovchev for this fix.B
with the draft contents of locale A
.prefix
and hostname
options, which are automatically recognized by middleware that removes the prefix dynamically where appropriate and sets req.locale
. In 3.x this works more like the global site prefix
option. This is a departure from 2.x which stored the prefix directly in the slug, creating maintenance issues.prefix
or hostname
. A helpful error message is displayed if this is not the case.title
or _url
).@apostrophecms/i18n
module now uses i18next
to implement static localization. All phrases in the Vue-based admin UI are passed through i18next
via this.$t
, and i18next
is also available via req.t()
in routes and __t()
in templates. Apostrophe's own admin UI phrases are in the apostrophe
namespace for a clean separation. An array of locale codes, such as en
or fr
or en-au
, can be specified using the locales
option to the @apostrophecms/i18n
module. The first locale is the default, unless the defaultLocale
option is set. If no locales are set, the locale defaults to en
. The i18next-http-middleware
locale guesser is installed and will select an available locale if possible, otherwise it will fall back to the default.v-tooltip
has been extended as v-apos-tooltip
, which passes phrases through i18next
.data.localizations
in any page template. Each element always has locale
, label
and homePageUrl
properties. Each element also has an available
property (if true, the current context document is available in that locale), title
and a small number of other document properties are populated, and _url
redirects to the context document in that locale. The current locale is marked with current: true
.this.$t
helper provided in Vue also accepts an object argument with a key
property. Additional properties may be used for interpolation.i18next
localization JSON files can be added to the i18n
subdirectory of any module, as long as its i18n
option is set. The i18n
object may specify ns
to give an i18next
namespace, otherwise phrases are in the default namespace, used when no namespace is specified with a :
in an i18next
call. The default namespace is yours for use at project level. Multiple modules may contribute to the same namespace.APOS_DEBUG_I18N=1
is set in the environment, the i18next
debug flag is activated. For server-side translations, i.e. req.t()
and __t()
, debugging output will appear on the server console. For browser-side translations in the Vue admin UI, debugging output will appear in the browser console.APOS_SHOW_I18N=1
is set in the environment, all phrases passed through i18next
are visually marked, to make it easier to find those that didn't go through i18next
. This does not mean translations actually exist in the JSON files. For that, review the output of APOS_DEBUG_I18N=1
.req.clone(properties)
method is now available. This creates a clone of the req
object, optionally passing in an object of properties to be set. The use of req.clone
ensures the new object supports req.get
and other methods of a true req
object. This technique is mainly used to obtain a new request object with the same privileges but a different mode or locale, i.e. mode: 'published'
.req.__()
, res.__()
and __()
localization helpers, which were never official or documented in 3.x but may be in use in projects ported from 2.x. These wrappers do not localize but do output the input they are given along with a developer warning. You should migrate them to use req.t()
(in server-side javascript) or __t()
(Nunjucks templates).Changelog
3.2.0 - 2021-08-13
req.hostname
now works as expected when trustProxy: true
is passed to the @apostrophecms/express
module.modules
section of app.js
. This was always intended only as a way to load direct, intentional dependencies of your project. However, since npm "flattens" the dependency tree, dependencies of dependencies that happen to have the same name as a project-level Apostrophe module could be loaded by default, crashing the site or causing unexpected behavior. So beginning with this release, Apostrophe scans package.json
to verify an npm module is actually a dependency of the project itself before attempting to load it as an Apostrophe module.toolbarToAllowedStyles
method in the rich text widget, which was not returning any configuration.chokidar
, which Apostrophe and Nunjucks use for template refreshes. In most environments this worked anyway due to an indirect dependency via the sass
module, but for stability Apostrophe should depend directly on any npm module it uses.