Side navigation
#12267 closed feature (patchwelcome)
Opened August 11, 2012 04:18PM UTC
Closed January 04, 2013 06:56PM UTC
Last modified January 04, 2013 07:06PM UTC
investigate Making “offset” and “dimensions” modules independent of “css” module
Reported by: | rafael@rafbm.io | Owned by: | mikesherov |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | build | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
With the new modular jQuery 1.8.0, I was excited to be able to strip some bytes off.
Like most developers these days, I try to let CSS do as much work as possible when it comes to styling and transitions. I never use .css(), .show(), .hide() or .animate(). Instead, I handle state changes only by toggling classes and I use CSS transitions where needed.
Thus, I’d really like to be able to get rid of both the “effects” and “css” modules, because they are huge. I can drop the “effects” module without problems since no other module depends on it. It’s not the case for “css”, on which “offset” and “dimensions” depend. I still use these two often because they solve many browser inconsistencies.
I’m certainly not the only developer in this situation. It would be very pragmatic to make “offset” and “dimensions” independent of “css”.
Attachments (0)
Change History (8)
Changed August 11, 2012 05:29PM UTC by comment:1
component: | unfiled → build |
---|---|
milestone: | None → 1.next |
priority: | undecided → low |
status: | new → open |
Changed August 11, 2012 06:26PM UTC by comment:2
Well, it depends. The reason offset and dimensions are small is because of their dependence on CSS, not in spite of it. To make them independent likely requires plenty of duplicated code.
Sure, it's worth exploring, but I doubt very little will be done here.
Changed August 11, 2012 08:28PM UTC by comment:3
@mikesherov - gotcha. Thanks for the quick clarification. I'm definitely anti-code-duplication.
Changed August 13, 2012 02:40PM UTC by comment:4
If the properties we need in offset/dimensions are consistently available via elem.style or getComputedStyle and don't need any of the .css() workarounds, it doesn't seem like it would be a problem to have that small amount of duplication. I suspect we'd have to wait for 2.0 and oldIE to be off our backs though.
Changed August 13, 2012 06:00PM UTC by comment:5
owner: | → mikesherov |
---|---|
status: | open → assigned |
summary: | Make “offset” and “dimensions” modules independent of “css” module → investigate Making “offset” and “dimensions” modules independent of “css” module |
Changed September 09, 2012 01:10AM UTC by comment:6
type: | enhancement → feature |
---|
Bulk change from enhancement to feature.
Changed January 04, 2013 06:56PM UTC by comment:7
resolution: | → patchwelcome |
---|---|
status: | assigned → closed |
I can see some places in offset.js where the new array getter for .css()
would be handy, at least for reducing file size if not performance.
To the subject of the ticket, it looks to me like we should keep the css.js dependency here. If someone wants to refactor to avoid it we could review the patch.
Changed January 04, 2013 07:06PM UTC by comment:8
Glad we closed this.
This is definitely a reasonable request to explore for (maybe 1.8.x) 1.9