These are chat archives for jdubray/sam

15th
Apr 2017
Zach Dahl
@schtauffen
Apr 15 2017 02:23
codepen got an upgrade, i likey
i mostly use jsbin because it lets me use vim keybinds, i might have to see if codepen has that option now because that looks saweetah
oh hell yes "key binds > vim"
Paolo Furini
@pfurini
Apr 15 2017 07:53
@foxdonut well, this is the first time I see that project editor.. the fact is tagged as "beta", and I don't open a codepen since months ago, gives me the clue they added this (somewhat) recently. I'll see if it's on par with plunker in terms of features..
Daniel Neveux
@dagatsoin
Apr 15 2017 09:11
Any recommandation for an online POC editor with typescript and es6 out of the box?
(And jsx)
(And decorator)
Fred Daoud
@foxdonut
Apr 15 2017 12:46
@dagatsoin what do you mean by decorator?
Daniel Neveux
@dagatsoin
Apr 15 2017 14:24
I mean that I would like to use es6/typescript decorator out of the box
Paolo Furini
@pfurini
Apr 15 2017 15:23
@dagatsoin You could use a systemjs setup with pretty much all the online IDEs I think.. Take a look at my simple setup here (for the SAM poc): http://plnkr.co/SjKe4T
It configures systemjs on-the-fly transpilation, with babel (ES6) and module support. Without systemjs, plunker cannot support ES6 modules out of the box, and that's the simplest way I know to achieve that setup
You'll find similar setups for swapping babel with typescript as the transpiler, with the benefit that you could also choose a specific version of typescript compiler
Daniel Neveux
@dagatsoin
Apr 15 2017 15:27
Lets go with plunkr so. Thx 👍
Paolo Furini
@pfurini
Apr 15 2017 15:28
@dagatsoin As I said, it's not a plunker feature.. it is systemjs that gives you all that flexibility. I think it should work the same whatever IDE you choose
plunker has its own ES6 support, but it's limited (for example no module import support). By using systemjs you decide which transpiler, and which features (even experimental) to enable
take a look at this plunkr that uses systemjs to setup an angular2+TS sample: http://embed.plnkr.co/ulPZB1OQwkoFpbderRPk?deferRun
This setup is IDE agnostic.. copy it to whatever multi-file IDE you want, and it'll work
Paolo Furini
@pfurini
Apr 15 2017 15:36
All is needed is to put this in your index.html, and then add a config.js (read the docs on the systemjs wiki for its syntax), and an app.js that is the main boostrapped module:
<head>
  <script src="//unpkg.com/systemjs@0.19.41/dist/system.js"></script>
  <script src="//unpkg.com/typescript@2.1.4/lib/typescript.js"></script>
  <script src="config.js"></script>
  <script>
    System.import('app')
      .catch(console.error.bind(console));
  </script>
</head>
Choose whatever CDN you want (I never used unpkg, I usually go with cdnjs) and typescript version you prefer..
Paolo Furini
@pfurini
Apr 15 2017 15:41
Sorry, if you choose typescript, your main module is going to be app.ts, not app.js