Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Phoenix 1.1.1 to 1.1.2 upgrade instructions

Phoenix 1.1.1 to 1.1.2 upgrade instructions

Optional upgrade for new brunch features

Update your phoenix deps

def deps do
  [{:phoenix, "~> 1.1.2"},
  ...]
end

Now, update your phoenix deps to grab the latest minor releases:

$ mix deps.update phoenix phoenix_html phoenix_live_reload

Update your package.json

(for umbrellas the file prefix will need file:../../deps/)

{
  "repository": {
  },
  "dependencies": {
    "babel-brunch": "^6.0.0",
    "brunch": "^2.1.1",
    "clean-css-brunch": ">= 1.0 < 1.8",
    "css-brunch": ">= 1.0 < 1.8",
    "javascript-brunch": ">= 1.0 < 1.8",
    "uglify-js-brunch": ">= 1.0 < 1.8",
    "phoenix": "file:deps/phoenix",
    "phoenix_html": "file:deps/phoenix_html"
  }
}

And run $ npm install to bring in the new node deps

Update you brunch-config.js:

Remove phoenix and phoenix_html from your watched configuration:

  paths: {
    // Dependencies and current project directories to watch
    watched: [
-     "deps/phoenix/web/static",
-     "deps/phoenix_html/web/static",
      "web/static",
      "test/static"
    ],

    // Where to compile files to
    public: "priv/static"
  },

Add npm.whitelist to your npm config:

  npm: {
    enabled: true,
+   whitelist: ["phoenix", "phoenix_html"]
  }

Update your js imports

- import "deps/phoenix_html/web/static/js/phoenix_html"
+ import "phoenix_html"

- import {Socket} from "deps/phoenix/web/static/js/phoenix"
+ import {Socket} from "phoenix"

Test it

$ mix phoeinix.server
07 Jan 16:16:59 - info: compiled 5 files into 2 files, copied 3 in 1.2 sec
@kyledecot

This comment has been minimized.

Show comment
Hide comment
@kyledecot

kyledecot Jan 9, 2016

Under "Test it" you have a typo. It should say:

$ mix phoenix.server

Under "Test it" you have a typo. It should say:

$ mix phoenix.server
@LeoNogueira

This comment has been minimized.

Show comment
Hide comment
@LeoNogueira

LeoNogueira Jan 9, 2016

Perfect ! 👍

Perfect ! 👍

@rheckart

This comment has been minimized.

Show comment
Hide comment
@rheckart

rheckart Jan 11, 2016

There may be an additional step necessary. I had to install babel-preset-es2015 to prevent an app.js compile error.

There may be an additional step necessary. I had to install babel-preset-es2015 to prevent an app.js compile error.

@pedrosnk

This comment has been minimized.

Show comment
Hide comment
@pedrosnk

pedrosnk Jan 11, 2016

thanks @rheckart I had the same issue

thanks @rheckart I had the same issue

@raholland79

This comment has been minimized.

Show comment
Hide comment
@raholland79

raholland79 Jan 11, 2016

mix phoeinix.server should be mix phoenix.server :)

mix phoeinix.server should be mix phoenix.server :)

@jeffweiss

This comment has been minimized.

Show comment
Hide comment
@jeffweiss

jeffweiss Jan 14, 2016

I also had the babel-preset-es2015 issue and was able to fix it by adding this section to my package.json:

+  "devDependencies": {
+    "babel-preset-es2015": "^6.3.13"
+  }

I also had the babel-preset-es2015 issue and was able to fix it by adding this section to my package.json:

+  "devDependencies": {
+    "babel-preset-es2015": "^6.3.13"
+  }
@robotarmy

This comment has been minimized.

Show comment
Hide comment
@robotarmy

robotarmy Jan 21, 2016

In order to use npm packages the brunch_config will need to be setup to include /^node_modules/ ie:

    javascripts: {
      joinTo: {
        "js/app.js":     /^(web\/static\/js)/,
        "js/play.js":    /^(web\/static\/js-play)/, // minimal js for play session
        "js/vendor.js":  /^(web\/static\/vendor)|^(node_modules)/
      },
      order: {
        before: [
          'web/static/vendor/js/jquery-1.11.3.js'
        ]
      }

In order to use npm packages the brunch_config will need to be setup to include /^node_modules/ ie:

    javascripts: {
      joinTo: {
        "js/app.js":     /^(web\/static\/js)/,
        "js/play.js":    /^(web\/static\/js-play)/, // minimal js for play session
        "js/vendor.js":  /^(web\/static\/vendor)|^(node_modules)/
      },
      order: {
        before: [
          'web/static/vendor/js/jquery-1.11.3.js'
        ]
      }
@ugifractal

This comment has been minimized.

Show comment
Hide comment
@ugifractal

ugifractal Jan 28, 2016

excelent....

excelent....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment