Skip to content

feat: docusaurus v2 #669

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

Merged
merged 24 commits into from
Feb 23, 2020
Merged

feat: docusaurus v2 #669

merged 24 commits into from
Feb 23, 2020

Conversation

eriveltonelias
Copy link
Member

Sorry for this long PR 😅, but a lot of changes were necessary to migrate Docusaurus v1 to v2.
on this link https://v2.docusaurus.io/docs/migrating-from-v1-to-v2 we can see the instructions to migrate, may it help for review.

Screen Shot 2020-02-18 at 07 44 21

Screen Shot 2020-02-18 at 07 44 29

Screen Shot 2020-02-18 at 07 44 34

Screen Shot 2020-02-18 at 07 44 16

@eriveltonelias eriveltonelias changed the title bump docusaurus v2 feature: docusaurus v2 Feb 18, 2020
@eriveltonelias eriveltonelias changed the title feature: docusaurus v2 feat: docusaurus v2 Feb 18, 2020
Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

Seems like the stuff inside .docusaurus folder shouldn't be committed to git but they are present in the commit

@eriveltonelias
Copy link
Member Author

@satya164 yeah, you're right. Just removed this one.

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

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

There seem to be 2 folders, website/ and website1. Why are both folders needed?

Also I would like to remove docs from website/docs and keep everything in versioned like in current repo because having duplicated docs in docs/ always confuses users.

@eriveltonelias
Copy link
Member Author

There seem to be 2 folders, website/ and website1. Why are both folders needed?

thanks! I'll remove the website1

Also I would like to remove docs from website/docs and keep everything in versioned like in current repo because having duplicated docs in docs/ always confuses users.

if we remove the docs/ will "remove" the 'next' version, so can I remove this one too?

@satya164
Copy link
Member

if we remove the docs/ will "remove" the 'next' version, so can I remove this one too?

yea, we don't have a next right now

@eriveltonelias
Copy link
Member Author

done :)

Copy link
Member

@WoLewicki WoLewicki left a comment

Choose a reason for hiding this comment

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

Good job! I will test it tomorrow to see if the links etc. work correctly.


Returning `true` from `onBackButtonPressAndroid` denotes that we have handled the event, and react-navigation's listener will not get called, thus not popping the screen. Returning `false` will cause the event to bubble up and react-navigation's listener will pop the screen.

```
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be there?

Suggested change
```
```js


### `getStateForAction(action, state)`

Defines the navigation state in response to a given action. This function will be run when an action gets passed into `props.navigation.dispatch(`, or when any of the helper functions are called, like `navigation.navigate(`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Defines the navigation state in response to a given action. This function will be run when an action gets passed into `props.navigation.dispatch(`, or when any of the helper functions are called, like `navigation.navigate(`.
Defines the navigation state in response to a given action. This function will be run when an action gets passed into `props.navigation.dispatch()`, or when any of the helper functions are called, like `navigation.navigate()`.


Typically this should return a navigation state, with the following form:

```
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
```
```js


### Example

```jsx harmony
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
```jsx harmony
```js

const MyScreen = () => (
<View>
<NavigationEvents
onWillFocus={payload => console.log('will focus',payload)}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
onWillFocus={payload => console.log('will focus',payload)}
onWillFocus={payload => console.log('will focus', payload)}

same below

@@ -71,9 +70,9 @@ Position of the tab bar in the tab view. Possible values are `'top'` and `'botto

#### `lazy`

Boolean indicating whether to lazily render the scenes. When this is set to `true`, screens will be rendered as they come into the viewport. By default all scenes are rendered to provide a smoother swipe experience. But you might want to defer the rendering of screens out of the viewport until the user sees them. To enable lazy rendering, set `lazy` to `true`.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe updating the docs in this way should be in another PR to keep some kind of single responsibility PRs? Wdyt @satya164?

@@ -39,7 +38,7 @@ In the above example, the `Home` component contains a tab navigator. The `Home`
- `Profile` (`Screen`)
- `Settings` (`Screen`)

Nesting navigators work very much like nesting regular components. To achieve the behavior you want, it's often necessary to nest multiple navigators.
To achieve the behavior you want, it's often necessary to nest multiple navigators. For example, if you want.
Copy link
Member

Choose a reason for hiding this comment

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

Is it ended?

@@ -59,10 +58,6 @@ For example, if you have a stack inside a drawer navigator, the drawer's `openDr

Similarly, if you have a tab navigator inside stack navigator, the screens in the tab navigator will get the `push` and `replace` methods for stack in their `navigation` prop.

### Nested navigators don't receive parent's events

For example, if you have a stack navigator nested inside a tab navigator, the screens in the stack navigator won't receive the events emitted by the parent tab navigator such as (`tabPress`) when using `navigation.addListener`. To receive events from parent navigator, you can explicitly listen to parent's events with `navigation.dangerouslyGetParent().addListener`.
Copy link
Member

Choose a reason for hiding this comment

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

Why delete this?

@@ -126,21 +123,6 @@ headerStyle: {

To set a custom header for all the screens in the navigator, you can specify this option in the `screenOptions` prop of the navigator.

If you want your custom header to animate with screen transitions and want to keep `headerMode` as `float`, you can interpolate on the `scene.progress.current` and `scene.progress.next` props. For example, following will cross-fade the header:
Copy link
Member

Choose a reason for hiding this comment

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

Why delete this too?

@@ -43,7 +41,7 @@ export default function App() {
}

return (
<NavigationContainer initialState={initialState} ref={ref}>
<NavigationContainer initialState={initialState}>
Copy link
Member

Choose a reason for hiding this comment

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

Why remove ref? It is used in useLinking.

@satya164
Copy link
Member

I think these deletions/changes are because of bad merge. Let's make a pass to see the documentation is the same as master and then merge :)

@eriveltonelias
Copy link
Member Author

yeah, @satya164 is right, @WoLewicki. Basically, some things were needed to change when migrating v1 to v2.
eg:

-- id: VERSION-FILE_NAME
-- original_id: FILE_NAME

the original_id was removed and the id was needed to remove the version reference and when I started working on this upgrade was on last week, so a lot of changes happened :D.

and docs now should be on /website so when I tried to merge this today some bad merges happen, but I don't think they were deleted

@satya164
Copy link
Member

I've fixed the merge related issues. I was running it locally, few things:

  • Seems clicking the blog link crashes the website and I see empty page
  • Clicking on some links doesn't work (e.g. Continue to "Hello React Navigation" to start writing some code.) in "Getting Started". I think need to replace the ".html" with ".md"
  • Hovering over the buttons in homepage has white text with light background, can we make the text purple?
  • We're missing this section "React Navigation is built and funded by Expo & Software Mansion, with contributions from the community."
  • The copyright text looks a bit weird due to small top margin, maybe add some margin there? or remove that text, idc
  • Regarding dark theme for code snippets in light background. I've astigmatism and it feels too harsh to my eyes. Can we change it to light theme?
  • The code snippets with diff don't have syntax highlighting, check the "upgrading from 4.x" doc for an example
  • Purple accent color may not be best with dark theme. Maybe we can lighten it up a bit for the dark theme
  • Since everything is inside the website folder now, maybe we can just move everything to root of the project? Is there any disadvantage? Currently I keep running yarn at root by mistake instead of cd website/ first
  • Not related to this PR, but can we remove "Next" from versions page? Since we don't have a "next" version right now

@eriveltonelias
Copy link
Member Author

I've fixed the merge related issues. I was running it locally, few things:

thanks ❤️

  • Seems clicking the blog link crashes the website and I see empty page
  • Clicking on some links doesn't work (e.g. Continue to "Hello React Navigation" to start writing some code.) in "Getting Started". I think need to replace the ".html" with ".md"
  • Hovering over the buttons in homepage has white text with light background, can we make the text purple?

yes

  • We're missing this section "React Navigation is built and funded by Expo & Software Mansion, with contributions from the community."
  • The copyright text looks a bit weird due to small top margin, maybe add some margin there? or remove that text, idc
  • Regarding dark theme for code snippets in light background. I've astigmatism and it feels too harsh to my eyes. Can we change it to light theme?

for sure, I'll change

  • The code snippets with diff don't have syntax highlighting, check the "upgrading from 4.x" doc for an example
  • Purple accent color may not be best with dark theme. Maybe we can lighten it up a bit for the dark theme
  • Since everything is inside the website folder now, maybe we can just move everything to root of the project? Is there any disadvantage? Currently I keep running yarn at root by mistake instead of cd website/ first

yeah, we can move everything to root now.

  • Not related to this PR, but can we remove "Next" from versions page? Since we don't have a "next" version right now

yeah

Thanks for all feedback @satya164.

@eriveltonelias
Copy link
Member Author

eriveltonelias commented Feb 20, 2020

  • Seems clicking the blog link crashes the website and I see empty page

  • Clicking on some links doesn't work (e.g. Continue to "Hello React Navigation" to start writing some code.) in "Getting Started". I think need to replace the ".html" with ".md"

  • Hovering over the buttons in homepage has white text with light background, can we make the text purple?

  • We're missing this section "React Navigation is built and funded by Expo & Software Mansion, with contributions from the community."

  • The copyright text looks a bit weird due to small top margin, maybe add some margin there? or remove that text, idc

  • Regarding dark theme for code snippets in light background. I've astigmatism and it feels too harsh to my eyes. Can we change it to light theme?

  • The code snippets with diff don't have syntax highlighting, check the "upgrading from 4.x" doc for an example

  • Purple accent color may not be best with dark theme. Maybe we can lighten it up a bit for the dark theme

  • Since everything is inside the website folder now, maybe we can just move everything to root of the project? Is there any disadvantage? Currently I keep running yarn at root by mistake instead of cd website/ first

  • Not related to this PR, but can we remove "Next" from versions page? Since we don't have a "next" version right now

@eriveltonelias
Copy link
Member Author

@satya164
Can you check those topics again, please?

  • Seems clicking the blog link crashes the website and I see empty page

  • Clicking on some links doesn't work (e.g. Continue to "Hello React Navigation" to start writing some code.) in "Getting Started". I think need to replace the ".html" with ".md"

  • Purple accent color may not be best with a dark theme. Maybe we can lighten it up a bit for the dark theme ( Do you have a suggestion for what color in here 😅)?

@satya164
Copy link
Member

Can you check those topics again, please?

Kapture 2020-02-21 at 14 41 09

Do you have a suggestion for what color in here

#a697ce looks good contrast wise

@satya164
Copy link
Member

Just fixed videos not playing because docusaurus now uses MDX and it needs to be autoPlay instead of autoplay

@satya164
Copy link
Member

Turns out the blog doesn't load because the chunk name has "ad" in it which gets blocked by uBlock origin 🤦‍♂

@satya164 satya164 merged commit b762b30 into source Feb 23, 2020
@satya164 satya164 deleted the @eriveltonelias/docusaurus-v2 branch February 23, 2020 02:45
@satya164
Copy link
Member

It's live https://reactnavigation.org/

Thanks so much for working on this :D

@satya164
Copy link
Member

Seems the new version breaks all the links because of removing .html suffix. There were some other issues which I tried to fix here https://github.com/react-navigation/react-navigation.github.io/commits/docusaurus-v2

But I didn't notice that translations don't work 😱

Until we figure that out, I've reverted to v1 and put the v2 branch here https://github.com/react-navigation/react-navigation.github.io/commits/docusaurus-v2

@eriveltonelias
Copy link
Member Author

It's live https://reactnavigation.org/

Thanks so much for working on this :D

❤️😭

@eriveltonelias
Copy link
Member Author

Seems the new version breaks all the links because of removing .html suffix. There were some other issues which I tried to fix here https://github.com/react-navigation/react-navigation.github.io/commits/docusaurus-v2

But I didn't notice that translations don't work 😱

😩haha

sure, let me work on that, btw our account on Crowdin was suspended, do you have an idea why?

satya164 pushed a commit that referenced this pull request Feb 25, 2020
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