-
Notifications
You must be signed in to change notification settings - Fork 671
Support livereload for ionic cordova run browser
#3043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
@janpio First a little explanation:
What I am hoping to accomplish is this: The only useful part of the Cordova browser platform is the browser shims that plugins provide. If you know your app will only target Android and iOS, then suddenly it's a pain to use I want to combine the useful parts of Here's what needs to happen for that to work:
Perhaps if it was |
The basic argument against the browser platform is that is pretty much an unkown. The idea is great, the implementation should be pretty straightforward, in reality... !? I am under the impression that only a very limited number of plugins has proper support that makes sense and actually helps. You sure know what a pain it would be to try improve that in the Cordova plugin ecosystem. Aren't you already "hijacking" Another idea, Cordova sure would be open to PRs or suggestions on improving or opening up the server so it makes more sense. Maybe this might be an alternative route? (I could run the |
Again, the Ionic CLI would make it very clear that the browser platform is only for testing an Android/iOS app in the browser, not for making a code base which works in Android/iOS and the browser.
But now we want to take a step back and let the framework CLIs fill in. We don't have the ability to mock responses from the dev server in I imagine we can do something much like this for |
Hi, I am having trouble understanding how to best run my ionic app for a browser on a remote server where there is no UI. I was using screen -d -m -L ionic cordova run browser -r -c -p 80 --nolivereload --nobrowser but then cordova doesn't work. This issue seems to be related to #3043 but maybe there is a different thread that is more closely related. Do you have any suggestions? |
@ianboru I would make a new issue. |
These two arguments are given against:
... are not to the point and have nothing to do with Ionic mission. I see a huge value in having Cordova in At a minimum, it is only consistent with Ionic being built on top of Cordova, and having parity for all Cordova platforms, regardless of their current state. I'm sure no one will be confused if Next, browser support in Cordova will be improving with time. And it is known to some people. It is only a matter of more contributions to browser platform in Cordova, as browsers these days support a lot of native functions like camera. Having Ionic fully support all Cordova platforms, including browser, will give it a boost and stimulate further development. Trying to patch Cordova's static server with livereload is futile, why waste energy there? I see the future when developing for all platforms will be possible in a single environment. And I believe Microsoft won't be it. |
@iva2k 100% agree, this is currently still a huge pain. |
I would also love to see this feature implemented. And as a try to convince others that is useful I would say that maybe most of the developers that are using ionic would target at least one mobile platform and with a mobile platform it comes at least one native plugin. And because "ionic serve" is the most used and easy way to develop it would be also very helpful to have the native plugins running when you are developing. I agree that not all of them are working on the browser platform, but still most of them are working and it will be a plus for sure. |
Just leaving a super quick note: This may be possible in CLI 4/Ionic 4 by running the following:
(untested) |
sweet! |
Support for httpS while developing locally is redirected around several repos and issues, this is as far as I've been able to track it. Is there ANY plans to support something like "ionic serve -ssl"? Right now there's no reasonable way to develop anything with Geolocation. |
@raelmiu This issue has little to do with HTTPS. You are looking for this 👉 #3305 |
The link you gave me is just the run-around I described @dwieeb. |
@dwieeb it's not working for us on 4.1.2 We were able to run the app on 3.20 with:
Unable to run with |
Any updates on this? |
The above command is working fine. |
for ionic 3 I was successfully running
depending on number of plugins - including an app supportig facebook login as an only authentication method - being unable to run cordova plugins in a browser (where available) i a blocker |
can confirm that
works - even the livereload works of course you also need to add
|
Yep, these commands are the workaround: $ ionic cordova build browser
$ ionic serve --cordova --platform browser This issue is here for implementing |
being able to wire this into e2e to test the app with available cordova plugins would be awesome... |
while How I managed to do that now is just spawn the server as above and then separately do
how we can make it i one go? do we need a dediated ticket for |
First add support for cordova platform browser. Build for the browser. Serve cordova for the browser platform, this will have live reload when editing your source files. Now I can use Google Maps Native in browser for development. Could this be simplified so that |
I have this working, but what is the consensus in this community for building an application with cordova browser for production? I think I can do it... but... should I? Some of my users would love to use a desktop version of the app, but I can't find any good resources for using cordova browser as a production desktop application. |
Hmm I don't think cordova browser support is meant to be use in production. In such case probably it may be better to consider PWA and/or capacitor. While it is often raised/discussed under tickets, SO questions and so whether brower should have cordova support at all, I think it should be clearly stated in ionic docs what is cordova browser support status. Also I agree that there are use cases for which reusing same codebase also for web. |
Well I use ionic google maps, so If I go with a PWA, then that means I just make a js fallback rather than use cordova, which means i have to write two sets of code for this case. Unless I take a "risk" and use cordova browser in production, which is unclear for me. This is considering the fact that Cordova Google Maps works perfectly in the browser for me. And capacitor doesn't support Google Maps, and there is no community plugin. I have to use cordova browser. (I've tried it). I think this entire issue is indicative of unclear documentation about the ionic / cordova ecosystem for desktop apps. It's unclear because the ionic google map docs specifically provide instructions for setting up with a browser ..! |
I use cordova browser just fine in production. Some cordova plugins do not support the browser platform. In this case for my
You can also use this approach to provide a better web based alternative by replacing the Ionic Native plugin class via the Dependency Injector with your own that mimics the API |
ionic serve
ionic cordova run browser
|
@adamduren that's a great solution to mitigate the risk of other cordova plugins that aren't supported in the browser. Thanks! |
Backstory in this issue: #3043 resolves #2561 resolves ionic-team/ionic-docs#826
EDIT: |
origin: #3036 and #3036 (comment)
We can inject all the Cordova www assets into the livereload dev server, providing a nice experience for developing mobile apps in
ionic serve
.📝 Note: for developing cross-platform apps (attempting to target mobile AND desktop), I still highly recommend not using the Cordova browser platform. My reasoning is here: #2312 (comment)
The text was updated successfully, but these errors were encountered: