cyclejs-community / create-cycle-app

Create Cycle.js apps with no build configuration.
ISC License
237 stars 21 forks source link

Typescript #102

Closed jvanbruegge closed 7 years ago

jvanbruegge commented 7 years ago

I've added the typescript templates, but wasnt able to test them see https://github.com/cyclejs-community/create-cycle-app/issues/101#issuecomment-292908353 fixes #92

nickbalestra commented 7 years ago

Ah, now I see why :) Have you tried this:

jvanbruegge commented 7 years ago

Oh, you are right, the new version is not released yet. I'm dumb

jvanbruegge commented 7 years ago

Ok, this works now

nickbalestra commented 7 years ago

I'll also avoid to use .jsx/.tsx extension (although supporting it in the webpack config)

jvanbruegge commented 7 years ago

typescript will throw an error if you use tsx syntax in a ts file

jvanbruegge commented 7 years ago

and i would rework the webpack configs. We should only maintain 1, not 4

nickbalestra commented 7 years ago

All good, I left you some minor comments. mainly:

jvanbruegge commented 7 years ago
  1. Yes, we can add the dependencies in a common place. We can leave a language specific dependency field in there
  2. Yes, I would clearly seperate jsx and js
  3. Im even not sure if we should maintain one. Webpack config shouldn't be done by everyone again and again. webpack-blocks removes boilerplate while maintaining the possibility to add custom config just as easy as before. We would basicly outsource this part to a different open source project, so we can benefit from the blocks other people did without copy and paste. Even people like Dan Abromov suggest using the project. Plus is makes different configs easier, as you only have to create an array containing the blocks. I also disagree that we have to fine tune anything. The only difference between languages is the loader. Typescript users want to be able to just bundle typescript and javascript files (libraries). Js users dont need the typescript loader. Thats the only difference you have
nickbalestra commented 7 years ago

Let's move 3 into a separate pr and discuss it there? There are enough of both pro and cons to be discussed separately without having to block this PR. I would love to first have everything in and then see where make sense to add improvements or not, lets wait till we have the whole picture with tests ecc to decide about this.

jvanbruegge commented 7 years ago

ok, but then i would not add the webpack config just now to prevent unneccesary work now. This wont be released anyway as long the webpack part is not decided

jvanbruegge commented 7 years ago

for 3: #103 last commit addresses 1 I would leave 2 as it is

nickbalestra commented 7 years ago

Thanks a lot for this @jvanbruegge !

nickbalestra commented 7 years ago

I'll give it a couple of tests and if all ok, merge it

nickbalestra commented 7 years ago

I got this when I try to run it:

Error: Cannot find module '../../configs/flavor'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (~/Projects/playground/cca/cca03/node_modules/cycle-scripts/scripts/init/setup.js:8:22)
    at Module._compile (module.js:571:32)
jvanbruegge commented 7 years ago

forgot to edit the path after rename