Skip to content

Commit e44f3e7

Browse files
committed
adds migration guide and updates changelog again
1 parent b2368e7 commit e44f3e7

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Space.Object.extend('CustomClass', { mixin: [FirstMixin, SecondMixin] });
4141
4242
- Many bugfixes and improvements related to `Space.Module` lifecycle hooks.
4343
Previous hooks like `onStart` and `onConfigure` have been replaced with a complete
44-
lifecycle split into three main phases: `initialize`, `configure`, `start`. Each
44+
lifecycle split into three main phases: `initialize`, `start`, `reset`. Each
4545
with `on`, `before` and `after` hooks like `onInitialize` / `afterStart` etc.
4646
4747
- Refactored all core api properties like `Dependencies`, `RequiredModules`,

README.md

+44
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,50 @@ ndicator that it is doing too much.
339339
Look through the tests of this package to see all
340340
features that `space:base` provides for you.
341341

342+
## Migration Guide
343+
344+
### 3.2.1 → 4.0.0
345+
346+
The 4.0.0 release has brought many small breaking changes and improvements.
347+
348+
#### Lowercase API properties
349+
350+
All api properties, *significant* to the framework are now like "normal" properties:
351+
```javascript
352+
Space.Module.define('My.CustomModule', {
353+
requiredModules: ['My.OtherModule'], // instead of RequiredModules
354+
singletons: ['My.OtherModule'], // instead of Singletons
355+
})
356+
Space.Object.extend('My.CustomClass', {
357+
dependencies: { /**/ } // instead of Dependencies
358+
})
359+
```
360+
361+
#### Module Lifecycle Changes
362+
363+
Previous hooks like `onStart` and `onConfigure` have been replaced with a complete
364+
lifecycle split into three main phases: `initialize`, `start`, `reset`. Each
365+
with `on`, `before` and `after` hooks like `onInitialize` / `afterStart` etc.
366+
367+
```javascript
368+
Space.Module.define('My.CustomModule', {
369+
onInitialize() {} // instead of "onConfigure"
370+
onStart() {} // same as previous "onStart"
371+
onReset() {} // did not exist before -> hook to reset collections etc.
372+
})
373+
```
374+
375+
#### New Class Registry
376+
377+
There is a new recommended way to define classes with full class path for improved
378+
debugging and automatic type registration (EJSON / toData):
379+
```javascript
380+
// Instead of:
381+
Space.Object.extend(My.namespace, 'MyCustomClass');
382+
// Do this now:
383+
Space.Object.extend('My.namespace.MyCustomClass');
384+
```
385+
342386
## Install
343387
`meteor add space:base`
344388

0 commit comments

Comments
 (0)