Skip to content

Migration from 0.14.16 to 0.14.17

Herbert Vojčík edited this page Oct 6, 2015 · 6 revisions

0.14.13 is a small maintenance release with just a few small breaking changes.

One of them is starting to use "virtual" module amber/Platform that needs to be mapped / to be wrapping either amber_core/Platform-Browser or amber_core/Platform-Node externally, based on the context.

The second is removal of package Compiler-Exceptions.

Coupled with this release are all the others to make things working and allow creating new projects up-to-date: Helios 0.5.3, grunt-init-amber 0.14.23 and grunt-dev 0.8.0.

To have newest template for amber init, update the cli:

npm install -g amber-cli

To update your projects, do

bower install "amber#^0.14.17" --save
bower install "helios#>=0.5.3" --save-dev
grunt devel

Most of the updates in recent time were in infrastructure of the project, not coupled to amber releases itself, so to get up to date with those, you can either (bullet-proof but maybe a bit more work) create brand new project with amber init and bring all files and settings back; or, if your setup is not that old, just do

npm install "amber-dev@^0.8.0" --save-dev

and replace Gruntfile's requirejs/deploy and requirejs/devel sections with:

            deploy: {
                options: {
                    mainConfigFile: "config.js",
                    rawText: {
                        "amber/Platform": '/*stub*/',
                        "app": 'define(["deploy"],function(x){return x});define("amber/Platform",["amber_core/Platform-Browser"],{});'
                    },
                    pragmas: {
                        excludeIdeData: true,
                        excludeDebugContexts: true
                    },
                    include: ['config', 'node_modules/requirejs/require', 'app'],
                    out: "the.js"
                }
            },
            devel: {
                options: {
                    mainConfigFile: "config.js",
                    rawText: {
                        "amber/Platform": '/*stub*/',
                        "app": 'define(["devel"],function(x){return x});define("amber/Platform",["amber_core/Platform-Browser"],{});'
                    },
                    include: ['config', 'node_modules/requirejs/require', 'app'],
                    exclude: ['devel'],
                    out: "the.js"
                }
            },

The file config-node.js also needs to change line:

define("amber_core/Platform-Browser", ["amber_core/Platform-Node"], {});

to

define("amber/Platform", ["amber_core/Platform-Node"], {});

If you do not have config-node.js, your project has pretty old infrastructure and maybe it's better to go for jumping amber init + copy solution.

Clone this wiki locally