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

Hitch dependency functionality #14

Open
clintjhill opened this issue Apr 1, 2012 · 4 comments
Open

Hitch dependency functionality #14

clintjhill opened this issue Apr 1, 2012 · 4 comments
Assignees

Comments

@clintjhill
Copy link
Collaborator

When authoring a Hitch there are occassions where you'd like to include 3rd party scripts and styles. It would be nice if Hitch provided this ability so that you aren't writing all the boilerplate code each time.

Hitch.resource.link(URL);
Adds the tag with the src = URL

Hitch.resource.script(URL);
Adds the <script> tag with the src = URL

Things to beware:

Eventing to assure readiness
Duplication of downloads

@ghost ghost assigned clintjhill Apr 1, 2012
@bkardell
Copy link
Owner

Should this be "built in to the declaration" or imperative... Your example looks imperative, but why not add optional props to the declaration?

{
"require-css": [uri1,uri2],
"require-script": [uri1],
....
}

The advantage to that is that we could spell out something in the lifecycle to make sure that they were included if that is necessary... But maybe you are saying it's not... I dont know...

@clintjhill
Copy link
Collaborator Author

My example is imperative because there is potentially the need to logically download CSS based on attributes from a Hitch widget (or some other form of context data). Declarative would lose the ability to know "when" or "why" to download.

However I see no harm in having this as a part of the Hitch.add({}) model. There is always the use-case of knowing exactly what you want and wanting that downloaded as soon as possible.

@bkardell
Copy link
Owner

The flip side of allowing imperative though is that there is a relationship
between when requires (that gets the file in quuestion) happens and when it
is ok to process/intepret/apply... we would have to work that out in order
for imperative to make sense...right?
On Apr 27, 2012 11:55 AM, "Clint Hill" <
reply@reply.github.com>
wrote:

My example is imperative because there is potentially the need to
logically download CSS based on attributes from a Hitch widget (or some
other form of context data). Declarative would lose the ability to know
"when" or "why" to download.

However I see no harm in having this as a part of the Hitch.add({})
model. There is always the use-case of knowing exactly what you want and
wanting that downloaded as soon as possible.


Reply to this email directly or view it on GitHub:
#14 (comment)

@bkardell
Copy link
Owner

I agree, we really should solve this... it is way past time.

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

No branches or pull requests

2 participants