cordova-docs icon indicating copy to clipboard operation
cordova-docs copied to clipboard

Recommended dev tooling

Open brody4hire opened this issue 5 years ago • 8 comments

Feature Request

List of recommended tools for someone to get started with mobile development, such as Node.js, decent editor, recommended Windows shells, etc.

Also there is no mention of prerequisite tools in the Get Started Fast section of the Cordova homepage. (I would be happy to move this part to a separate issue, if needed.)

Motivation Behind Feature

Discussion in issue #960 made me realize that this kind of information is not published in the Cordova docs.

I think we should not assume very much knowledge about dev tools from new Cordova users.

Feature Description

Alternatives or Workarounds

  • Add pointers to relevant tutorials, blog articles, and videos (there should be plenty good info already published, in many languages)

I hope to contribute the solution someday (sorry I cannot make any promises at this point).

brody4hire avatar Apr 03 '19 20:04 brody4hire

My response to a few items by @dball-adashi in https://github.com/apache/cordova-docs/issues/960#issuecomment-479708826:

I installed cmder.net but unfortunately it does not seem to allow running tmux. If it does, how was not obvious to me.

For me, ideal development with cordova would be completely cross platform with either Visual Studio Code or the tmux/vim/plugins combination. Any suggestions on how I can get there with tmux and an ability to use an updated version of vim would be appreciated.

I found a couple interesting articles from a quick search:

As far as I can tell, MinGW (Git Bash) is working well for cordova. But then again, perhaps something is not working that I just attributed to a bug in cordova and moved on.

Makes sense, really interesting. I tried using Git Bash maybe 4-6 years ago, don't remember if or how much I was able to use Cordova with Git Bash.

brody4hire avatar Apr 04 '19 01:04 brody4hire

Do you think the Cordova docs should have general pointers to getting started with mobile development?

dblotsky avatar Apr 04 '19 04:04 dblotsky

From my perspective, the documentation on the Cordova site with the links to the other sites is/was sufficient. Since this was spawned from my original issue #960 let me provide some context.

We are mostly a windows shop. When we moved into web we continued to develop on Windows. We got up to speed on nodejs, built some custom tooling using typescript with nodejs and settled on angular for our web clients. The custom tooling basically creates and manages projects from templates and dependencies between those "npm projects" stored within a single git repository. It can wholesale update all dependencies, perform dev builds, production builds, watch for changes, ... I.e. everything I think you would need to maximize code sharing between projects and applications without dealing with symlinks and having to manually rebuild all items. The goal we accomplished was to be able to add/modify any class in the lowest level "project/package" that was ideal for sharing between applications and have the build system see the change and automatically figure out what needs building, what broke, and automatically update the dependencies that web pack is serving live to the application under development. For an IDE, we started with WebStorm and them moved to VS code. For running command line prompts, we started in the DOS Cmd prompt and powershell. We later moved to git bash. As our knowledge grew we started scripting all aspects not handled by our custom node js build system in bash so it could run on both OSX and Windows as this was required for our Cordova projects. These scripts guarantee all global dependencies are met (both system configuration and global packages) and perform all of the steps of configuring and/or reconfiguring projects to build and validate every application we currently support and prepare them for all of our deployments.

Our initial use of Cordova was used under the DOS Cmd prompt and powershell and then graduated to Git Bash (MinGW). As far as I know all of this worked perfectly. But of course attempting to push the boundaries of development efficiency, we are starting to reevaluate the use of VSCode. A combination of Vim, TMUX, and some Vim plugins such as YCM are looking very tempting. These are still under evaluation.

Where we got into trouble was when we started running cordova from within tmux within cygwin. Tmux is not easy to add to GitBash (although) someone did identify how they did it. We should probably look at a full MinGW install (TODO). An evaluation of Ubuntu on WSL found that this was problematic based on its hybrid approach to using the same commands as were on the windows system. Instead we found cygwin and it seemed to work amazingly. Turns out it does not always work as expected. Yesterday I spent between 1 to 3 hours trying to figure out why Cordova failed to add any plugins that were from the local file system or a git repository. I was asking myself if it broke recently, if it was maintained, tested, ...? I then stumbled across a link that implied it may be due to being run as a subprocess. I tried to rerun the commands that should have originally worked before I started tweaking them back in git bash. It worked perfectly.

