mojito icon indicating copy to clipboard operation
mojito copied to clipboard

Sharable Addons Proposal

Open aljimenez opened this issue 11 years ago • 2 comments

Addon instantiation time can add up in large applications. Perhaps we can share certain addons per request and even across requests. Addons would have a property that it can use to indicate whether it can be shared per requests or for all requests. By doing this certain addons such as the cookies addon can indicate that it can be shared per request and would only be instantiated once per request. Global addons that do not depend on requests would only be instantiated once per application.

This would not only cut down on addon instantiation time but would also limit the amount of memory used and garbage collection.

aljimenez avatar May 17 '13 21:05 aljimenez

This is an interesting idea. At the very least I think it's worth doing some experiments to see how much of a benefit it might have.

drewfish avatar May 20 '13 16:05 drewfish

The global structures that you're reference here ARE NOT action context, they need to be something else. ActionContext addons are tied to an action executed on a mojit instance by definition, which means they will never be global. But I could not agree more that today people are using addons to mitigate a bigger problem, the lack of page-level structures that can be used by any mojit instance in the context of that page (independently or the runtime). We do have some ideas, and we will formalize them in the next few days, I will keep you posted.

caridy avatar May 22 '13 19:05 caridy