Using component within a tradition web application

44 views
Skip to first unread message

Luis Martins

unread,
Feb 23, 2014, 12:37:14 PM2/23/14
to compo...@googlegroups.com
Hi guys, 

Im considering Component as mean to replace jQuery plugins with custom made components, but not necessarily jQuery itself. Im also working with a traditional application, which loads js resources based on the view / features requested by the user. This is not a Single Page Application.

By reading the documentation, I get a bit confused on how can I use Component to that effect, I mean:

  1. How can I build components into separate files
  2. If previous point possible, is there any weight impact? Is is avoidable?
  3. How about sourcemaps, is it feasible in this scenario?

Thanks in advance for any insights you might be able to share on this.

Cheers.

Luis Martins

unread,
Feb 24, 2014, 5:18:48 AM2/24/14
to compo...@googlegroups.com
By "tradition" application I meant "traditional". 

pirxpilot

unread,
Feb 24, 2014, 9:17:12 AM2/24/14
to compo...@googlegroups.com
I replaced couple of JQuery plugins with components while keeping jQuery (for now) in one of the apps I'm working on.
I still load jQuery from CDN and I just write a component based application per page and load it separately - as one file. Once you compile it (and minimize/uglify/zip it) it's just a normal javascript after all. With properly set caching loading it might be actually more efficient than a script per module/component approach.

That said you can build each component into a separate file (for example using --standalone option of the builder) if you really want. There is some overhead for require/module instrumentation but should be negligible in most real world cases.
D.

Luis Martins

unread,
Feb 24, 2014, 9:19:50 AM2/24/14
to compo...@googlegroups.com
Per page builds sounds like what im looking for. Tks.

William Casarin

unread,
Feb 24, 2014, 3:06:15 PM2/24/14
to compo...@googlegroups.com
You can use https://github.com/yields/component-bundle for per-page builds.

Cheers,
Bill


--
You received this message because you are subscribed to the Google Groups "component" group.
To unsubscribe from this group and stop receiving emails from it, send an email to componentjs...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages