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

fix(docs): add diagrams to concepts #3462

Merged
merged 1 commit into from
Aug 20, 2019
Merged

fix(docs): add diagrams to concepts #3462

merged 1 commit into from
Aug 20, 2019

Conversation

dhmlau
Copy link
Member

@dhmlau dhmlau commented Jul 26, 2019

Got an overview diagram from @raymondfeng and I'm trying to get a snippet for some of the LB concepts.

This PR implements some of the proposal items discussed in: #3164. Changes in this PR:

  • added the "behind the scene" sidebar item
  • refactor some of the concepts to the "behind the scene"
  • added the diagram in the Concepts page

Related to #3383

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

👉 Check out how to submit a PR 👈

LoopBack 4 introduces some new concepts that are important to understand:
LoopBack 4 introduces some new concepts that are important to understand.

![Key concepts overview diagram](imgs/key-concepts-overview-diagram.png)

- [**Application**](Application.md): The central class for setting up all of
your module’s components, controllers, servers and bindings. The Application
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need to refer to a lower layer that shows context, binding, and component.

Copy link
Contributor

Choose a reason for hiding this comment

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

LoopBack 4 defines some key building blocks to represent different responsibilities for typical API and/or Microservice applications.

Copy link
Member Author

Choose a reason for hiding this comment

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

We may need to refer to a lower layer that shows context, binding, and component.

@raymondfeng , do you want to move those to the "behind the scene" sidebar?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move "interceptor" to section "Behind-the-scene" as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Interceptor probably should stay outside of Behind-the-scene.

@dhmlau dhmlau self-assigned this Aug 6, 2019
@dhmlau dhmlau force-pushed the concepts branch 2 times, most recently from a69cf53 to c817eb3 Compare August 16, 2019 02:56
@dhmlau
Copy link
Member Author

dhmlau commented Aug 16, 2019

This is how the sidebar looks like:

Screen Shot 2019-08-15 at 10 49 24 PM

@dhmlau dhmlau marked this pull request as ready for review August 16, 2019 03:02
@dhmlau dhmlau requested a review from bajtos as a code owner August 16, 2019 03:02
@dhmlau
Copy link
Member Author

dhmlau commented Aug 16, 2019

@raymondfeng, i think ideally we can include a diagram for the "behind the scene" section. But I don't think I understand enough to create such diagram to illustrate how context/binding/DI/Components work together. Perhaps we can work on that in a separate PR? Thanks.

@dhmlau dhmlau changed the title [WIP] fix(docs): add diagrams to concepts fix(docs): add diagrams to concepts Aug 16, 2019
Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

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

Left some minor suggestions. LGTM 👍 :shipit:

permalink: /doc/en/lb4/Behind-the-scene.html
---

Here are the infrastructure that get all the artifacts working together:
Copy link
Contributor

Choose a reason for hiding this comment

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

infrastructure-->insfrastructures?

LoopBack 4 introduces some new concepts that are important to understand:
LoopBack 4 introduces some new concepts that are important to understand.

![Key concepts overview diagram](imgs/key-concepts-overview-diagram.png)

- [**Application**](Application.md): The central class for setting up all of
your module’s components, controllers, servers and bindings. The Application
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move "interceptor" to section "Behind-the-scene" as well?

@raymondfeng
Copy link
Contributor

@dhmlau We should re-sort key concepts. For example, move all data related ones so that they are next to each other:

  • Models (changed from Model)
  • Relations
  • DataSources
  • Repositories

@raymondfeng
Copy link
Contributor

@dhmlau Nice diagrams. Can we use smaller fonts and boxes?

@@ -12,7 +12,7 @@ A `DataSource` in LoopBack 4 is a named configuration for a Connector instance
that represents data in an external system. The Connector is used by
`legacy-juggler-bridge` to power LoopBack 4 Repositories for Data operations.

![Datasource diagram](imgs/datasource.png)
<img src="imgs/datasource.png" alt="Datasource diagram" width="300">
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the image be aligned to the center?

What if we change the font/shape size in the original diagram instead of having the browser resizing it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should highlight the DataSource box and make the rest half transparent or lower contrast.

Copy link
Member Author

Choose a reason for hiding this comment

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

The font and shape size is small because I just do a screen cap of the overview diagram, but somehow the image got expanded.
There seems to be problems in displaying the image when I'm testing it locally. So I'm trying to resize the image itself.

Copy link
Member Author

Choose a reason for hiding this comment

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

@raymondfeng , it seems like making the image at the center is harder than I thought. :-)
We can use the html snippet to specify the alignment, i.e.

<center>
  <img src="pages/en/lb4/imgs/datasource.png">
</center>

The image appears fine when testing locally, however, the image will appear to be broken if you view within loopback-next.

I think it's better to be able to view it within github or within the loopback-next repo (i.e. ![Datasource diagram](imgs/datasource.png) ) than to make the image to be at the center. But I don't have a very strong preference. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I can accept the left-aligned diagrams with simple markdown syntax.

@dhmlau dhmlau merged commit 5d90653 into master Aug 20, 2019
@dhmlau dhmlau deleted the concepts branch August 20, 2019 17:14
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