Fotis, thanks for this really thoughtful response!
Rather than try to respond to everything right now, I just want to say
that I'm going to refer to your email as we do some final tweaks of
the documentation for launch... which is impending (as in, perhaps
Friday)... but, 2.0.0 has resolved a lot of these concerns, and many
of the rest will be resolved by writing more documentation. An ongoing
process beyond the day we type "npm publish" on 2.0.0, for sure.
A few of your burning questions though...
* Longevity
Thanks, this is hugely important to clarify.
1. Yes, 2.0.0 is a bc break for code. New code is needed. But it's
ever so much nicer, and the nice patterns that were stuck inside 0.5,
begging to be released, are now on the surface (:
We didn't throw out concepts like areas and widgets, and "snippets"
were renamed pieces but are otherwise very similar — just, again, much
more elegant.
As you work with it you'll see that it is very much Apostrophe,
liberated from its own cruft — it's radically better, but not
radically different in kind.
2. There WILL be a content migration path from 0.5 to 2.0.0. There
isn't, yet, but we have over 70 clients on 0.5. We WILL write that
task, and quite soon! It just makes sense for now to shake things down
in 2.0.0 with new projects.
3. 2.0.0 is a LONG TERM SUPPORT release. We will stand behind this
release for a *minimum* of 3 years. And when you read that, keep in
mind that in actuality, we are still supporting customers who have
versions of Apostrophe from before 1.0. (:
We approached 2.0.0 as a year-long project and a series of
pair-programming sprints because we wanted a product we would be happy
to support for the long term.
That being said... we are going to follow semantic versioning after
2.0.0 is published. So, we might have to release "3.0.0" or even
"4.0.0" relatively soon, just because of the tiniest bc break that
everyone agrees is obvious and good! That's just how semantic
versioning works. It does not mean that we are making radical changes
or will not stand behind 2.0.0.
* `data` is the new `extras`. Boom. (: Add stuff to `req.data`, it
shows up on the `data` object in Nunjucks. Note this means that
everything you add is a property of `data` rather than being "by
itself" in Nunjucks. Our frontend team made this choice because it
means you can `apos.log(data)`, and because it namespaces things
nicely: `apos` contains Apostrophe helpers, while `data` contains
"your stuff" (including things Apostrophe gives you, like
`
data.page`).
* outerLayout is actually a normal template now, extended in a normal
nunjucks way, although you extend "data.outerLayout" to give
Apostrophe a chance to substitute the ajax refresh layout instead.
This means that you can override blocks normally at last! There are no
special case "whoops you're not allowed to override that" sections in
2.0.0.
And we created an "outerLayoutBase" template so you can override
blocks selectively in an "outerLayout.html" in your own
"apostrophe-templates" module.
But, you often won't need to, because the only stuff in outerLayout at
this point is our admin UI and asset delivery. (OK, you might need to
and that's why we've made it easier if you do need to.)
* "What if a module provides multiple features and not only widgets or
is this not possible anymore?" Yes, it's one module per job now...
but, you can "bundle" several Apostrophe modules in a single npm
module thanks to moog-require. Check out:
https://github.com/punkave/apostrophe-blog/tree/unstable
This allows you to pack up a pieces module, a pieces-widgets module
and a pieces-pages module to be distributed together in npm under one
sensible name. The developer currently has to specify that they are
using the bundle in their Apostrophe config object:
```
bundles: ['apostrophe-blog']
```
This requirement may go away in the future.
* "How can we have a default pieces widget value, like specifying
'all' by default?"
I assume you mean from a template and not just globally for that
widget type. This is a good idea and a frequent internal request so
it's likely to be a postlaunch feature before long.
* 404 for a link to the pieces API
We need to mop up a bunch of guesses we made before actually
generating the reference docs.
See:
http://unstable.apostrophenow.org/reference/apostrophe-pieces/
* Identity Crisis
This was a big problem in 0.4/0.5 because... reasons which are too
boring and historical to go into (:
With 2.0.0... the Apostrophe module is "a CMS platform" enabling you
to build a website with a nice CMS and any custom functionality you
wish.
So the apos object you create with it is... *your website*. Boom!
There is no "apostrophe-site" module thrown in later to glue it all together (:
Your "platform" option is definitely more accurate for Apostrophe.
In-house we use extremely stripped-down boilerplate for each new
project.
The new tutorials start "from scratch" to show how easy that is, but
also because that's who Apostrophe, the open source CMS framework, is
for: web developers who want to go beyond a sandbox site. And do it in
Node. With all the performance benefits and the joy of not switching
languages constantly between front and back end.
* Terminology
Oh, don't we know it. Which is why this is SO much better in 2.0.0.
You really should dive in. (:
Some key modules to read about:
apostrophe-module (this is the base class of ALL modules, anything it
can do, any module can do out of the box)
apostrophe-pieces
apostrophe-custom-pages (all regular "page" types extend this,
automatically if not directly)
apostrophe-doc-type-manager (rarely used directly, but -pieces and
-custom-pages both extend this)
Also apostrophe-docs, which provides the low-level guts for
manipulating all docs in the aposDocs collection and lets you get in
touch with the best module (to manage a particular doc, if you have a
mixed bag of them for some reason:
```
apos.docs.getManager(doc.type)
```
Cursors are another important read. The `find` methods of the pieces,
custom-pages, etc. modules all return cursors, which are like mongo
cursors but extensible and very flexible:
http://unstable.apostrophenow.org/reference/apostrophe-docs/server-apostrophe-cursor.html
* Extensibility, Modifiability
Too big to just pop off an email response, but these are vastly better
in 2.0.0. These things you want to do, you can do them. (: Check out
the apostrophe-pieces API reference; it's easy to extend any of those
methods with the super pattern, which you're familiar with.
The improved chooser for picking things? We did that. (: You get to
click "Browse" and use the "manage" modal for that piece type as a
full-powered chooser. The columns of the list view are configurable,
the sorts are configurable, it's very cool. And we need to document it
more, more, more.
Also all that gross "boilerplate" for a new module, or a module that
extends another, is just gone.
lib/modules/products/index.js can look like:
```javascript
module.exports = {
extend: 'apostrophe-pieces',
name: 'product',
label: 'Product',
construct: function(self, options) {
// Override some methods, use the super pattern like always
}
};
```
All the browser-side code works much the same way.
To get a sense check out this recent HOWTO:
http://unstable.apostrophenow.org/howtos/extending-the-pieces-editor-modal.html
* Intrusiveness
We cut this way back. Fewer unnecessary divs, no weirdness like
apos-center still floating around.
All the modules follow the same pattern, all the widget types come
from a module, overriding widget.html works the same for all of them.
* * *
Fotis, I hope this response is helpful and eases both your mind and
those of other A2 developers. We hear you and we're grateful for such
a thoughtful and detailed response.
Now... go check out 2.0.0 (:
unstable.apostrophenow.org
>> email to
apostrophecm...@googlegroups.com.
> --
> You received this message because you are subscribed to the Google Groups
> "apostrophenow" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
apostropheno...@googlegroups.com.
--
THOMAS BOUTELL, SUPPORT LEAD
P'UNK AVENUE |
(215) 755-1330 |
punkave.com