samples-electron icon indicating copy to clipboard operation
samples-electron copied to clipboard

Updating old samples

Open aolney opened this issue 8 years ago • 6 comments

I'd like to update the old samples. I like how the browser samples are all nested under a single control structure; this avoids the cruft/obfuscation of lots of little projects.

There are a couple of ways this could be done with electron. Some of the old samples use Elmish and some don't. If we made all samples use Elmish, then Elmish would provide the overall control and each sample would implement a little view within that. Mixing browser and Elmish seems like a bad idea unless each of the Elmish update loops was somehow scoped to the single page representing the sample.

Any concerns or thoughts about the above plan?

aolney avatar Nov 03 '17 22:11 aolney

I think we discussed this with @MangelMaxime and we opted to have independent samples, because the structure of an Electron app was more complex and it was difficult for users to isolate a single project if they shared too many resources. But I don't remember well...

alfonsogarciacaro avatar Nov 07 '17 14:11 alfonsogarciacaro

I prefer independent samples because it simpler to use.

Also, I see no benefit to add the same samples as the ones from Elmish repo or samples-browser repo, etc.. This will only increase the maintenance cost and here we are looking at samples for Electron API not how to use the Browser API IMO.

MangelMaxime avatar Nov 07 '17 14:11 MangelMaxime

That sounds reasonable to me. The only old sample that I believe meets those criteria is the browser sample, which uses electron's webview.

In my PR, should I take everything in the current root of samples-electron and drop it into a folder for that sample (e.g. `file-explorer1)?

aolney avatar Nov 09 '17 00:11 aolney

@aolney To be fair, when I did this sample I didn't found a solution to have a good multiple samples architecture so I discarded this point 😄

It would be nice if we could have something similar to the others samples with some kind of an index page listing all the samples.

Or perhaps if it make sample add a feature using the webview to the current sample if it's simpler.

MangelMaxime avatar Nov 09 '17 06:11 MangelMaxime

Here are some existing examples of the two structures we've discussed:

  1. Each sample an independent subfolder
  2. Browseable samples

FWIW on the 2nd option, it has great coverage of the Electron API, but a complete Fable implementation would be pretty ambitious to take on. Probably more than I can do right now 🐌

aolney avatar Nov 14 '17 16:11 aolney

Both have pros and cons.

One folder per sample make it easy for new people to copy paste the repo and experiment from it. But this add a lot of noise and updating their deps for example is harder.

The second is less user friendly but I tend to prefer it as a maintainer. Of course I can try it or help you if you want to give it a try

MangelMaxime avatar Nov 14 '17 22:11 MangelMaxime