Skip to content

Rework README, add info from docs site #18

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 1 commit into from
Jan 5, 2017
Merged

Rework README, add info from docs site #18

merged 1 commit into from
Jan 5, 2017

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Jan 3, 2017

Rework the initial section, simplify warnings and installation
instructions.

I decided to remove the "engine-strict" recommendation, as Node v0.10/v0.12 are no longer supported under the LTS plan, therefore I think it's unlikely there will be people running on these ancient versions and wanting to use the new loopback-context.

Update the "Usage" section with content from docs site, as was found in
Using-current-context.md.

@crandmck @josieusa PTAL
cc @superkhau

@josieusa
Copy link
Collaborator

josieusa commented Jan 3, 2017

Thanks for asking me to take a look.
LGTM.
Just one note, though. It seems to me that the README doesn't explain clearly enough that the syntax to enable the HTTP context is the following:

...
"initial": {
  ...
  "loopback-context#per-request": {
    "params": {
      "enableHttpContext": true
    }
  }
},
...

Mind the params field.

@bajtos
Copy link
Member Author

bajtos commented Jan 3, 2017

@josieusa good point! I added an example configuration - see a5793a5.

Copy link

@crandmck crandmck left a comment

Choose a reason for hiding this comment

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

Make sure you are running on a Node version supported by this module!

We should state what these are, rather than leaving it up to the user to figure it out for themselves. Either state the versions or say that it's the Node versions supported by LoopBack.

Otherwise, LGTM.

@bajtos
Copy link
Member Author

bajtos commented Jan 4, 2017

Make sure you are running on a Node version supported by this module!

We should state what these are, rather than leaving it up to the user to figure it out for themselves. Either state the versions or say that it's the Node versions supported by LoopBack.

@crandmck my concern is that the supported versions are maintained in package.json and if we duplicate the information in README, then we will likely forget to update README together with package.json and thus README will eventually get outdated.

loopback-context may support a smaller set of Node versions than LoopBack does.

Thoughts?

```

This keeps you from using Node < v4.5.
If you are using a process manager like `pm2` or `strong-pm`, then consult
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe recommend strong-pm first?

{
"initial": {
"loopback-context#per-request": {}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

},

invoked multiple times on the same request and returns immediately in
subsequent runs.**

Here’s sample code which uses a middleware function to place the currently
Copy link
Contributor

Choose a reason for hiding this comment

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

Here is a snippet using a middleware..
The following is an example of using a middleware...

@superkhau
Copy link
Contributor

superkhau commented Jan 4, 2017

...likely forget to update README together with package.json and thus README will eventually get outdated.

IMO, it is better to be clear than to leave the docs ambiguous (I agree with @crandmck on this point, we should favour the end user experience over our laziness to maintain the docs). I agree with you though they will get outdated over time, but we can simply update it when a user complains/creates an issue at that time.

An alternative solution is maybe link directly to the line in package.json from the README?

@crandmck
Copy link

crandmck commented Jan 4, 2017

An alternative solution is maybe link directly to the line in package.json from the README?

Perhaps some combo of the two, i.e. state the specific Node versions in the README, and say something like "if you encounter problems, check package.json to ensure you're using a supported Node version".

@josieusa
Copy link
Collaborator

josieusa commented Jan 5, 2017

Or, since Loopback docs are now open source, and are supposed to be quite up-to-date, list the versions there, and in the README you can just remind the user to read the docs.

@bajtos
Copy link
Member Author

bajtos commented Jan 5, 2017

Or, since Loopback docs are now open source, and are supposed to be quite up-to-date, list the versions there, and in the README you can just remind the user to read the docs.

@josieusa hey, thank you for chiming in! Since loopback-context is deprecated, the docs on loopback.io will no longer mention this module. That's one of the reasons why I am moving the content from loopback.io to this README.

Perhaps some combo of the two, i.e. state the specific Node versions in the README, and say something like "if you encounter problems, check package.json to ensure you're using a supported Node version".

If the user is using an unsupported Node.js versions, npm install will print either an error or a warning (depending on their configuration of engine-strict) and AFAIK, these messages contain the Node.js versions required by the package.

My conclusion is that I am going to list the current supported versions in README, nothing more.

Rework the initial section, simplify warnings and installation
instructions.

Update the "Usage" section with content from docs site, as was found in
[Using-current-context.md](http://bit.ly/2hNJSBN).
@bajtos bajtos merged commit b0e0b35 into master Jan 5, 2017
@bajtos bajtos deleted the improve-readme branch January 5, 2017 14:11
@bajtos bajtos removed the #review label Jan 5, 2017
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.

4 participants