Skip to content
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

Interface Merging from Linked Dependency #13

Open
FlorianRappl opened this issue Apr 30, 2020 · 3 comments
Open

Interface Merging from Linked Dependency #13

FlorianRappl opened this issue Apr 30, 2020 · 3 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@FlorianRappl
Copy link
Owner

It seems that interface merging is not picked up when a dependency is installed via npm link.

@FlorianRappl FlorianRappl added the bug Something isn't working label Apr 30, 2020
@FlorianRappl FlorianRappl self-assigned this May 1, 2020
@FlorianRappl
Copy link
Owner Author

I think this is not possible from a TypeScript perspective. The reason is that the decl. merging works against the name (path) of a module. When I did that locally, my symlinked plugin retrieved piral-core (and all its modules) locally, i.e., from a different path, than the app shell. Since they are not sharing the same project they have different dependencies (they may be the same functionally, but they have different paths).

@FlorianRappl FlorianRappl added the help wanted Extra attention is needed label May 1, 2020
@FlorianRappl
Copy link
Owner Author

FlorianRappl commented May 1, 2020

Maybe someone knows an answer to this.

(I also tried switching the preserveSymlinks option.)

@MattShrider
Copy link

MattShrider commented May 1, 2020

I think this will be a hard problem to get around, and isn't limited to Piral. I believe it is the same problem as https://reactjs.org/warnings/invalid-hook-call-warning.html#duplicate-react.
I didn't get those same errors. (An issue with related content: facebook/react#13991)

A workaround is to npm link ../shell/node_modules/piral-core from the plugin (From within your piral-instance's node_modules folder), but that isn't a great flow.

//piral-instance/index.tsx
cd node_modules/piral-oidc/lib
npm link ../../piral-core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants