dynamico icon indicating copy to clipboard operation
dynamico copied to clipboard

Add dependencies provider

Open nataly87s opened this issue 6 years ago • 3 comments

Let's say we have a dynamic component that renders other dynamic components, and wants to add more dependencies for these components to use. currently we can do it manually by passing a new client through the provider, but I thought we could make a DependenciesProvider

nataly87s avatar Jan 17 '20 16:01 nataly87s

~sounds very useful... great idea :)~ I talked to @EladBezalel a bit on that and this can cause some weird issues... it should be a last resort kind of thing and not something to be used as a common practice. I'll look at the PR and see if there uncovered edge cases there.

eladav avatar Jan 19 '20 15:01 eladav

Okay after I saw the change I'm calmer :) In any case, as I wrote in the PR we'll try to challenge this solution to see that we're not creating weird edge cases here (host has old dep, component brings in newer version of same dep, another component is shown in two different contexts, how do we manage multiple versions of it etc.)

eladav avatar Jan 19 '20 15:01 eladav

I solved the multi dep version by adding a dependency hash to the storage key, so that components downloaded for a specific set of dependencies will be stored separately.

as I mentioned, we can already override the context (by adding another DynamicoProvider), so having the same component with different dependencies is possible even without this PR

nataly87s avatar Jan 21 '20 21:01 nataly87s