loopbackio / loopback-next

LoopBack makes it easy to build modern API applications that require complex integrations.
https://loopback.io
Other
4.95k stars 1.07k forks source link

show imports in documentation #3581

Closed JohnLindahlTech closed 3 years ago

JohnLindahlTech commented 5 years ago

Sorry if this is incorrect template/repo for this suggestion.

Steps to reproduce

When reading the docs on https://loopback.io/doc/en/lb4/ for any of the Getting started tutorials.

Current Behavior

It is most often problematic as a new into LB4 to know where the imports are made from with all the new syntax/concepts. One specific example is https://loopback.io/doc/en/lb4/Interceptors.html#apply-interceptors

Expected Behavior

It would be very convenient if the code snippets "always" shows from where different imports that is needed from the @loopback/{any}-packages.

Link to reproduction sandbox

example:

import {intercept} from '@loopback/core'; 
// ^-- Add these lines so that newcomers can start learning the concepts.

class MyController {
  @intercept(log) // Use the `log` function
  greet(name: string) {
    return `Hello, ${name}`;
  }
}

Additional information

Related Issues

See Reporting Issues for more tips on writing good issues


🎆 Hacktoberfest 2020

Greetings :wave: to all Hacktoberfest 2020 participants!

Here are few tips 👀 to make your start easier, see also #6456.

dhmlau commented 5 years ago

@JohnPhoto, thanks for pointing it out. Would you like to submit a PR?

For your reference, here is the step-by-step instructions in submitting a PR in loopback-next repo: https://loopback.io/doc/en/lb4/submitting_a_pr.html. Thanks!

JohnLindahlTech commented 5 years ago

I will try to help out when I find the time.

One issue though: https://cla.strongloop.com/agreements/strongloop/loopback-next (taken from your link) does not seem to exist.

raymondfeng commented 5 years ago

One issue though: https://cla.strongloop.com/agreements/strongloop/loopback-next (taken from your link) does not seem to exist.

We see the issue and in the process of fixing it.

dhmlau commented 4 years ago

@JohnPhoto, just wondering whether you're still interested in submitting a PR? The CLA issue should be fixed. :)

JohnLindahlTech commented 4 years ago

I must admit that I really would like to see the change, but I have changed employer and are no longer actively working with loopback and my spare time is slim since I just got a child to take care of. So sadly do not get your hopes up that I will manage to get the time for it :(

mrmodise commented 4 years ago

Looks like most of them are added. Any more specific ones that maybe I can pick up?

bajtos commented 4 years ago

Looks like most of them are added. Any more specific ones that maybe I can pick up?

I am afraid we don't have a list of places missing imports. Can you perhaps pick quickly scan through few doc pages to see if you can spot any code snippet(s) to fix?

pktippa commented 3 years ago

@dhmlau please assign the isse to me, please find PR #7084,