question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose more of the internal API

See original GitHub issue

Feature Request

Is your feature request related to a problem? Please describe.

This feature request isn’t really related to a problem but more like a concern about the support of what looks like some internal API. As I’d like to keep this short, I’ll dive directly into the technical details. I’m using the InstanceWrapper and Module interfaces from the injector subdirectory of the core package. Those two elements are not exposed through the package root barrel file, and the imports look like this:

import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
import { Module } from '@nestjs/core/injector/module';

I’m wondering if it is safe to use these imports since those are not exposed at the core’s root.

The same goes for:

If you feel like you need more concrete details, have a look at this class.

Certainly, others would like to have some more internals exposed. Maybe this issue would be the right place to build a list of what could/should be exposed.

Describe the solution you’d like

My proposal is to simply expose more of the internal API, as long as the newly expose elements are considered stable.

What is the motivation / use case for changing the behavior?

This would allow the community to get a better grasp to NestJS’ internals and write better and more robust integrations.


English is obviously not my first language. If, in any case, you feel like you can’t completely understand what I ask for, don’t hesitate to tell me and I’ll do my best to rewrite this issue.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kamilmysliwieccommented, Jan 28, 2020

Most of them (MetadataScanner, Type, ClassProvider, ValueProvider, FactoryProvider etc) are now exported from root

2reactions
BrunnerLiviocommented, Jun 26, 2019

I’m wondering if it is safe to use these imports since those are not exposed at the core’s root.

No, it is not safe to use this. If we would change these elements it would not be declared as breaking change and we will not give further support in case you application breaks because of it.


Nonetheless what you are requesting is definitely mandatory for Nest. I think it would be interesting to compile a list of internals, which we should expose or make similar functionality part of the public API.

What comes to my mind:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices for Managing Internal APIs - NGINX
Internal APIs – by which we mean APIs exposed only to clients and developers within an organization – are a key pillar for...
Read more >
The management approach for internal vs. external APIs
External APIs expose a business's internal resources to outside users ... Developers who rely on internal APIs are generally more proactive ...
Read more >
Internal vs External APIs (What's the Difference?) - RapidAPI
An internal API is an interface that enables access to a company's backend information and application functionality for use by the ...
Read more >
What are some reasons for enterprises to expose internal ...
Exposing the API means providing the user with an interface to access and manipulate your API (API data/Objects). If that interface satisfied some...
Read more >
How to expose REST services to internal and external parties?
One way of achieving this would be by deploying next to your already existing app (let's call it internal) the very same app, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found