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

ENDOC-504 Start updating the React MFE tutorial. #514

Merged
merged 4 commits into from
May 27, 2022
Merged

ENDOC-504 Start updating the React MFE tutorial. #514

merged 4 commits into from
May 27, 2022

Conversation

nshaw
Copy link
Contributor

@nshaw nshaw commented May 25, 2022

No description provided.

@nshaw nshaw requested review from jyunmitch and Lyd1aCla1r3 May 25, 2022 19:45
We'll use [Create React App](https://create-react-app.dev/) to generate a simple app in seconds.
1. Create 'my-widget' directory structure with the following:
## Create a React App
[Create React App](https://create-react-app.dev/) allows you to generate a simple app in seconds.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure, but should there be a 'the' at the beginning of sentence?

Copy link
Contributor

Choose a reason for hiding this comment

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

not in this case: https://create-react-app.dev

``` bash
npx create-react-app my-widget --use-npm
```

This is the expected output:
This tutorial updates the following files:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is 'update' accurate, since you are building this now? Maybe build?

Copy link
Contributor

Choose a reason for hiding this comment

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

so, it's a fine distinction, but the tutorial doesn't build anything; instead it requires the files built by Create React App to be updated


1. Add a new file `src/WidgetElement.js` with the following custom element to wrap the entire React app
The steps below wrap the app component with an HTML custom element. The `connectedCallback` method renders the React app when the custom element is added to the DOM.
Copy link
Collaborator

Choose a reason for hiding this comment

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

should DOM be explained or is it known enough

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 Author

Choose a reason for hiding this comment

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

@Lyd1aCla1r3 @jyunmitch I think it's well enough known. If someone knows React enough to care about these details, they absolutely know what the DOM is.


``` html
<my-widget />
```

3. Your browser window should automatically redisplay the React App.
3. Observe your browser automatically redisplay the React app
Copy link
Collaborator

Choose a reason for hiding this comment

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

redisplay >> display
very minor but it's the first time 'your' browser is displaying the thing...

Copy link
Contributor

Choose a reason for hiding this comment

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

nope - it was already displayed once before, and this action refreshes it

2nd time - line 38. use of "your" is consistent here


2. Click `Create folder` and name it 'my-widget'. This needs to match the .env.production path from above.
2. Click `Create folder` and name it "my-widget" to match the `.env.production` path above
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this in quotes? confused

Copy link
Contributor

Choose a reason for hiding this comment

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

it's a field entry, not the field itself, so no backticks; quotes are used above to supply field values


3. Click `Save`

4. Click `my-widget`

5. Create the same folder structure as your generated build directory
5. Create a folder structure similar to your generated build directory:
Copy link
Collaborator

Choose a reason for hiding this comment

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

similar threw me off a little, because it made me wonder if I could change the names a littl

Copy link
Contributor

Choose a reason for hiding this comment

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

you can! strictly speaking the structure isn't identical


2. Choose an existing page (or create a new one (LINK TODO)) and click `Actions`→ `Design`.
2. Choose an existing page (or [create a new one](../../compose/page-management.md#create-a-page)) and select `Design` from its Actions
Copy link
Collaborator

Choose a reason for hiding this comment

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

debating whether the Actions should be backticked

Copy link
Contributor

Choose a reason for hiding this comment

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

i opted not to because it's not a label or entity

@nshaw nshaw merged commit 37b84b8 into main May 27, 2022
@nshaw nshaw deleted the ENDOC-504 branch May 27, 2022 17:15
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.

3 participants