quasar
quasar copied to clipboard
feat: Add Capacitor 4 support
What kind of change does this PR introduce?
- [ ] Bugfix
- [x] Feature
- [ ] Documentation
- [ ] Code style update
- [ ] Refactor
- [ ] Build-related changes
- [ ] Other, please describe:
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
The PR fulfills these requirements:
- [x] It's submitted to the
devbranch (orv[X]branch) - [ ] When resolving a specific issue, it's referenced in the PR's title (e.g.
fix: #xxx[,#xxx], where "xxx" is the issue number) - [ ] It's been tested on a Cordova (iOS, Android) app
- [ ] It's been tested on an Electron app
- [ ] Any necessary documentation has been added or updated in the docs or explained in the PR's description.
If adding a new feature, the PR's description includes:
- [ ] A convincing reason for adding this feature (to avoid wasting your time, it's best to start a new feature discussion first and wait for approval before working on it)
Other information:
Remove the -beta.0 from the platform version installed
update the template to use ^4.0.0 for capacitor packages
patch MainActivity to add EnableHttpsSelfSigned on Capacitor 4
Disclaimer: Only tested for vite, for webpack I pasted the changes Didn't patch self signed certificates for iOS as it was not working on Capacitor 2 neither (I just get an "infinite loop" of server connection lost. polling for restart... messages on Xcode console)
Thanks for contributing! You'll have to wait a bit until I merge this. Will go into q/app-vite v1.2 (probably next week).
Hi @jcesarmobile, I upgraded my project to capacitor 4 and tried using the same solution but now it breaks all of the plugins. (Plugin Not Implemented error)
The only solution that worked is using your plugin @jcesarmobile/ssl-skip.
Any updates on this? Would be nice to import Plugins for Capacitor the new way like in v3 and v4 :)
Updates??
Any updates???
Updates?
@rstoenescu Can we get this merged in?
It seems that there are still a couple of blockers regarding this PR. You can see in the roadmap (https://github.com/quasarframework/quasar/blob/dev/ROADMAP.md) that supporting Capacitor 4 is planned for Q2. :)
We took a look a while back but there are many things which needs to be tested and adapted before merging this in, so it'll still have to wait a bit before we can provide it the love it deserves, at least after we complete the CJS >> ESM migration for many Quasar packages and the release of new docs
I literally provided an update 2 days ago and it's listed into the ROADMAP to be implemented by Q2 of this year since last month...
Any updates? Capacitor is in v5 now.
@HiPhone-Chan & all - PLEASE read the prior posts before responding! Literally the post above the last was an update message and 2 more before that ANOTHER update message! Certainly not doing any good taking focus away from product development to answer the same question repeatedly.
As for v5 it is alpha and certainly not anything that needs to be considered in this request!
Thanks @Larry-Home @IlCallo , appraciate your work
FYI Capacitor v5 was released a couple of days ago and it seems to be an important upgrade as older versions of capacitor might not work anymore on newer devices (https://ionic.io/blog/announcing-capacitor-5)
Thanks for contributing! It seems that there is an officially advertised way to go with SSL dev support. Implemented it.
This will go into q/app-vite 1.4.0 and q/app-webpack 3.9.0
Appreciate the efforts to get this moving forward and communication on the status. Thanks!
If anyone to thank to, it's @jcesarmobile for his package (@jcesarmobile/ssl-skip) which became the official way of doing it.
I wouldn't consider @jcesarmobile/ssl-skip the official way of doing it.
I haven't had the chance to look at the code that adds the plugin, but you should remove the plugin for release builds as it can cause app rejections in the stores (maybe it already does it, as I said, didn't look at the code yet)
It's only installed when in dev mode, not for production builds
It's recommended right on Capacitor's documentation website, so that would make it official.
Do these changes also enable support for capacitor v5? :)
They seem to do, but there's a catch. The only reason I haven't explicitly stated this is that the current Capacitor v5 has an Android bug (opening up the IDE will trigger an error) -- and this is by default, with nothing changed from our part. Once this is sorted out, we'll announce v5 support too. However, should you want to use it right now, you can go ahead.
They seem to do, but there's a catch. The only reason I haven't explicitly stated this is that the current Capacitor v5 has an Android bug (opening up the IDE will trigger an error) -- and this is by default, with nothing changed from our part. Once this is sorted out, we'll announce v5 support too. However, should you want to use it right now, you can go ahead.
I'm using Capacitor v5 and I'm not getting an error when running the following command:
quasar dev -m capacitor -T android
We fixed the Capacitor 5 error some months ago IIRC
The plugin is only installed when in dev mode, but I believe that then switching to build mode doesn't cause the file EnableHttpsSelfSigned.java to be removed if it is already there. This ends up causing a Security and Trust issue in the Play Store. It is easy to fix (just delete the file and re-build), but it would be nice to have the file removed automatically, or at least have the issue documented somewhere.
@ctrengove But it is automatically removed. Please make sure that you have the latest q/app-vite or q/app-webpack