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

Thoughts on moving static resource to inline script inside component? #5

Open
tehnrd opened this issue Mar 14, 2013 · 2 comments
Open

Comments

@tehnrd
Copy link
Owner

tehnrd commented Mar 14, 2013

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.

@hemmeter
Copy link

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 notifications@github.comwrote:

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//issues/5
.

@tehnrd
Copy link
Owner Author

tehnrd commented Mar 15, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants