Skip to content

Adds new JSX tutorial#557

Open
BoDonkey wants to merge 3 commits into
mainfrom
add-jsx-tut-updates
Open

Adds new JSX tutorial#557
BoDonkey wants to merge 3 commits into
mainfrom
add-jsx-tut-updates

Conversation

@BoDonkey

@BoDonkey BoDonkey commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Please indicate which branch this PR should merge into:

Check one

  • main
  • latest
  • stable
  • Check if this PR will be resubmitted against another branch

Summary

Summarize the changes briefly, including which issue/ticket this resolves. If it closes an existing Github issue, include "Closes #[issue number]"
This PR creates a new tutorial for using JSX templates to create a weather widget. The original JSX weather widget tutorial will be updated in a separate PR.

What are the specific steps to test this change?

For example:

  1. Run the website and log in as an admin
  2. Open a piece manager modal and select several pieces
  3. Click the "Archive" button on the top left of the manager and confirm that it should proceed
  4. Check that all pieces have been archived properly

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

Make sure the PR fulfills these requirements:

  • It includes a) the existing issue ID being resolved, b) a convincing reason for adding this feature, or c) a clear description of the bug it resolves
  • The changelog is updated
  • Related documentation has been updated
  • Related tests have been updated

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

@BoDonkey BoDonkey requested a review from boutell July 8, 2026 19:18

@boutell boutell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's great! You addressed pretty much all the concerns I have about this particular use case, and having a side-by-side example in our docs is just too much of a win not to do it.

But you can guess my one concern: making the case for better SEO with server-side.

It's worth talking through at the end. How about:

"Building the weather widget both front and back-end makes a great side-by-side example. The current weather doesn't usually matter for SEO, so both are OK. But when you do care about SEO for the content, server-side JSX is a big win over browser-side. Google will index it much faster. And some AI chatbots might not index browser-side at all."

Comment thread docs/tutorials/server-side-jsx.md Outdated

## Going further

**Caching** — This tutorial fetches fresh data on every page request to keep the example focused. In production, cache the response so page rendering does not depend on an external API call for every request. The `apos.cache` API is available in the template via the `apos` argument: `await apos.cache.get('weather', city)` / `await apos.cache.set('weather', city, data, 600)`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 This was making me a little twitchy, but reading it simply as a recommendation I feel you've sufficiently covered the concern.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you want me to move the caching into the code and talk about it there? Thinking about it, I actually needed a good reason to talk about accessing apos.

@BoDonkey BoDonkey requested a review from boutell July 8, 2026 19:46

@boutell boutell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, you've convinced me, now you have to implement caching LOL

@BoDonkey BoDonkey requested a review from boutell July 8, 2026 20:27
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.

2 participants