Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[Documentation] hello upward tutorial #1080
[Documentation] hello upward tutorial #1080
Changes from all commits
c2bd564
3877ccd
75cef9c
4b530ee
5327284
1cbb1fb
0162415
b00382e
c916d40
f351945
57a32c3
63aceb5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this topic can be made much simpler by getting rid of all the "extras" around React.
Since React doesn't actually need JSX you can get rid of the dependency on
babel
andwebpack
here.Check it out:
hello-world.mst
Notice that the template is pulling in React and React DOM from CDNs. This eliminates the need to install them locally.
app.js
Notice that we aren't using JSX here and instead using the
React.createElement
function directly. This is what Babel does for you.The only thing left to do is fix up the UPWARD spec a bit:
Since this is an UPWARD tutorial, I think this greatly simplifies the topic and introduces readers to the
FileResolver
more quickly.We probably want to include a paragraph about how production code should use webpack and babel but I don't think they need to be introduced in this tutorial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though it's billed as an UPWARD tutorial, I also wanted the end result of doing this tutorial to be an environment that the reader can use as a starting point for their PWA Studio projects. This is something the community has been asking us for.
It's true that React doesn't require JSX, but most examples out there use JSX and ES6 syntax. I think it would be a bad experience for developers if we introduce how something is done in the tutorial and promote something very different in the implementation code.