You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Peter Hvass <P....@albourne.com> on 2013/08/19 12:10:43 UTC

[5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js

Hi all, 


Just wondering what you all think about including bootstrap's js in a more modular fashion 
(i.e. as it appears when downloaded directly from github, each component's js is in its own file). 


Before 5.4 we were using these modular files to be able to pick and choose which bits of the bootstrap 
js we pull down. One example is Bootstrap's Dropdown for which we have a mixin that goes; 
@Import(module = Bootstrap.DROPDOWN) 


Where Bootstrap.java contains a bunch of constants pointing to the various js files. (i.e.: "bootstrap/js/dropdown.js"). 


We're running into issues where bootstrap.js is included by various core components and scripts are executing twice! 
If there's no hope for this to be included or overridden (somehow) then we'll just opt for using the full bootstrap.js I guess. 


Thanks again! 
Peter 


Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js

Posted by Peter Hvass <P....@albourne.com>.
Hello, 


Felix; thanks, yes this would be a good intermediary hack for the time being! 


Howard; there is a little bit of dependency stuff going on yes and certain situations (as for the carousel) 
where a small initialization script is required (rather than data attributes doing the work). 


Would be cool to go full modular at some point; perhaps this is more the work of an add-on project 
such as tapestry-bootstrap (that's already done some pretty intense 'Tapestr(y)-ification' of bootstrap components. 


The only terrible side effect of supplying an empty bootstrap.js is that some of the core components will cease to 
function unless I manually shim in the related js at the right times. 


We're also trying to use bootstrap fully in less; have included a reduced version of the full bootstrap via the AppModule 
and in the case of components including just a less file importing the specific component less and its dependencies (often 
just variables.less and mixins.less). This may be worth another topic; we're trying to figure out some best practices for using 
Bootstrap modularly and customizing it across multiple sites that require slight or extreme varying style. 


Really loving the direction 5.4 is taking more and more. Feels much more natural to use than previous iterations! 


Thanks, 
Peter 


P.S.: Bootstrap 3 is now final it seems! Hopefully we'll see it in 5.4 soon if we're lucky! :) 

----- Original Message -----

From: "Felix Gonschorek" <fe...@netzgut.net> 
To: "Tapestry users" <us...@tapestry.apache.org> 
Sent: Monday, August 19, 2013 9:36:52 PM 
Subject: Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js 

what you can do is a small hack: you can 
point org.apache.tapestry5.SymbolConstants.BOOTSTRAP_ROOT to a folder with 
an empty bootstrap.js file and then care by yourselfes to include it 
everywhere, where it's needed. 

you could include the minimum bootstrap.js in the border layout and then 
include the additions (e.g. boostrap-dropdown.js) the same way you are 
doing it currently where it's needed. 


On Mon, Aug 19, 2013 at 1:54 PM, Peter Hvass <P....@albourne.com> wrote: 

> Hi Thiago, 
> 
> 
> Thanks for the reply. I don't think I was clear enough in my first post! 
> 
> 
> In the instance where this is affecting us; 
> 
> 
> Our BootstrapDropdown mixin includes Bootstrap's bootstrap-dropdown.js 
> and Tapestry's core components (in this case, Errors) is including 
> bootstrap.js. 
> 
> 
> Since bootstrap.js also contains the contents of bootstrap-dropdown.js we 
> get a 
> double execution. 
> 
> 
> I'm aware that we could just opt to use bootstrap.js ourselves but I was 
> wondering 
> whether anyone on the dev team would deem using the individual 
> bootstrap-*.js files useful 
> and more modular as opposed to piling in the entire bootstrap.js each time. 
> 
> 
> Thanks! 
> Peter 
> 
> ----- Original Message ----- 
> 
> From: "Thiago H de Paula Figueiredo" <th...@gmail.com> 
> To: "Tapestry users" <us...@tapestry.apache.org> 
> Sent: Monday, August 19, 2013 2:44:51 PM 
> Subject: Re: [5.4] Use Individual Bootstrap Javascript Files Instead of 
> Just bootstrap.js 
> 
> On Mon, 19 Aug 2013 07:10:43 -0300, Peter Hvass <P....@albourne.com> 
> wrote: 
> 
> > Hi all, 
> 
> Hi! 
> 
> > We're running into issues where bootstrap.js is included by various core 
> > components and scripts are executing twice! 
> 
> Tapestry checks for duplicate additions of the same file and adds it only 
> once, so there's something wrong here: your code or Tapestry. How did you 
> include the JS files in your components? 
> 
> -- 
> Thiago H. de Paula Figueiredo 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org 
> For additional commands, e-mail: users-help@tapestry.apache.org 
> 
> 
> 


Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js

Posted by Felix Gonschorek <fe...@netzgut.net>.
what you can do is a small hack: you can
point org.apache.tapestry5.SymbolConstants.BOOTSTRAP_ROOT to a folder with
an empty bootstrap.js file and then care by yourselfes to include it
everywhere, where it's needed.

you could include the minimum bootstrap.js in the border layout and then
include the additions (e.g. boostrap-dropdown.js) the same way you are
doing it currently where it's needed.


On Mon, Aug 19, 2013 at 1:54 PM, Peter Hvass <P....@albourne.com> wrote:

> Hi Thiago,
>
>
> Thanks for the reply. I don't think I was clear enough in my first post!
>
>
> In the instance where this is affecting us;
>
>
> Our BootstrapDropdown mixin includes Bootstrap's bootstrap-dropdown.js
> and Tapestry's core components (in this case, Errors) is including
> bootstrap.js.
>
>
> Since bootstrap.js also contains the contents of bootstrap-dropdown.js we
> get a
> double execution.
>
>
> I'm aware that we could just opt to use bootstrap.js ourselves but I was
> wondering
> whether anyone on the dev team would deem using the individual
> bootstrap-*.js files useful
> and more modular as opposed to piling in the entire bootstrap.js each time.
>
>
> Thanks!
> Peter
>
> ----- Original Message -----
>
> From: "Thiago H de Paula Figueiredo" <th...@gmail.com>
> To: "Tapestry users" <us...@tapestry.apache.org>
> Sent: Monday, August 19, 2013 2:44:51 PM
> Subject: Re: [5.4] Use Individual Bootstrap Javascript Files Instead of
> Just bootstrap.js
>
> On Mon, 19 Aug 2013 07:10:43 -0300, Peter Hvass <P....@albourne.com>
> wrote:
>
> > Hi all,
>
> Hi!
>
> > We're running into issues where bootstrap.js is included by various core
> > components and scripts are executing twice!
>
> Tapestry checks for duplicate additions of the same file and adds it only
> once, so there's something wrong here: your code or Tapestry. How did you
> include the JS files in your components?
>
> --
> Thiago H. de Paula Figueiredo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>

Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js

Posted by Howard Lewis Ship <hl...@gmail.com>.
It's something that could be visited, but since the bootstrap JS files are
not modules, it would require naming and shimming each one, especially
because there are some dependencies between them.


On Mon, Aug 19, 2013 at 4:54 AM, Peter Hvass <P....@albourne.com> wrote:

> Hi Thiago,
>
>
> Thanks for the reply. I don't think I was clear enough in my first post!
>
>
> In the instance where this is affecting us;
>
>
> Our BootstrapDropdown mixin includes Bootstrap's bootstrap-dropdown.js
> and Tapestry's core components (in this case, Errors) is including
> bootstrap.js.
>
>
> Since bootstrap.js also contains the contents of bootstrap-dropdown.js we
> get a
> double execution.
>
>
> I'm aware that we could just opt to use bootstrap.js ourselves but I was
> wondering
> whether anyone on the dev team would deem using the individual
> bootstrap-*.js files useful
> and more modular as opposed to piling in the entire bootstrap.js each time.
>
>
> Thanks!
> Peter
>
> ----- Original Message -----
>
> From: "Thiago H de Paula Figueiredo" <th...@gmail.com>
> To: "Tapestry users" <us...@tapestry.apache.org>
> Sent: Monday, August 19, 2013 2:44:51 PM
> Subject: Re: [5.4] Use Individual Bootstrap Javascript Files Instead of
> Just bootstrap.js
>
> On Mon, 19 Aug 2013 07:10:43 -0300, Peter Hvass <P....@albourne.com>
> wrote:
>
> > Hi all,
>
> Hi!
>
> > We're running into issues where bootstrap.js is included by various core
> > components and scripts are executing twice!
>
> Tapestry checks for duplicate additions of the same file and adds it only
> once, so there's something wrong here: your code or Tapestry. How did you
> include the JS files in your components?
>
> --
> Thiago H. de Paula Figueiredo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>


-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js

Posted by Peter Hvass <P....@albourne.com>.
Hi Thiago, 


Thanks for the reply. I don't think I was clear enough in my first post! 


In the instance where this is affecting us; 


Our BootstrapDropdown mixin includes Bootstrap's bootstrap-dropdown.js 
and Tapestry's core components (in this case, Errors) is including bootstrap.js. 


Since bootstrap.js also contains the contents of bootstrap-dropdown.js we get a 
double execution. 


I'm aware that we could just opt to use bootstrap.js ourselves but I was wondering 
whether anyone on the dev team would deem using the individual bootstrap-*.js files useful 
and more modular as opposed to piling in the entire bootstrap.js each time. 


Thanks! 
Peter 

----- Original Message -----

From: "Thiago H de Paula Figueiredo" <th...@gmail.com> 
To: "Tapestry users" <us...@tapestry.apache.org> 
Sent: Monday, August 19, 2013 2:44:51 PM 
Subject: Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js 

On Mon, 19 Aug 2013 07:10:43 -0300, Peter Hvass <P....@albourne.com> 
wrote: 

> Hi all, 

Hi! 

> We're running into issues where bootstrap.js is included by various core 
> components and scripts are executing twice! 

Tapestry checks for duplicate additions of the same file and adds it only 
once, so there's something wrong here: your code or Tapestry. How did you 
include the JS files in your components? 

-- 
Thiago H. de Paula Figueiredo 

--------------------------------------------------------------------- 
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org 
For additional commands, e-mail: users-help@tapestry.apache.org 



Re: [5.4] Use Individual Bootstrap Javascript Files Instead of Just bootstrap.js

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 19 Aug 2013 07:10:43 -0300, Peter Hvass <P....@albourne.com>  
wrote:

> Hi all,

Hi!

> We're running into issues where bootstrap.js is included by various core  
> components and scripts are executing twice!

Tapestry checks for duplicate additions of the same file and adds it only  
once, so there's something wrong here: your code or Tapestry. How did you  
include the JS files in your components?

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org