These are chat archives for jdubray/sam

8th
Aug 2016
Edward Mulraney
@edmulraney
Aug 08 2016 11:04
sam2 ?
Jean-Jacques Dubray
@jdubray
Aug 08 2016 13:28
services APIs and microservices...
Jean-Jacques Dubray
@jdubray
Aug 08 2016 13:33
The question is how do you connect a back-end to Actions+Model
Edward Mulraney
@edmulraney
Aug 08 2016 13:35
so this is like blog post part 2, not SAM version 2?
Jean-Jacques Dubray
@jdubray
Aug 08 2016 13:35
no, not sam v2, SAM2
the other SAM
Edward Mulraney
@edmulraney
Aug 08 2016 13:44
what does the 2 mean? what is this the second of?
Jean-Jacques Dubray
@jdubray
Aug 08 2016 13:45
just the same acronym, but different meaning
Jean-Jacques Dubray
@jdubray
Aug 08 2016 16:42
I was wondering if any one had tried to use npm scripts instead of grunt/gulp/webpack? https://www.keithcirkel.co.uk/why-we-should-stop-using-grunt/
Edward Mulraney
@edmulraney
Aug 08 2016 16:50
you still need webpack
I only use npm scripts (they trigger webpack). I haven't used gulp or grunt for a long time
Jean-Jacques Dubray
@jdubray
Aug 08 2016 16:52
Edward Mulraney
@edmulraney
Aug 08 2016 17:05
npm scripts != tree-shaking, rollup or browserify
npm scripts are simply commands
so you can do anything in npm scripts that you can do in the terminal
Jean-Jacques Dubray
@jdubray
Aug 08 2016 17:06
yes, I understand, I was wondering if that approach is sustainable
Edward Mulraney
@edmulraney
Aug 08 2016 17:07
we've found it much more manageable/maintainable than gulp/grunt
Jean-Jacques Dubray
@jdubray
Aug 08 2016 17:07
but you still prefer Webpack?
Edward Mulraney
@edmulraney
Aug 08 2016 17:08
webpack is just the bundler, it isn't comparible to npm scripts
Jean-Jacques Dubray
@jdubray
Aug 08 2016 17:09
I see, sorry. You prefer webpack to say rollup?
Edward Mulraney
@edmulraney
Aug 08 2016 17:09
I suppose there are aspects you can compare
we use webpack for react etc. i definitely prefer webpack to gulp/grunt
simple project:
"scripts": {
    "serve": "./resources/scripts/serve.sh",
    "build": "./resources/scripts/build.sh",
    "test": "NODE_ENV=test ./resources/scripts/test.sh",
    "test-watch": "NODE_ENV=test ./resources/scripts/test-watch.sh",
    "storybook": "./resources/scripts/storybook.sh",
    "lint": "find ./src ./resources -name \\*.js | xargs ./node_modules/.bin/eslint"
  },
Jean-Jacques Dubray
@jdubray
Aug 08 2016 17:11
ok, I'll have to finally do a deep dive in that area.
I'll come back with better questions
thank you
Edward Mulraney
@edmulraney
Aug 08 2016 17:12
more complex project:
"scripts": {
  "build": "./resources/scripts/build.sh",
  "serve": "./resources/scripts/serve.sh",
  "install-git-hooks": "./resources/scripts/install-git-hooks.sh",
  "test": "./resources/scripts/test.sh",
  "test-ui": "./resources/scripts/test-ui.sh",
  "test-watch": "./resources/scripts/test-watch.sh",
  "storybook": "./resources/scripts/storybook",
  "coverage": "./resources/scripts/coverage.sh",
  "lint": "./resources/scripts/lint.sh",
  "stylelint": "./resources/scripts/stylelint.sh",
}
so both build and serve would trigger the sh scripts that run webpack
serve.sh might look something like:
./node_modules/.bin/webpack-dev-server \
--config ./resources/webpack/webpack.config.js \
--hot \
--colors \
--progress \
--inline \
--history-api-fallback \
etc.
Edward Mulraney
@edmulraney
Aug 08 2016 17:48
i haven't tried rollup yet but it sounds very promising :)