typeorm / ionic-example

Example project to demonstrate TypeORM in an Ionic app
67 stars 56 forks source link

Added development mode for running app in browser with sql.js #12

Closed nextlevelshit closed 6 years ago

nextlevelshit commented 6 years ago

I've added sql.js, changed db connection depending on ionic platform (cordova|browser) and shimmed sql.js as global module inside webpack configuration.

daniel-lang commented 6 years ago

Thank you for this contribution. I understand, that it makes sense for most development setups to have the option to run in the browser. But these examples should be a simple starting point, so I'm not sure, it should be included out of the box. Also, I'm not sure, that this project needs a yarn.lock.

nextlevelshit commented 6 years ago

yarn.lock is at all not need, but *.lock files were not excluded in gitignore, so I was not sure to do it by myself. In any case it is recommended to use yarn instead of npm, but this topic should not be affected in this Pull Request.

Concluding from your argumentation, Ionic apps are only deployed on devices and in production mode. This sounds unusual for me. It is uncommon to develope while emulating or running on a device. Nevertheless most time the code will be deployed in development mode, so it is necessary to have the possibility to use TypeORM also in browser.

This should be a standard. Otherwise nobody will find a working example for that combination of webpack, ionic and TypeORM. So let's start providing something more lifelike. Nobody developes in prodcution mode only.

daniel-lang commented 6 years ago

I'm not saying, that it is unusual to use ionic serve. But the idea of these examples is to give a minimalistic starting point, but I agree, that it is helpful. If you address my other comments, I can merge it.

nextlevelshit commented 6 years ago

I will do, thanks.

daniel-lang commented 6 years ago

Did you test, that it still works when running ionic serve?

nextlevelshit commented 6 years ago

For sure @daniel-lang. Everthing runs perfectly. I've tested on Ubuntu 17.10.

bildschirmfoto von 2018-02-27 21-20-25