Skip to content
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

[gh11385] Updated the generated page template #11533

Merged
merged 12 commits into from
Sep 12, 2024

Conversation

ahaywood
Copy link
Contributor

@ahaywood ahaywood commented Sep 11, 2024

Fixes #11385

Feature description

When you create a brand new page, the template includes a <Link /> to that page.

<p>
        My default route is named <code>upgradeGuide</code>, link to me with `
        <Link to={routes.upgradeGuide()}>UpgradeGuide</Link>`
</p>

If you already created a parameter with the routes.tsx file

Then, the first time you load the page in the browser, you'll get an error because you didn't specify a parameter within the Link Every once in a while this still throws me off.

Analysis and Design

I considered using a <pre> tag or a <code> tag, but it would still throw the same error.

Solution description

I updated all the templates to include the path within a comment.

@ahaywood ahaywood self-assigned this Sep 11, 2024
@ahaywood
Copy link
Contributor Author

@Josh-Walker-GM I could use your help with the tests (please) -- I updated the fixtures, but it looked like there was also a snapshot file that will need to be updated.

@Josh-Walker-GM Josh-Walker-GM added the release:feature This PR introduces a new feature label Sep 11, 2024
@Josh-Walker-GM Josh-Walker-GM added this to the next-release milestone Sep 11, 2024
Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM left a comment

Choose a reason for hiding this comment

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

@ahaywood awesome. I tweaked a little as we discussed. If you want to sanity check and then merge it looks good to me!

@ahaywood ahaywood merged commit 1ef6e4a into main Sep 12, 2024
50 checks passed
@ahaywood ahaywood deleted the gh11385-update-generated-page-template branch September 12, 2024 01:30
Josh-Walker-GM added a commit that referenced this pull request Sep 16, 2024
Fixes #11385 

## Feature description

When you create a brand new page, the template includes a `<Link />` to
that page.

```
<p>
        My default route is named <code>upgradeGuide</code>, link to me with `
        <Link to={routes.upgradeGuide()}>UpgradeGuide</Link>`
</p>
```

If you already created a parameter with the routes.tsx file

<Route path="/upgrade/{slug:string}" page={UpgradeGuideIndividualPage}
name="upgradeGuideIndividual" />

Then, the first time you load the page in the browser, you'll get an
error because you didn't specify a parameter within the Link Every once
in a while this still throws me off.

## Analysis and Design

I considered using a `<pre>` tag or a `<code>` tag, but it would still
throw the same error.

## Solution description

I updated all the templates to include the path within a comment.

---------

Co-authored-by: Josh GM Walker <56300765+Josh-Walker-GM@users.noreply.github.com>
@Josh-Walker-GM Josh-Walker-GM modified the milestones: next-release, v8.2.0 Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:feature This PR introduces a new feature
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Change the generated page template
3 participants