8 ms·
Apache Cordova: after 10 months, I won't using it anymore
- csvan 11y agoSo I was reading this, and the only things that kept repeating in my mind were "Ionic, Crosswalk, Webworkers, Ionic, Crosswalk, Webworkers..." (Yes I know Crosswalk is Android only, but it works wonders).
- matthijs_ 11y agoExactly, I absolutely love Ionic and it's the fix for most of the issues raised in the article.
- deleted 11y ago[deleted]
- stewbrew 11y ago"To bundle Chrome, you will see a small (~10-15MB) size increase in your Android Apps." I wonder what kind of apps they run that make them call 10-15mb call "small".
- lmm 11y agoOne game I play is 500mb. A few people complain about it, but honestly, with today's flash sizes, who cares?
- SunboX 11y agoDon't judge about others based only your used hardware! There are a lot (!) people with devices out there that only have 10MB storage left and can't install a app because it's size is bigger than that. ;)
- squeaky-clean 11y agoBig Ionic fanboy here, but it's not all sunshine and rainbows. You absolutely need Crosswalk if you want to publish on Android. The default WebView performance blows, and is so inconsistent. We have two LG G3's with different WebView versions! There are a few downsides though. Added complexity/possibility for bugs, and APK size. The Crosswalk website says it should add 10-15MB to your. In our app, it's adding over 55MB to the installation size. These numbers are based on unminified JS/HTML (and I think we still have some outdated resources sitting in www/img/), but iOS: 18.0MB, Android: 78.4MB. And then there's the additional bugs. Did you know localStorage is completely broken in the current "stable" release of Crosswalk? Once you kill/reopen your app, all storage is cleared. You'll need the latest Canary build if you want localstorage to work (and who knows what's broken in that build).
- GFischer 11y agoThe article makes some good points, but I wish he'd asked someone else to proofread and correct it... it has way too many mistakes (I understand English is not the author's mother tongue, but it's not mine either).
- Sacho 11y agoFor me, the more glaring problem is that the article simply makes statements, with no argumentation to back them up. There are no examples, no data to support his claims, no follow-through on any of his categorical declarations. The only useful information I got from it is that the author is frustrated with Cordova.
- MichaelCrawford 11y agoI dont know from Cordova but a former employer bet the far on Solr without evaluating in any way. When I tried a search for solr sucks I got 600,000 hits. No one ever answered my questions on stackoverflow.
- Adirael 11y agoSolr and Cordova are on different realms, I don't see how that's relevant in this discussion. FWIW I've used Solr a lot and it's great for faceting and geometric search.
- MichaelCrawford 11y agothey are both apache projects. I have used many apache codebases, all the others were excellent. ai expect my former employer chose solr because of thevapache foundation's great reputation. I looked forward to using it and so was completely dumbfounded by its poor quality.
- matwood 11y agoI searched for solr sucks and got 20k hits. Not here to defend solr specifically, but every tool has trade offs. Solr is popular and there is a lot of documentation, so it is not a bad choice for a document search database. Now, picking solr without understanding a document database and its tradeoffs is a problem, but not solrs.
- MichaelCrawford 11y agoI tried that search in june 2013.
- infinityplus1 11y agoIn another news, water is wet.
- jorgt 11y agoThere's a use case for everything. I for one am not wasting resources creating and maintaining two versions of fairly simple applications in a corporate BYO environment, like the one I'm working in. There are plenty of convenient and easy to use frameworks out there that make positioning and screen creation just as straight forward as Xcode or the android development tools. Actually, I always find it a bit surprising Cordova doesn't have more competition. Edit; I find the title misleading. It's not so much about Cordova as it is about hybrid app development
- seanwilson 11y agoI agree with this. If someone thinks Cordova is bad, what are you comparing it to? Maintaining two separate native code bases (including test suites and finding third party libraries for both that do what you need) to support iOS and Android isn't exactly a walk in the park either. Coding is all about trade offs. There is rarely a perfect solution for all cases otherwise frameworks like Cordova would never exist in the first place.
- pjmlp 11y ago> Actually, I always find it a bit surprising Cordova doesn't have more competition. You mean Xamarin, Qt?
- bigiain 11y agoHmmm, I note in his closing para: "Facebook wrote a good article when they have decided to switch from a web app to a native one." A three year old blog post from Facebook. Now the circle has turned with React and React Native…
- matwood 11y agoTo be fair, react native compiles to native according to their keynote were it was introduced. FB gave up on the web app/hybrid app and in the same keynote strongly said the experience will never be the same or good enough as native.
- ksherlock 11y agoreact native doesn't compile to native. It's javascript with native GUI controls instead of the DOM for the presentation layer. (You can still have parts that are objective C or swift and are thus compiled, of course).
- matthewmacleod 11y agoI'm not sure it has though – React Native apps are demonstrably not web apps. It's a very different approach.
- bigiain 11y agoI guess my thought was that in contrast to the thrust of the blog post - FB is going back to the "build as much of it as you can with one codebase (React) and native-app-ify it as late as possible (with React Native)" approach. React came before React Native. In one sense, React Native is just a tool to turn React HTML5/Javascript webapps into native ones - in a similar way to maybe an AngularJS webapp turned "native" with Cordova.
- aikah 11y agoReact native uses UI widgets from plateform SDKs, so Facebook point still stands. Their hybrid app sucked and they lost real money as the result of this.
- AshleysBrain 11y agoOn performance, the new WKWebView on iOS (with Nitro JS + GPU rendering, including WebGL), and the Chromium webview on Android 5.0+ (or Crosswalk for Android 4.0+, similar features all round), radically changes the performance story. It's almost identical to the system browsers now. Facebook's comments about HTML5 were back in the dark ages when the webviews generally used horribly slow software rendering and didn't have JIT for Javascript on iOS. It's a completely different picture today. In fact, our performance-sensitive HTML5 game engine[1] targets the iOS 8 webview and Crosswalk for Android for making native apps, and they generally work as well as in the browser, which is very good, especially on newer devices. Modern web APIs are also asynchronous which helps offload work from the UI thread, and Web Workers can do that for arbitrary JS code too. For example our game engine runs A* pathfinding in a web worker, offloading any performance impact from the CPU intensive algorithm and running it in parallel to the game. I think it's time to stop accusing webviews of being slow. [1] scirra.com
- sfjailbird 11y ago> the Chromium webview on Android 5.0+ The Chromium based webview is available already in Android 4.4. So about 50% penetration at this point. It is indeed a huge boost to performance.
- AshleysBrain 11y agoOh, good point. I mentioned Android 5.0+ because the 4.4 one is missing some major features including IIRC WebGL, Web Audio and WebRTC, which still rules it out for some use cases (such as a game engine).
- 0x0 11y agoDoes WKWebView work with file:/// urls needed by Cordova?
- gpmcadam 11y agoIs there a reason they don't ship with a simple web server to server out the static files, similar to `python -m SimpleHTTPServer`?
- SchizoDuckie 11y agoFUD. Ever heard of WebSQL for storing your data? After 10 months, you should have been able to work around nearly anything you mention in your article.
- harryf 11y ago> After 10 months, you should have been able to work around nearly anything you mention in your article. But that's exactly the point. Ages ago this comment on HN summarized the situation perfectly... https://news.ycombinator.com/item?id=7442766 https://news.ycombinator.com/item?id=7442766 "It takes less time to learn and build native instead of trying to hammer Javascript into a hole it doesnt fit into, and spending hours attempting to optimize it's performance to no end."
- orthecreedence 11y ago> It takes less time to learn and build native instead of trying to hammer Javascript into a hole it doesnt fit into, and spending hours attempting to optimize it's performance to no end... ...depending on the size of the app. I have an open source project that I devote a handful of hours a week to. I absolutely do not have the capacity to create native apps for desktop, iOS, and Android. It's great if the writer of that comment has either a tiny app that does nothing important or has a ton of free time, but not everyone is so lucky to be able to maintain an app on 3+ separate platforms. Javascript is the one language all devices speak well, so as someone who is proficient in it, has an existing (somewhat complicated) app, and wants to port it to mobile as quickly as possible, rebuilding everything twice in two different languages and two different UI platforms is just not an option.
- thomasfoster96 11y agoWebSQL is pretty much dead (which is unfortunate, and you should direct stern words towards Mozilla), so relying on that would be pretty risky.
- T3RMINATED 11y agoi use https://github.com/kripken/sql.js/ https://github.com/kripken/sql.js/
- hliyan 11y agoWe've been using Cordova for almost 2 years (one in production, mind you), so I beg to differ. Granted, our applications may be different and yes, Cordova, if not done right, can be excruciatingly slow. But we have managed well. Simple things like properly paginating data (rather than trying to infinite scroll), cleaning up CSS, avoiding repeated query selections (which is a bad habit of some jQuery developers) made a huge difference[1]. Our older app is built on jQuery Mobile. The latest one is Ember. The next R&D project I'll try will probably use React with Cordova. Mobile browsers are always getting better. After a while, I have the option of using App Cache instead of Cordova, without any significant code changes (I'm not using plugins yet). [1] Edit: And not abusing local storage.
- T3RMINATED 11y agosame here - i agree with you... Quit slapping code together on deadlines - think about the Architecture and do it modular and right.
- mahouse 11y agoThis is a very bad article. The real problems with Cordova are: * Core functionality is broken between releases. If you ask in the IRC support channel, they will even tell you not to update if things work well! What if I need a new feature? * Documentation is absurdly horrible or even plain wrong. I have been told several times to refer to the source code to find out how something works. * If you face any problem, chances are you will never find an answer in Google. You may find some StackOverflow thread if you are lucky, where several clueless people argue about things they do not know and then arrive to a wrong conclusion. (The programming skill levels of Cordova users on those communities are usually very low.) * Critical functionality (things such as local notifications) is not included. You must rely on 3rd party plugins, that could be well maintained, or could be not maintained at all. Yes obviously a Cordova app does not look native. It's not native and it will never be. Period.
- joshcrowder 11y agoThis would of made for a much better article. I couldn't agree more! I'm currently working on a Hybrid React app, performance issues aside the real issue is documentation and support. As soon as you are beyond a basic web app wrapped in a container you realise quickly Corodova will always be a second class citizen. On a more positive note React Native (https://facebook.github.io/react-native/ https://facebook.github.io/react-native/) is mind blowingly amazing. I really can't recommend it enough, especially for Javascript developers.
- deutronium 11y agoI'm looking to use something like Cordova to develop a fairly simple app for both Android and ios, so far it looks like React is for Mac only, looking at https://facebook.github.io/react-native/docs/getting-started.html#content https://facebook.github.io/react-native/docs/getting-started... ? Edit: It looks like i'm missing something as I can see Android apps built with it on http://www.reactnative.com/built-with-react-native/ http://www.reactnative.com/built-with-react-native/
- colinramsay 11y ago
- onion2k 11y agoThere is no sens to spend time trying to do your app multi-platform from the beginning. If your app do not works on iOS, it will not works on android neither. Conversely though, if your app is a success on iOS then it's very likely that you'll want to get an Android version out before the clone-ware makers copy it, so if (and it's admittedly a big if) your app is something that Cordova can do well there's very few reasons against using it. For some use cases it's a good framework, notably "information viewing" apps, business CRUD apps and simple 2D canvas games.
- andresmanz 11y agoI tried Cordova three weeks ago, on my Nexus 10 (Android 5.1.1). I wanted to have a native UI, so I tested angular-material and Polymer. I wasn't too happy with the result, due to stuttering animations kind of ruining the UX. Having a shared C++ code base and the respective native UI code works perfectly fine for me, so I wouldn't use Cordova again. I don't see why I should. I'm just as productive there as I am with the web stuff, with the difference that I get a truly native look and feel, without having to watch performance all the time. I'm sure that, if you want to take the time, you can get perfectly well running apps. But for me, it isn't worth the trouble. I also tried Qt and it was nice, but the app took ages to load on an actual devices (because of QML) and their licenses get more and more messed up.
- hliyan 11y ago> I wanted to have a native UI, so I tested angular-material and Polymer Aren't Web Components still heavily polyfilled in most mobile browsers? I'm wondering how much of the problem was due to the Polymer library than Cordova proper.
- andresmanz 11y agoI thought that would make sense, too. But I found them to be working OK in Chrome on Android, so I thought I could give it a try. I should have said that I wouldn't create any hybrid mobile apps anymore, not just Cordova. That's not because I don't like it - it's simply because the other options work just as good for me. At least for now - can't say anything about the future.
- hliyan 11y agoRight. > I should have said that I wouldn't create any hybrid mobile apps anymore, not just Cordova I must admit, I'm still quite enamored with them, if only for development time and maintainability. I'd rather not develop 3 different apps for desktop (browser), Android and iOS. As I said elsewhere, I'm waiting to rely on App Cache instead of Cordova in the future.
- deleted 11y ago[deleted]
- nailer 11y agoHTML5 is working for Instagram and Apple Music, I don't think many people would say they're inherently slow.
- eddieroger 11y agoInstagram and Apple Music aren't running through an abstraction layer than brings it's own variable overhead. It's not a good comparison.
- nailer 11y agoI don't think of Cordova as much of an abstraction layer. They just expose things to the `window` global.
- nolanl 11y agoFor doing database work in a separate thread, you used to be able to access WebSQL from a web worker on both iOS and Android, but sadly that's been dropped as of Chrome 39 and iOS 9: https://github.com/pouchdb/pouchdb/issues/2806 https://github.com/pouchdb/pouchdb/issues/2806 Also I don't believe you can use the SQLite Plugin in a web worker either: https://github.com/litehelpers/Cordova-sqlite-storage/issues/105 https://github.com/litehelpers/Cordova-sqlite-storage/issues... Luckily, you can still access IndexedDB from a web worker on both platforms (if you are able to use Safari's partial implementation). Also depending on what kind of work you're doing in the database, most of the action happens at the native level rather than the (DOM-blocking) JS level.
- _pmf_ 11y agoCan anyone using Xamarin chime in as to whether the situation there is better?
- vittore 11y agoWell you are getting native app with xamarin, so it must be better.
- SunboX 11y agoI heard a talk lately by two students that came to the result that it was a lot time consuming to debug. You have to get from native-code failures to your JS implementation. But I didn't try it myself by now.
- lnanek2 11y agoXamarin and Titanium compile to native code and use native components, so they wouldn't have the same problems as a JavaScript and HTML solution like Cordova does. Particularly re performance since they don't run in the web view widgets like Cordova.
- m_fayer 11y agoThe downside of xamarin is slightly unstable tooling, the occasional regression, and headaches associated with using native oss libs, though it is very much possible. And of course price. On the other hand, native-equivalent performance is no joke and c#/f# are great languages. Xamarin comes with some very sophisticated stuff like databinding, and high-level concurrency like rx, async/await, and akka.net which can really be a boon for performance, especially compared with js's comparatively meager concurrency options.
- blhack 11y agoEvery time I read one of these "this common, popular tool actually SUCKS", it seems like the author is trying to use it in a way it wasn't really intended (or obviously shouldn't be used). Of course you aren't going to get native performance out of cordova. You are going to get webview performance out of it. If you need native performance, write a native app.
- deleted 11y ago[deleted]