Changelog History
Page 14
-
v2.92.0 Changes
June 26, 2019β Unit tests passing.
β Regression tests passing.
- π Bug fix: an open redirect vulnerability has been fixed. It was possible to convince Apostrophe to redirect to a third-party website by appending an escaped URL with a trailing slash added at the end. Apostrophe's trailing-slash remover would then cause a redirect to the un-escaped version of the slug part of the URL. The fix removes all multiple-slash sequences from the slug part of the URL. Thanks to Bharath for reporting this issue.
- π Bug fix: attempting to save a doc with a
required
array
field without ever opening the array editor formerly caused strange behavior. You now get a standard indication that the field is required. - π Feature: the method that supplies the choices for a dynamic
select
element may be a simple synchronous function, if desired. Formerly returning a promise (or using an async function) was mandatory. - π Feature:
apos.utils.post
will now accept aFormData
object as thedata
prameter. In this situation JSON encoding is not used. This may be used to easily submit file uploads with Apostrophe's CSRF protection and is supported at least back to IE11.
-
v2.91.1 Changes
June 05, 2019β Unit tests passing.
β Regression tests passing.
- π Bug fix: the
apos.utils.post
method introduced in version 2.90.0 now correctly submits the CSRF header.
- π Bug fix: the
-
v2.91.0 Changes
June 05, 2019- Feature: it is much easier to write sites with no jQuery, lodash, etc. on the front end. The
apostrophe-lean-frontend
module has been deprecated and its functionality has been merged into the core. All of the functionality of theapos.lean
object is now available on theapos.utils
object at all times. And if you set thelean: true
option for theapostrophe-assets
module, only lean JavaScript is pushed when logged out (assets pushed withwhen: 'lean'
, including the lean methods ofapos.utils
). This creates a migration path to a leaner frontend: developers can write NPM modules that rely only the leanapos.utils
methods without worrying about whether they are present or not. Note that this is also the official frontend library for the forthcoming Apostrophe 3.x (Of course, as always, you can choose to push more code, use webpack, etc.) - π Bug fix: a regression introduced in 2.90.0 caused all uses of "Copy Page" to copy the home page. This is fixed.
- π Bug fix: copying a page with custom fields now copies those fields properly.
- π Bug fix: "Copy Page" now correctly copies parked page fields to the new, unparked page and then allows them to be edited for the new page.
- π Bug fix: addressed browser errors that occurred when using an empty rich text toolbar. Unfortunately it is not possible to completely eliminate the ckeditor 4 toolbar when there are no tools present. This is due to a ckeditor bug.
π Thanks to Michelin for making much of this work possible via Apostrophe Enterprise Support.
- Feature: it is much easier to write sites with no jQuery, lodash, etc. on the front end. The
-
v2.90.0 Changes
May 23, 2019β Unit tests passing.
β Regression tests passing.
- New feature:
select
schema fields now support dynamic choices. To use this feature, setchoices
to the name of a method of your module. Apostrophe will invoke that method on the fly to get the choices. Your method receives(req)
and must return an array of choices. Your method can be anasync
function, or return a promise for the choices array. This means you can contact external APIs to obtain the choices. The choices array is in the same format as ever (objects withlabel
andvalue
properties). Note that if you just want to choose Apostrophe objects of various types, there is a better way: usejoinByOne
orjoinByArray
fields. Fields with dynamic choices do not support theshowFields
option. - π New feature:
checkboxes
schema fields also support dynamic choices. The syntax is exactly the same as above. This allows multiple selection. - New feature: any
select
orcheckboxes
field in the schema of a widget can be moved to a compact select element that appears "in context" on the page, among the widget's controls. To do that, just setwidgetControls: true
in the schema field definition. If you wish, you can also setcontextual: true
so that the field no longer appears in the schema's editing dialog box. By default the field appears in both places. For space reasons, the interface forcheckboxes
is also powered by a select element, but you can add multiple choices by selecting the dropdown more than once. Each time you make a change via one of these fields, the widget is refreshed to show the impact of the change. You may use dynamic choices as described above. - π New feature: the
viewsFolderFallback
option toapostrophe-templates
may now be an array. Thanks to Amin Shazrin. - π New feature: help has been added to the video widget explaining that what is needed is a URL to a YouTube or other oEmbed-friendly video.
- π New feature: you may now specify
htmlHelp
as a schema field option if you want to include simple markup, like links. The existinghelp
option expects plaintext and escapes accordingly. - π New feature: the
req
objects returned byapos.tasks.getReq
andapos.tasks.getAnonReq
now include asession
object for broader compatibility with methods that expect a properreq
. It is a plain object and does not remember anything beyond the lifetime of thereq
. - π Bug fix: copying the "Home" page works properly.
- π Bug fix: the Apostrophe migrations progress meter no longer crashes if the operation reports more steps than the expected total.
- π Bug fix: watch all inlined stylesheets for changes, not just those implicitly inlined due to the use of the
css
extension when pushing them. - π Bug fix: improved clearing of tooltips. Addresses various situations where a tooltip could linger on the screen.
- β Developer warnings: warning at startup if your module tries to use "extends" rather than "extend" to extend another module.
- π± Developer warnings: warning at startup if your module attempts to "extend"
apostrophe-assets
or one of a few other core modules that are normally singletons, and probably should not ever have a competing instance under another name. Advice is given to write project level code for the module withoutextend
, or to useimprove
when enhancing it via an npm module.
- New feature:
-
v2.89.1 Changes
May 13, 2019β Unit tests passing.
β Regression tests passing.
getSchemaOptions
method no longer throws inappropriate errors when the alternate form ofapos.area
orapos.singleton
is used. Bug introduced in 2.89.0.- The CSRF cookie is once again always reset on each request, to ensure no discrepancy between the session (and session cookie) lifespan and the CSRF cookie lifespan. This does not force sessions to exist unnecessarily, it just ensures CSRF errors do not mysteriously begin to appear in long-idle sessions, or when making cross-domain locale switches via the editing interface in apostrophe-workflow.
- π± Edits to raw .css files once again trigger less-middleware to recognize a change has occurred and avoid sending a stale cached file in development. When
.css
(rather than.less
) assets are pushed inline, which is necessary to match the behavior we formerly received from clean-css and avoid crashes on CSS that the LESS parser cannot handle, we now monitor them for changes ourselves and "touch" the master LESS file to help theless-middleware
module figure out that they have been changed.
π Thanks to Michelin for making this work possible via Apostrophe Enterprise Support. Your organization can also take advantage of the opportunity to fund development of the features you would like to see as well as receiving fast, personal support from Apostrophe's core development team.
-
v2.89.0 Changes
May 01, 2019β Unit tests passing.
β Regression tests passing.
- Many significant improvements to make crashes and restarts less likely.
- The most frequently used methods now sanity-check their arguments and invoke their callback, or as appropriate, if they are not valid. This replaces many full-process crashes with polite 500 errors.
- π New, safer and easier alternatives to
self.route
:self.apiRoute
, which accepts anext
function that can be passed either an error, or(null, value)
, wherevalue
is an object to be sent to the browser with astatus: 'ok'
property automatically added β the convention for APIs in Apostrophe 2.x. In addition, errors reported tonext
are converted tostatus
properties and/or logged gracefully, including more complete information about where the error took place for easier debugging. Most core routes have been refactored to use it. This approach extends Express 4.0's concept of error handlers with the ability to handle success as well. You can still useres
if you need to, for instance to issue a redirect.self.renderRoute
, which accepts anext
function that can be passed either an error that will be mapped to an appropriate HTTP status code, or(null, { template: 'templateName', data: { ... props for the template ... })
. The named template is rendered withself.render
, and any exceptions thrown are caught properly and logged as errors without a process crash β unlike what frequently happened before in such routes.self.htmlRoute
, similar to renderRoute but it does not render the markup for you; instead you pass markup as the second argument tonext()
. Useful if you are rendering by some means other thanself.render
.
- π For template errors, a great deal of redundant error logging has been removed.
- π¨ Introduced
apos.utils.warnDevOnce
, refactored some existing warnings to use it, and added a call for CSRF errors to help developers understand what these mean. - New trace feature to help debug crashes in Apostrophe's startup process. Try:
APOS_TRACE_STARTUP=1 node app
π Thanks to Michelin for making this work possible via Apostrophe Enterprise Support. Your organization can also take advantage of the opportunity to fund development of the features you would like to see as well as receiving fast, personal support from Apostrophe's core development team.
-
v2.88.1 Changes
April 25, 2019β Unit tests passing.
β Regression tests passing.
- π Fix: widgets are not lost when dragged to a different area.
- π Fix: widgets are not duplicated when dragged to a different area.
- π Fix: area save operations now use a lock to avoid lost information if several requests are made simultaneously for different areas, as can happen when dragging a widget between areas, which modifies both.
- π Fix: widgets can be edited again after being dragged, without a page refresh.
- π Fix: the "purple screen of death" error page now has a 500 status code, not 200.
-
v2.88.0 Changes
April 23, 2019β Unit tests passing.
β Regression tests passing.
- 0οΈβ£ An optional improvement to eliminate the use of session storage for most site visitors. By default, Apostrophe creates a session for every site visitor, even an anonymous visitor, to provide full CSRF protection. You may now optionally disable this for anonymous visitors:
modules: { 'apostrophe-express': { csrf: { disableAnonSession: true } } }
When you do this, anonymous visitors receive only basic CSRF protection based on a known header value and the fact that the Same Origin Policy does not allow requests to be made by JavaScript unless the page is on the proper site.
π For performance reasons the largest sites will likely find this to be a valuable option.
π
apos.global.findGlobal
now officially supports returning a promise. This was an unofficial side effect in earlier releases that ceased to work in recent releases.π Updated the version of
moment
that ships on the front end to the latest minor release.β Eliminated unnecessary arrangeFields warnings.
apostrophe-groups
is set up properly, thetrash
field no longer generates warnings when workflow is active, and reverse joins no longer generate warnings as they have no editing UI.π
null
values were able to crash the schema converters for strings, integers and floats when those fields wererequired
. This has been fixed.
-
v2.87.0 Changes
April 10, 2019β Unit tests passing.
β Regression tests passing.
- π― Tooltips have been added to improve the editor experience. For instance, tooltips appear on hover for the "up," "down," "clone" and "trash" buttons when working with areas.
- Building on the performance work in version 2.86.0, all
ensureIndex
calls have been moved to themigrate
startup phase and can thus be skipped withAPOS_NO_MIGRATE=1
. Note that as with the other recent changes, this means that if your site is always run withAPOS_NO_MIGRATE=1
, including at the time the database is created, it is imperative that you runnode app apostrophe-migrations:migrate
at least once. If your database starts out in a dev environment and is later moved to a production environment, or you use stagecoach or a similar deployment tool that guarantees migrations are run on all code deployments (and you should definitely do that), then this will not be an issue. - π Building on the support for namespaced npm modules as apostrophe modules added in 2.86.0, the
testModule: true
flag used to test apostrophe in the context of an npm module likeapostrophe-workflow
can now be used in a namespaced npm module. Thanks to AurΓ©lien Wolz for this contribution.
π Thanks to Michelin for making much of this work possible through Apostrophe Enterprise Support.
-
v2.86.0 Changes
April 03, 2019β Unit tests passing.
β Regression tests passing.
- π§ Apostrophe now supports namespaced NPM modules as apostrophe modules. This allows NPM private modules to be used to deliver, for instance, an apostrophe piece type, page type or widget type. Here is an example of valid configuration:
require('apostrophe', { modules: { // ordinary npm module 'apostrophe-blog': {}, // namespaced npm module '@somenamespace/somemodule': {} } }
// in lib/modules/@somenamespace/somemodule/index.js module.exports = { nifty: true };
- π In addition, modules may be namespaced NPM-style inside a bundle. You will need to use a subdirectory structure, as seen above. As a best practice, you should only use this for module names you would have to publish to npm if the bundle feature did not exist. The "lead module" of the bundle should be in the same npm namespace.
- If you are using the
partial
feature ofaddColumn
with your pieces, you can now acceptpiece
as a second argument. For bc, the value of that particular column property is still the first argument. - β¬οΈ All of Apostrophe's "sanity-checking" database operations at startup, plus all Apostrophe migrations, now execute during a new
migrate
startup phase. This phase emits theapostrophe:migrate
promise event. This phase occurs immediately afterafterInit
is invoked for modules, but before it is invoked for the globalafterInit
hook, if any. This change ensures there is a "sane" database before any interaction with the site takes place, and means that developers no longer have to remember to runapostrophe-migrations:migrate
when upgrading during development. - You can also suppress these database operations at startup completely by setting the
APOS_NO_MIGRATE
environment variable to1
, or by passing themigrate: false
top-level option to Apostrophe. In this case, these operations all occur only when theapostrophe-migrations:migrate
command line task is run. This option saves a great deal of startup time for the enterprise customers with the largest databases. Thus the best practice in production is the same as ever: runnode app apostrophe-migrations:migrate
before launching the new version of the app. In addition, you may setAPOS_NO_MIGRATE=1
in your production environment to save valuable startup time, especially during process restarts, etc. - Apostrophe now always instructs
less
to import CSS (not LESS) filesinline
. This is necessary because CleanCSS, which we no longer use, formerly automatically did it and without it import paths are incorrect. Thanks to Fredrik Ekelund for this fix. - π UX improvement: if you edit a page, then follow a link from that page, and then click the "back" button, you should see your changes intact without the need to click "Refresh" thanks to the use of cachebusting headers. Thanks to Fredrik Ekelund for recommending an approach to the problem.
- π Bug fix: if your site startup or migration task invokes multiple time-consuming operations you'll now see a progress meter for each one, not just the first.
- β To save space and make sure developers don't just tune out, the warning about fields not properly arranged into tabs now appears at startup just for the first such module, unless you pass
--all-unarranged-fields
to get more information.
π Thanks to Michelin for making many of these features possible through Apostrophe Enterprise Support.