Bug Tracker

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#12267 closed feature (patchwelcome)

investigate Making “offset” and “dimensions” modules independent of “css” module

Reported by: rafael@… 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”.

Change History (8)

comment:1 Changed 7 years ago by Rick Waldron

Component: unfiledbuild
Milestone: None1.next
Priority: undecidedlow
Status: newopen

This is definitely a reasonable request to explore for (maybe 1.8.x) 1.9

comment:2 Changed 7 years ago by mikesherov

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.

comment:3 Changed 7 years ago by Rick Waldron

@mikesherov - gotcha. Thanks for the quick clarification. I'm definitely anti-code-duplication.

comment:4 Changed 7 years ago by dmethvin

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.

comment:5 Changed 7 years ago by mikesherov

Owner: set to mikesherov
Status: openassigned
Summary: Make “offset” and “dimensions” modules independent of “css” moduleinvestigate Making “offset” and “dimensions” modules independent of “css” module

comment:6 Changed 6 years ago by dmethvin

Type: enhancementfeature

Bulk change from enhancement to feature.

comment:7 Changed 6 years ago by dmethvin

Resolution: patchwelcome
Status: assignedclosed

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.

comment:8 Changed 6 years ago by mikesherov

Glad we closed this.

Note: See TracTickets for help on using tickets.