Skip to content

[Cookbook] Add Electron + Vue cookbook #1681

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

konaraddi
Copy link

Closes #1573 and improves upon #1611

For the Base Example section, I had to deviate from the guidelines a bit to provide enough steps for the reader to follow. Please let me know if and what changes need to be made. Thanks!

@sdras sdras added the cookbook label Jun 17, 2018
@sdras
Copy link
Member

sdras commented Jun 17, 2018

Thanks! I'll take a look soon

@konaraddi
Copy link
Author

Hi @sdras , would you be able to review the cookbook? If not, no worries (I totally understand if you're time is better spent elsewhere!)

@sdras
Copy link
Member

sdras commented Sep 11, 2018

I know you've waited a bit and apologize on the delay! but I'm still on honeymoon until later this week. I will get back to you next week at the latest. Thanks for the ping.

@konaraddi
Copy link
Author

Thanks! Enjoy your honeymoon!

@sdras
Copy link
Member

sdras commented Sep 20, 2018

Hi there @konaraddi! I'm back.

So, this is incredibly promising and well written. I think it will be a great addition. However, the Vue CLI was upgraded a little bit ago- I tested it out and this version is only compatible with the older version of the CLI, not 3. Could you please work on it so that it will work with that version? https://cli.vuejs.org/

Once that is done, I'll give it a more thorough review. Thanks for your work on it!

package.json Outdated
@@ -2,7 +2,7 @@
"name": "vuejs.org",
"private": true,
"hexo": {
"version": "3.7.0"
"version": "3.7.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change necessary for the PR?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, I bumped it back down in 28d53af. I don't remember specifically wanting to bump up the version of hexo (I haven't use hexo elsewhere); might be from running npm install. Anyways, I'll be sure to commit only the necessary files next time. Thanks!

</template>

<script>
export default {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO this code example is a bit too long, which makes it harder for 1) readers to follow and 2) maintainers to sync between the markdown and the raw scripts. Can we use something shorter e.g. (OTOMH) the todo app?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered the todo app but went with the timer because building a timer

  • is quick to build and easy to understand what the code is doing
  • is a small amount of code (and less code than results for todo lists built with Vue on GitHub)

A timer lets us focus on the Electron part of the cookbook. I think with a todo list I'd be spending most of the tutorial on how to build a todo list in Vue, and many existing tutorials for Vue involve building todo lists.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still maintain that the current code is too long for a cookbook. I personally find it hard to follow, and would like to think that defeats the purpose.
Btw (and I missed this before), it would be far better IMHO if we don't need to rely on a third party boilerplate (simulatedgreg/electron-vue) for this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @phanan, I think this cookbook entry is valuable but it strays from the point sometimes. In this cookbook you probably shouldn't be explaining computed properties and refactoring. It would be better to show a bit of the code, and have the full thing hosted elsewhere, and then build on that by only what's changed with one line for context and an ellipsis [...] to convey there's more

Otherwise, you would have to go the other route with a much smaller example. You can make a really small Vue to do that's more immediately legible than the timer.

@konaraddi
Copy link
Author

Should I copy and paste the package-lock.json from vuejs/vuejs.org to konaraddi/vuejs.org to fix the conflict?

@konaraddi
Copy link
Author

@sdras @phanan I updated the cookbook for Vue CLI 3, can you have a look whenever you have time?


Next, let's add buttons for setting the timer's default value. We'll need to add variables for the default minutes and seconds too. When we click the Reset button, our timer will set itself to the default minutes and seconds variables. Make the changes indicated in the comments below.

```vue<template>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be on a separate line, like:

... vue
<template>

(can't put backticks in because it would break, but hopefully you get the drift)

Copy link
Member

@sdras sdras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really nice start but we do need to refactor the examples a bit to make it read a little more seamlessly. Perhaps try to imagine that you're someone with great proficiency with Vue but isn't aware of how it works with electron, what's the smallest and most concise amount of information you'd need to get the point across? Thanks for your contribution!

</template>

<script>
export default {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @phanan, I think this cookbook entry is valuable but it strays from the point sometimes. In this cookbook you probably shouldn't be explaining computed properties and refactoring. It would be better to show a bit of the code, and have the full thing hosted elsewhere, and then build on that by only what's changed with one line for context and an ellipsis [...] to convey there's more

Otherwise, you would have to go the other route with a much smaller example. You can make a really small Vue to do that's more immediately legible than the timer.

---
title: Building Desktop Apps with Electron and Vue
type: cookbook
order: 13
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we're past 13 now, this should be updated

@sdras
Copy link
Member

sdras commented Apr 17, 2019

Any news on this one? Would you like some help getting it done?

In the future, we'll be using Google Docs for all these changes so it can go a little faster.

@konaraddi
Copy link
Author

Hi Sarah, thanks for following up! Currently busy with school work and other commitments but I can work on a rewrite in June. Does that work?

@sdras
Copy link
Member

sdras commented Apr 17, 2019

Yep, that works! Thank you for the update @konaraddi :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cookbook Idea] Building a desktop application with Electron and Vue
3 participants