Skip to content

Conversation

@soundproofboot
Copy link
Contributor

@soundproofboot soundproofboot commented Jul 16, 2025

resolves #4165

Changes:

  • Update code blocks and text for the Vue Photo App tutorial to show additional context for each step with comments to indicate new lines.

Preview

@soundproofboot soundproofboot requested a review from a team as a code owner July 16, 2025 17:56
@vercel
Copy link

vercel bot commented Jul 16, 2025

@soundproofboot is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Jul 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
ionic-docs Ready Ready Preview Comment Nov 6, 2025 10:36pm

Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

Minor nitpick

Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

I noticed that some method names from the Angular version and Vue version do not match even though they have the same code. For example, addNewToGallery from Angular and usePhotoGallery from Vue. Let's also sync those to match Angular as close as possible.

The same goes for the <title>. Let's match it to Angular.

Lastly, some of the content also doesn't match each other. A good example, Angular Build Your First App mentions:

We put the visual aspects of our app into <ion-content>. In this case, it’s where we’ll add a button that opens the device’s camera as well as displays the image captured by the camera. Start by adding a [floating action button](https://ionicframework.com/docs/api/fab) (FAB) to the bottom of the page and set the camera image as the icon.

While Vue states:

We put the visual aspects of our app into <ion-content>. In this case, it’s where we’ll add a button that opens the device’s camera as well as displays the image captured by the camera. But first, remove both the ExploreContainer component and its import statement:

It should match the steps of Angular.

@soundproofboot
Copy link
Contributor Author

@thetaPC Hi Maria, I tried to make the titles match in Vue and added some <head> content that was in the Angular pages but not Vue. I changed the name of the takePhoto method to addNewGallery to match the Angular method that is comparable. One thing worth noting is these tutorials link to repos so I was trying to not change the code too much and leave the documentation not matching the repo.

On making the steps match Angular, there are more steps required for Vue in that specific case so I think they are slightly reordered to clarify what's being removed and added in Vue (as in remove these two things before we add these other several things) vs. Angular, where I was able to clearly indicate what to remove and add in one code block. I have not looked at this in a while so it may take me a minute to familiarize myself with the frameworks and changes but I'm willing to keep working on this if there are other suggestions.

@thetaPC
Copy link
Contributor

thetaPC commented Oct 22, 2025

@soundproofboot thank you so much! To ensure that all 'Your First App' PRs are merged more quickly, I will be assisting to push them to completion. The main obstacle is synchronizing all three frameworks. Please bear with me as I make the necessary changes.

Copy link
Member

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

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

Requested some changes on v8 that will also apply to v7. 🙂

Next, create an Ionic Vue app that uses the "Tabs" starter template and adds Capacitor for native functionality:

```shell
ionic start photo-gallery tabs --type vue
Copy link
Member

Choose a reason for hiding this comment

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

Why does Angular pass --capacitor but we don't here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Honestly not sure. This command was here before the edits so I figured that there was a reason for it. Do you think we can remove it from Angular?

Copy link
Member

Choose a reason for hiding this comment

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

The CLI sets it automatically for all of them (except if cordova is passed for Angular), so it looks like we can remove it for Angular and React too:

  if (this.schema.type === 'react' || this.schema.type === 'vue') {
    options['capacitor'] = true;
  }

  if (
    (this.schema.type === 'angular' || this.schema.type === 'angular-standalone')
    && options['cordova'] === null
  ) {
    options['capacitor'] = true;
  }


```html
```vue
<ion-title>Photo Gallery</ion-title>
Copy link
Member

Choose a reason for hiding this comment

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

This may be confusing if people interpret it to change the large title to this:

-<ion-title size="large">Tab 2</ion-title>
+<ion-title>Photo Gallery</ion-title>

I realize this is the same as the Angular example, just pointing it out because I didn't notice it until this review.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Made the change for Angular: c19dbea

Copy link
Member

Choose a reason for hiding this comment

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

IonGrid,
IonRow,
IonCol,
IonImg,
Copy link
Member

Choose a reason for hiding this comment

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

A lot of these imports are unused:

Image

They seem to be used later on. Do we want to show the imports being added when they're actually used?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was leaning towards showing them as they get added but I ended up working on this too much that I decided to leave it in as is.

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm okay. I think it would be a better user experience if they didn't have errors in their IDE while going through the steps. Maybe we can make a follow-up task for this?

When running on mobile, set `filepath` to the result of the `writeFile()` operation - `savedFile.uri`. When setting the `webviewPath`, use the special `Capacitor.convertFileSrc()` method ([details on the File Protocol](../../core-concepts/webview.md#file-protocol)). To use this method, we'll need to import Capacitor into `usePhotoGallery.ts`.

```ts
import { Capacitor } from '@capacitor/core';
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

The previous sentence (before the code block) also needs to be removed:

CleanShot 2025-11-07 at 10 35 09@2x


Then update `savePicture()` to look like the following:

```ts
Copy link
Member

Choose a reason for hiding this comment

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

Looking at this from a broader perspective, I think this example is much easier to follow. When we're updating an existing function, it makes more sense to show only that function. When we're adding a new function, then it's helpful to include the surrounding code for context.

In other examples we show the surrounding code even when nothing in it changes, but that isn't necessary if the updates apply only to one function:

Image

(Above screenshot taken from Platform-specific Logic section)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, the reason I did this was because the examples with the surrounding code were shown at the beginning of the tutorial. As the developer progresses, I expect them to feel comfortable with what they've done so we don't need to have the surrounding code as they would know where in the file is the update function. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry I don't think I was clear. I like that you are only showing the function itself and not the surrounding code when the changes are limited to that function. I was just saying, in general, I think we should do it this way in more places. It's less confusing.


```html
```vue
<ion-title>Photo Gallery</ion-title>
Copy link
Member

Choose a reason for hiding this comment

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

IonGrid,
IonRow,
IonCol,
IonImg,
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm okay. I think it would be a better user experience if they didn't have errors in their IDE while going through the steps. Maybe we can make a follow-up task for this?

When running on mobile, set `filepath` to the result of the `writeFile()` operation - `savedFile.uri`. When setting the `webviewPath`, use the special `Capacitor.convertFileSrc()` method ([details on the File Protocol](../../core-concepts/webview.md#file-protocol)). To use this method, we'll need to import Capacitor into `usePhotoGallery.ts`.

```ts
import { Capacitor } from '@capacitor/core';
Copy link
Member

Choose a reason for hiding this comment

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

The previous sentence (before the code block) also needs to be removed:

CleanShot 2025-11-07 at 10 35 09@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

content: "Your First App" tutorial should show complete code context - Vue

3 participants