Any plans in supporting real ES and ES2015 format? #175
Comments
update I found the ES6 code somewhere inside this function:
I was playing around with the watch task, and noticed
and so on... Nice work! But I'm back to Rollup for now :) |
Thanks for your feedback. Nice to see someone give it a try 👍 Regarding the missing features:
Regarding the other tasks see my first point. Doing one thing well. |
Regarding the "Rollup way". That is what people most will think this days when they see a ES6 module bundler. Also the same case with me. So I was a little surprised when I saw the output :) And the fact that Facebook with React and others now are going to use Rollup in production, will not change that opinion among end-devs. I ended up on your repo because I love TypeScript, and because I see glitches in Rollup that can't be fixed. So I was looking for an alternative. Good work there! Regarding your TypeScript setup I'm confused :( You are using TS 2.0 now, and have a typings folder. From v. 2.0 you install what you need from NPM @types. No need for your typings folder. Then in your tsconfig.json you define it. Example:
If you now open a VSCode editor you see many red lines! Meaning things aren't configured right. You will get issue with Promise. Here you can install @types/es6-promises and that issue is fixed. You have some other types too, but here you can wrap them into a NPM package for your code and upload on NPM and install it the same way as other @types. Then your VSCode editor will be happy. Regarding TS transpilling. Also here you do something strange. Why do you need to do so much disk write? For bundling the source itself, can't you point directly to the source folder like this: tsc src/index.ts I know there will be a issue with AVA. You could use ts-node, but AVA have shoot themself in the foot with the Babel integration and blocked for other type extensions such as TS, CS etc. Tape or even Tapir could solve this issues if you prefer that way to do testing. Back to your code. I got no warnings if I did this: import a from './a.js'
const a = 'b';
export a;
// or
export a export export 'Hello!!' = b
// or
export b = export;
// or
export default export = 'Hello' In Rollup there are guards against such things :) "Live update" happen in the moment you are in watch mode and you write your code. The code changes should be visible instant in the moment you type it. It didn't happened to me. So the "live update" was broken in my end. How are your plugins going to work? Great work! |
I have to add that with TS 2.0 you have different type of type definitions build-in. E.g. you will not get access to ES6 defininations such as Map, WeakMap etc if your target isn' ES6 or ES2015. Same way you will only get type definitions for ES5 if that is your target. |
Ich bin so weit beeindruckt! Ich mag, was ich bisher sehen. Ich war ein wenig überrascht von dem Ergebnis. Was sind Ihre Pläne als nächstes? Roadmap hat mir gesagt, nicht sehr viel. Nicht in die gleiche Falle tappen as Webpack and Browserify. Zu viel zusätzlichen Code. Wenn Sie 40 Zeilen haben, you don't want 4000 lines :) Entschuldigen Sie die Sprache! Ich bin sehr rostig. Vor 10 Jahren arbeitete ich in Deutschland. |
Thanks for you feedback. I'll stick with english here so others can follow. :)
I have a mixed TS typings setup right now.
I'm using VSCode by myself do develop paeckchen, so I'm wondering why there are errors in your setup. Did you run And the Promise support should be enabled with TS 2.0 because I've set
What do you mean by 'so much disk write'? All I do in the compile script is running plain
Please open a separate issue for this. The watch mode should exactly do that. It would be great if you also add some details about your system (OS, node version...) so I could investigate the issue.
See above for my comments regarding code validation and error handling.
The plugins are currently (and probably will stay) internal API. |
Regarding the roadmap, there are a few big things to do:
Once this things are done we will plan the next things. :) |
The funny thing is that I yesterday started on a similiar project like this one in TypeScript mixed with Rollup ideas. So I know how hard it is to get the TypeScript settings correct. I have been there, fixed it and happy with it :) TS 2.0 documentaion 2.0 isn't out YET. But my tsconfig look like this "compilerOptions": {
"types": ["mocha", "chai", "node", "minimist", "source-map-support", "chalk", "acorn", "es6-promise"]
} You find details here: microsoft/TypeScript#9184 and also use of dead code ellimination is a good thing in TS now. microsoft/TypeScript#6319 But once again your are blocking this when you use TS to compile to ES5. Recommended way is to use TS to ES6. Babel to ES5. That is what Microsoft suggest.. |
I'll have a look at the issues. Thanks. :) |
I was done with Babel 5 months ago. I'm using TypeScript + ts-node + Buble and Rollup most of my time. |
Buble sounds interesting. I'll need to take a look at that |
btw. Any reason why you are not writing your tests in TS? With tests written in TS as well you will find bugs easier if you type definitions are correct. |
The tests are written in TS ;) |
Did you build on the cmdline before opening VSCode? |
Any plans in supporting real ES and ES2015 format? I'm used too Rollup and was looking for an alternative solution, but confused about the bundling.
For me a ES or ES2015 format looks like this:
With paeckchen it looks like this (I tried to change the flags in the CLI, but same result):
I'm not trying to be negative here, but for me a module bundler like this should output a flat bundle like e.g. Rollup does. Not like Webpack, Browserify etc where extra tons of code lines are injected (their module system).
And with the output I got with this code, I don't know what is what. I can't see my own code in it at all.
That's one of the danger with commonJS. At least when it comes with Rollup. Say you have 20 lines of code and use commonJS and have a couple of dependencies. You will end up with over 2000k lines of code.
For now I will keep an eye on this project and wait for the documentation. Maybe I did something wrong...
The text was updated successfully, but these errors were encountered: