jimschubert / electron-aurelia-example

An example desktop application written with Electron and Aurelia.
MIT License
35 stars 8 forks source link

Thank you for posting this. #2

Open ghost opened 9 years ago

ghost commented 9 years ago

Jim,

I've spent the last two weekends trying to get Aurelia working inside Electron. Thank you very much for this critical to success example. I was able to get my Electron apps to run, but never run correctly after being built. Your work is outstanding.

I'm still trying to understand the build process, but rejoice that I can at last build and run.

When I done with my Metadata Driven Code Generation App I'll let you know. (Now I can actually start coding the app. LOL)

Question: Is there any reason that I can't use TypeScript to develop my app if I build ES6 files and then let jspm do it's runtime job with my transpiled .js files?

Best to you,

Karl

jimschubert commented 9 years ago

Hey, Karl.

I actually created this example and another one using Angular2 based on a discussion I had with a guy at work. We were tossing around some ideas about simplifying our web based and desktop based applications. I really just wanted to see how easy it would be to structure an electron application using Aurelia and Angular2. It was by far much easier to get Aurelia up and running (my Angular2 example works, but I'm not a fan of Typescript).

There's still quite a bit I didn't do in this project, such as packaging cross platform and supporting signing on OS X. I know https://github.com/szwacz/electron-boilerplate has a Windows installer, Debian linux application shortcut, and OS X launchctl stuff. If you're going to be distributing, check out that project and it will probably help you out.

Also, when I was putting together this example the Aurelia team was working with the jspm team to resolve some issue with bundling application files to reduce load time. I recall reading that the solution reduced individual file query count from 240+ to 25 or so requests. This repository doesn't create a jspm bundle, so you may also want to look into that.

I don't see why you wouldn't be able to use Typescript. My electron-angular-example project has a build setup to compile the single main.ts file (I know, it's silly). I had a few issues with the build that I never resolved... mainly linting wasn't excluding typescript found in libraries under jspm_packages and there seem to be issues with node 4.2.1 and npm 3.3.10 which prevent gulp from completing the build. These would probably be pretty easy to fix though. I just did a clean build of the electron-angular-example project and, although I had to CTRLC to kill the build, npm start successfully starts the app.

I put this project up on github in case anyone would find it helpful, so I'm glad it gets you started on your project. If you link me to your project when it's ready, I'll definitely check it out.

ghost commented 9 years ago

Hi Jim,

Here is my go at Electron, ES6, and Aurelia.

https://github.com/Oceanware/DemoElectronAurelia https://github.com/Oceanware/DemoElectronAurelia

The app is very simple. I used the electron-packager to build. I have not yet implement bundling.

Your research on the startup of Electron and Aurelia was my answer to prayer.

Thank you again!

Karl

On Nov 7, 2015, at 9:46 PM, Jim Schubert notifications@github.com wrote:

Hey, Karl.

I actually created this example and another one using Angular2 based on a discussion I had with a guy at work. We were tossing around some ideas about simplifying our web based and desktop based applications. I really just wanted to see how easy it would be to structure an electron application using Aurelia and Angular2. It was by far much easier to get Aurelia up and running (my Angular2 example works, but I'm not a fan of Typescript).

There's still quite a bit I didn't do in this project, such as packaging cross platform and supporting signing on OS X. I know https://github.com/szwacz/electron-boilerplate https://github.com/szwacz/electron-boilerplate has a Windows installer, Debian linux application shortcut, and OS X launchctl stuff. If you're going to be distributing, check out that project and it will probably help you out.

Also, when I was putting together this example the Aurelia team was working with the jspm team to resolve some issue with bundling application files to reduce load time. I recall reading that the solution reduced individual file query count from 240+ to 25 or so requests. This repository doesn't create a jspm bundle, so you may also want to look into that.

I don't see why you wouldn't be able to use Typescript. My electron-angular-example https://github.com/jimschubert/electron-angular-example project has a build setup to compile the single main.ts file (I know, it's silly). I had a few issues with the build that I never resolved... mainly linting wasn't excluding typescript found in libraries under jspm_packages and there seem to be issues with node 4.2.1 and npm 3.3.10 which prevent gulp from completing the build. These would probably be pretty easy to fix though. I just did a clean build of the electron-angular-example project and, although I had to CTRLC to kill the build, npm start successfully starts the app.

I put this project up on github in case anyone would find it helpful, so I'm glad it gets you started on your project. If you link me to your project when it's ready, I'll definitely check it out.

— Reply to this email directly or view it on GitHub https://github.com/jimschubert/electron-aurelia-example/issues/2#issuecomment-154771651.

jimschubert commented 9 years ago

Thanks for the link.

I saw you're invoking electron-packager directly. In this project, I created a build.js script in the root which will simplify some of that work by pulling the productName property of your package.json, build either for the current architecture if you've not specified a switch, and clean the build output directory before building.

I had only toyed with Aurelia bundling for an hour or so back when it was first announced. If I remember correctly, I used the --inject switch and it modified the config.js or index.html (or both?). I think I followed the steps here: http://patrickwalters.net/my-best-practices-for-aurelia-bundling-and-minification/. I did a hard reset on the repo at the time and gave up. If you haven't yet looked into it and want to give it a try, Rob Eisenberg blogged about it.

ghost commented 9 years ago

Jim,

I kept this example super simple for my presentation tonight. I’ll be digging into much cleaner build and bundle techniques. Thank you very much for the links.

Best,

Karl

On Nov 9, 2015, at 9:30 PM, Jim Schubert notifications@github.com wrote:

Thanks for the link.

I saw you're invoking electron-packager directly. In this project, I created a build.js https://github.com/jimschubert/electron-aurelia-example/blob/master/build.js script in the root which will simplify some of that work by pulling the productName property of your package.json, build either for the current architecture if you've not specified a switch, and clean the build output directory before building.

I had only toyed with Aurelia bundling for an hour or so back when it was first announced. If I remember correctly, I used the --inject switch and it modified the config.js or index.html (or both?). I think I followed the steps here: http://patrickwalters.net/my-best-practices-for-aurelia-bundling-and-minification/ http://patrickwalters.net/my-best-practices-for-aurelia-bundling-and-minification/. I did a hard reset on the repo at the time and gave up. If you haven't yet looked into it and want to give it a try, Rob Eisenberg blogged about it http://blog.durandal.io/2015/09/11/bundling-aurelia-apps/.

— Reply to this email directly or view it on GitHub https://github.com/jimschubert/electron-aurelia-example/issues/2#issuecomment-155263905.