Adds new JSX tutorial#557
Conversation
boutell
left a comment
There was a problem hiding this comment.
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."
|
|
||
| ## 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)`. |
There was a problem hiding this comment.
👍 This was making me a little twitchy, but reading it simply as a recommendation I feel you've sufficiently covered the concern.
There was a problem hiding this comment.
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.
boutell
left a comment
There was a problem hiding this comment.
Yes, you've convinced me, now you have to implement caching LOL
Please indicate which branch this PR should merge into:
Check one
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:
What kind of change does this PR introduce?
(Check at least one)
Make sure the PR fulfills these requirements:
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: