Thoughts about Capacitor

I don’t know, if this is the right cat for some thoughts about capacitor, but anyway…

The idea behind capacitor is really nice and needed for an out of the box design experience, but I’m not so lucky with its design.
I know it’s an early stage but the current repo looks a bit messy and not very well structured.

IMHO it would have been better to build capacitor by take existing ionic-native and fork/integrate all necessary cordova plugins plus some sugar like the file and database system.
Merge all together and use well structured namespaces and a clean dir structure. ionic-native would be the API, not just a cordova wrapper.

I might be totally wrong, so please see this a a discussion start, not as criticism.

So far I only tested the capacitor camera plugin and it was ok too me. I don’t mind note using ionic-native, since it’s a redesign. I even think it’s better in that way only what is accessible is really implemented, no frustration or bad surprises.

Could you describe what do you mean with “the current repo looks a bit messy”? I most probably didn’t went so far as you, I’m curious

I believe that is actually the ultimate goal / plan with Capacitor. If I am correct, what you see as Capacitor now is a product in its infancy. As it grows it will become more integrated with what is Ionic until eventually, they are fully integrated. I think.

There are a couple posts on the forum from the Ionic team / moderators that is like to revisit to confirm or deny that, but I’m pretty sure it’s the case. If not, then, I’m just straight up wrong…

I’ve looked through the repo and it’s not a finished product by any means. Some links lead to nothing, though I’m not sure what is meant by “messy”. I’m curious though and will look again.

But, for the sake of discussion I’ll say I don’t think that now is a time to form any judegement at all. Capacitors site literally states that it isn’t ready for production use. It’s available at this time for people to test, mess around with, and provide feedback.

I would place those same expectations on the git repo. I’m imagining one of my repos while I’m developing, and sometimes they’re not pretty. They’re also not nearly as expansive or ambitious as something like Capacitor.

Hi reedrichards, have you tried it in a PWA? Camera source Prompt doesn’t really work

You mean Capacitor in a PWA? In that case no.

But I did successfully try Capacitor’s camera in the browser (“ionic serve”). The tricks was to add the following in the index.html in order to use it, did you also did it?

  <script src='https://unpkg.com/@ionic/pwa-elements@0.0.11/dist/ionicpwaelements.js'></script>

see https://github.com/ionic-team/capacitor/blob/master/example/src/index.html

I did that. However, it always switches on the Webcam. I wasn’t able to select images from local disks. Actually something wrong with launching the actionsheet. Everything works on ios/anroid though.

Capacitor is buggy still. Now I am building my webapp using normal ionc 3 stuff(no cordova) and I am migrating my ionic 1 app to ionic 3+ionic native. Looks like it’s going to take a while before the new stack release and becomes stable. So the one codebase dream won’t come true any soon :slight_smile:

Actually you know I think I didn’t tried this. If it doesn’t work maybe you could open an issue in the Github of Capacitor. Provide a sample demo app that will help. Pretty sure they will be happy to have a look