Serve CSS bundle at end of HEAD tag by default #294

Open
extesy opened this Issue Sep 12, 2012 · 9 comments

Comments

Projects
None yet
7 participants
@extesy

extesy commented Sep 12, 2012

The default bundler will add the CSS tags to the end of the HEAD tag. If you want the original behaviour, set client options.cssWithJavaScript = true.

Original:

Currently SocketStream puts all templates (compiled or not) into the head tag. Server-compiled templates are simple javascripts after all, so it just makes sense to serve them as a javascript file. So SocketStream should be able to serve templates via separate file, something like "/_serveDev/templates?ts=1234567890" and include them in the packed javascript assets in production environment.

@owenb

This comment has been minimized.

Show comment
Hide comment
@owenb

owenb Sep 15, 2012

Hmm we can do. It would have to be sent before any scripts which use templates, but that is doable.

Any particular reason you don't like the code in the head tag?

owenb commented Sep 15, 2012

Hmm we can do. It would have to be sent before any scripts which use templates, but that is doable.

Any particular reason you don't like the code in the head tag?

@sveisvei

This comment has been minimized.

Show comment
Hide comment
@sveisvei

sveisvei Sep 21, 2012

Contributor

In the usecase of having both express and ss at the same time, and reusing some of the ss templates, it might make sense to have this option.

Contributor

sveisvei commented Sep 21, 2012

In the usecase of having both express and ss at the same time, and reusing some of the ss templates, it might make sense to have this option.

@owenb

This comment has been minimized.

Show comment
Hide comment
@owenb

owenb Sep 27, 2012

Agreed. Spoke about this on the newsgroup too. For 0.4 I'd like any dom elements to output to the HTML view and all other code to go into a seperate JS file, auto loaded before everything else, and then packed into the same main .js file as everything else.

owenb commented Sep 27, 2012

Agreed. Spoke about this on the newsgroup too. For 0.4 I'd like any dom elements to output to the HTML view and all other code to go into a seperate JS file, auto loaded before everything else, and then packed into the same main .js file as everything else.

@luksch

This comment has been minimized.

Show comment
Hide comment
@luksch

luksch Jan 31, 2014

any chance of having this any time soon?

luksch commented Jan 31, 2014

any chance of having this any time soon?

@paulbjensen

This comment has been minimized.

Show comment
Hide comment
@paulbjensen

paulbjensen Jan 31, 2014

Contributor

Sadly I'm not able to do that right now. If I could work on SocketStream as part of my job, that would be great, but sadly I'm doing more of a sysadmin/full-stack dev/qa job at the moment.

Contributor

paulbjensen commented Jan 31, 2014

Sadly I'm not able to do that right now. If I could work on SocketStream as part of my job, that would be great, but sadly I'm doing more of a sysadmin/full-stack dev/qa job at the moment.

@RomanMinkin

This comment has been minimized.

Show comment
Hide comment
@RomanMinkin

RomanMinkin Jan 31, 2014

Contributor

Hey folks,

From the other hand in some cases header <script> templates needed for third party plugins as angular-ui/bootstrap, where templates calls hardcoded as

templateUrl: 'template/accordion/accordion.html'

It's why I came up with ss-angular-templates module for SocketStream.

Contributor

RomanMinkin commented Jan 31, 2014

Hey folks,

From the other hand in some cases header <script> templates needed for third party plugins as angular-ui/bootstrap, where templates calls hardcoded as

templateUrl: 'template/accordion/accordion.html'

It's why I came up with ss-angular-templates module for SocketStream.

@thepian

This comment has been minimized.

Show comment
Hide comment
@thepian

thepian Dec 1, 2014

Member

This can be done as a plugin. I would suggest to treat this a Documentation Request

Member

thepian commented Dec 1, 2014

This can be done as a plugin. I would suggest to treat this a Documentation Request

@paulbjensen

This comment has been minimized.

Show comment
Hide comment
@paulbjensen

paulbjensen Feb 1, 2015

Contributor

@thepian is this something that can be done for 0.3.12, or would depend on a major update (i.e. 0.4).

Contributor

paulbjensen commented Feb 1, 2015

@thepian is this something that can be done for 0.3.12, or would depend on a major update (i.e. 0.4).

@thepian

This comment has been minimized.

Show comment
Hide comment
@thepian

thepian Mar 11, 2015

Member

With 0.4 you should be able to make a modified bundler that does what you want. But I suppose we could still have a look at supporting more options for bundling templates.

On a project I work on we bundle Angular templates in a javascript and serve them with the code. Although it felt strange to me at first, I must admit that it has few drawbacks I can think of.

So I'd like to see more options around template bundling.

Member

thepian commented Mar 11, 2015

With 0.4 you should be able to make a modified bundler that does what you want. But I suppose we could still have a look at supporting more options for bundling templates.

On a project I work on we bundle Angular templates in a javascript and serve them with the code. Although it felt strange to me at first, I must admit that it has few drawbacks I can think of.

So I'd like to see more options around template bundling.

@thepian thepian added this to the 0.4.x milestone Mar 11, 2015

@thepian thepian changed the title from Serve compiled templates as a separate javascript file instead of a head tag to Serve CSS bundle at end of HEAD tag by default Mar 15, 2015

@thepian thepian modified the milestones: 0.6, 0.4.x Oct 11, 2015

@thepian thepian modified the milestones: 0.7.0 unstable, 0.6 stable Nov 2, 2015

@thepian thepian added New Feature and removed Feature Request labels Nov 15, 2015

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