sObject-Remote icon indicating copy to clipboard operation
sObject-Remote copied to clipboard

Thoughts on moving static resource to inline script inside component?

Open tehnrd opened this issue 11 years ago • 2 comments

Currently all the JavaScript is stored in a static resource. Any opinions for or against moving inline in the <c:sObjetRemote> component.

The main reason I am leaning towards doing this is ease of use in managed packages and creating less components overall. In a managed package I don't want this thing creating extra static resources that I will have to included as typically everything is stored in one or two main static resources. If this script was inside the component the static resource could be eliminated.

The first thing I did after installing this was to change the static resource location, which makes it a more manual process to upgrade in the future as you can't simply reinstall the package.

The down side is the inline script probably wouldn't be cached and would be loaded with every page load. Yet minified this script is only 2.5KB so the its almost negligible.

I am leaning towards moving it.

tehnrd avatar Mar 14 '13 04:03 tehnrd

Agree that it makes sense to make it as easy as possible for someone implementing. Being able to only put in the component for a page makes it super simple. The alternative would be making it so you put the class as an extension and include a resource, but then that's 2 steps.

If you have it in the Component, everything can be dynamic, even the sObject name and whatever else is in the code.

On Wed, Mar 13, 2013 at 9:37 PM, Jason Venable [email protected]:

Currently all the JavaScript is stored in a static resource. Any opinions for or against moving inline in the component.

The main reason I am leaning towards doing this is ease of use in managed packages and creating less components overall. In a managed package I don't want this thing creating extra static resources that I will have to included as typically everything is stored in one or two main static resources. If this script was inside the component the static resource could be eliminated.

The first thing I did after installing this was to change the static resource location, which makes it a more manual process to upgrade in the future as you can't simply reinstall the package.

The down side is the inline script probably wouldn't be cached and would be loaded with every page load. Yet minified this script is only 2.5KB so the its almost negligible.

I am leaning towards moving it.

— Reply to this email directly or view it on GitHubhttps://github.com/TehNrd/sObject-Remote/issues/5 .

hemmeter avatar Mar 14 '13 04:03 hemmeter

Great point about being able to define there own global var, make sObject whatever you want. Ok, I'm going to move it inside the component.

tehnrd avatar Mar 15 '13 00:03 tehnrd