Importing symbols from an implied package does not work


#1

Hello everybody!

During my development, me and my team we’ve found the following “bug” (at least we consider it a bug)
Let say you have package A, B, C
Package A exports a symobl
Package B use and implies Package A
Package C use Package B

A <- B (implies A) <- C

Then if you do an import from package C like this:

import { SymbolA } from 'meteor/user:packageB';

console.log(SymbolA === undefined) // true

SymbolA is not undefined.
So implied symbols are importable with the import syntax, you need to keep using the “global” syntax.

@sashko @avital
Is that a bug?

If it is, I could write an issue in the Repo with a small reproduction

Thanks in advance


#2

The “solution” seems to be exporting again in package B
So you use the package, and then export it. Manually “implying” i would say.


#3

@sashko does this like mean that this is the solution, because if this is the solution, that confirms in my opinion the bug, because imply should do by default, doesn’ it?


#4

This is supposedly working as intended; import directly from package A.


#5

What is then imply doing in this case?


#6

The same thing as before: gives (global) exports to other Meteor packages that depend on it and includes it in your app without you having to specifically meteor install it

Could be seen as a legacy feature, I guess