Backbone Marionette 模块已弃用,什么是处理初始值设定项和启动事件的良好替代方案?

Backbone Marionette Module is deprecated, what is a good alternative to handling initializers and start events?

正如我的标题所说,我确实看到 Marionette 模块现在已被弃用,我们应该使用 AMD 模块而不是使用 requirejs。这很好,除了模块之外的所有东西在处理初始化器和 before:start 和启动事件方面都有很好的用途。它允许我轻松设置我的区域、视图和 collections。现在有什么替代方法可以处理这个问题?

下面是我将使用的代码示例:

define(['core', './views/mainView'], function(core, mainView) {
    var app = core.app;
    app.start();

return core.app.module('Home Page Module', function(Module) {
    Module.addInitializer(function() {
        this.region = new core.Marionette.Region({
            el: '#page-container'
        });
        this.collection = [];
    });

    Module.on('start', function() {
        this.view = new mainView({
            collection: this.collection
        });
        this.region.show(this.view);
    });
});
});

我没有答案,但 Marionette 的创建者 Derick Bailey 有答案。

The problem with no sub-applications to start / stop has not yet presented itself in my apps. I don’t need that right now. I know I will need it, though, and when I do run in to that requirement again, I’ll find another solution for it. There’s a good chance I’ll build an add-on for Marionette that specifically works with this new setup, in order to provide the functionality I want.

在此处找到:http://derickbailey.com/2014/06/10/browserify-my-new-choice-for-modules-in-a-browser-backbone-app/

引用现在有点过时(一年前),但考虑到该功能无论如何都已被弃用,没有任何替代建议。