Btw, the responsiveness of @brodybits was amazing.

I now know linux, OSX, and bash scripting reasonably well. I could not say that when we started down this path. In hindsight I would not favor developing these types of applications on Windows if Linux or OSX was a possibility. But it is definitely doable on Windows.

I believe I have read every page of the Cordova site over time and some pages multiple times when I came back to them. The links to pages to understand for native development were good for anyone who would take the time to read them.

At least in my case, I don't think improved documentation (as it is already good) would have avoided this issue as eventually I would probably search for a faster way to use the tools that would likely go outside of the environments you can cost effectively test.

But thinking back to the beginning, a step by step walkthrough of every tool that you would recommend using on Windows from the IDE to shells may have been helpful. And if you recommend testing any cordova failure back on this environment if there is an issue, maybe I would have remembered that and tried that initially. My ignorance, by not considering that the cordova command (or one of the commands it calls) might work differently in a different shell, is what caused my issue here.

cordiosd avatar Apr 04 '19 18:04 cordiosd

Update: I tried MinGW. But I currently think that msys2 (http://www.msys2.org/) is a much better solution for a build environment for nodejs based development systems. While msys2 is based on cygwin, the goals are different. It comes with the package manager, pacman. After installing it, I had to use pacman to install vim and tmux and then set an environment variable for it to inherit my windows paths. But this looks like the solution I was looking for and so far everything has worked well.

If git bash is not cutting it for you, I would currently recommend moving to msys2 as it is close to git bash while introducing the package manager to get valuable tools like tmux.

Thank you to @brodybits and @oliversalzburg for providing the guidance and direction to work through this. Hopefully this will be helpful to someone else on developing with node based tools on windows.

cordiosd avatar Apr 05 '19 00:04 cordiosd

Thanks for the pointer to msys2 and for reporting your results in general, and thanks to @oliversalzburg for reporting some positive results with CygWin and Cordova 9.0 in https://github.com/apache/cordova-docs/issues/960#issuecomment-479789349.

I used to really like to experiment with these tools on Windows, don't have so much time or patience for it these days. I think we should recommend the more standard tools on Windows. In case others are able to test and document things working consistently with tools such as Cygwin I think it would be very welcome.

brody4hire avatar Apr 05 '19 01:04 brody4hire

We have been a Windows-shop since the start but have always had a strong desire to even out differences with Linux backends. We have experienced all of the pains associated with that desire (VMs, Vagrant, Containers, SSH, WSL, every single shell there is, trying to actually work with Windows shells, ...).

What we learned from all of it is: Don't try to reach too high. A solid working bash is good enough and lightyears ahead of PowerShell (when working with tools like Cordova).

In general, if we want Cordova to work on Windows, we shouldn't recommend that people start by installing a different shell. As bad as it is, Cordova should primarily work with the native environment (which it does to my knowledge). So I'm not sure if there's cause for action. Even maintaining a list of known issues with certain setups seems like it would be a task that would just be neglected in favor of more important tasks.

oliversalzburg avatar Apr 05 '19 08:04 oliversalzburg

@oliversalzburg Thank you.

cordiosd avatar Apr 05 '19 21:04 cordiosd

For a npm version manager, I would recommend that people consider using https://github.com/jasongin/nvs which is mostly JavaScript and works seamlessly across the various kinds Windows shells, mac OS, and other *nix.

brody4hire avatar May 10 '19 20:05 brody4hire

Closing out as not planned,

Development environment tooling is each and everyone's own choice.

It is best to not add more documentation for third-party tooling that is not mandatory for developing or using Cordova. There are many options and to provide a recommendation is opinionated.

Command Prompt and PowerShell are first-party to the Windows OS and don't require additional download and installation.

I do understand that some third-party terminals can be far better than the OS standard terminal and packed with a lot of features, but I think it is still up to the developers to find, test, and configure what they want.

If we were to start adding documentation, then it would be expected that we are testing and validating these terminals as supported.

At most, somebody could submit a PR to add terminals and version managers to the third-party tooling page, but we need to clearly state that it may or may not work. We do not test nor support: https://cordova.apache.org/docs/en/11.x/third-party/index.html

erisu avatar May 31 '23 09:05 erisu