Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I use api.imply in package.js do I have to use api.use for the same package?

When construction meteor packages you can add files like this:

api.use('fourseven:[email protected]', ['client', 'server']);

You can also tell meteor to give the package user access to other packages like this:

api.imply('fourseven:[email protected]', ['client', 'server']);

In the documentation it's not clear if implying a package also makes it available. For instance, I'm not sure if it is redundant to do this:

api.use('fourseven:[email protected]', ['client', 'server']);
api.imply('fourseven:[email protected]', ['client', 'server']);
like image 444
MSaforrian Avatar asked Sep 01 '14 14:09

MSaforrian


People also ask

What are the 3 types of APIs?

Today, there are three categories of API protocols or architectures: REST, RPC and SOAP. These may be dubbed "formats," each with unique characteristics and tradeoffs and employed for different purposes. REST. The representational state transfer (REST) architecture is perhaps the most popular approach to building APIs.

How do APIs communicate with each other?

APIs communicate through a set of rules that define how computers, applications or machines can talk to each other. The API acts as a middleman between any two machines that want to connect with each other for a specified task.

What is important if you decide to change the way your API is structured?

If an API has the wrong value proposition (or none at all) it will be very difficult or impossible to find users. through an API, if that API links to existing offerings and enhances them. As long as the API is structured in a way that covers meaningful use cases for developers, it will deliver value.

Which type of API combines different data and service APIs?

Composite APIs – It is a type of APIs that combines different data and services. The main reason to use Composites APIs is to improve the performance and to speed the execution process and improve the performance of the listeners in the web interfaces.


1 Answers

I've just tested this use case with a couple packages of mine and I can assert that implying a package doesn't make it available automatically in the package source.

So it means that

api.use("foo:[email protected]");
api.imply("foo:[email protected]");

is NOT redundant if you intend to use and reference foo:bar in the current package source.

You can think of api.imply as an api.use for the app context that has no impact on the current package context.

I've heard that some time in the future they plan to integrate a package-like API for the app context, which is going to be useful to address load order among other things.

like image 104
saimeunt Avatar answered Sep 21 '22 18:09

saimeunt