#12267 closed feature (patchwelcome)
investigate Making “offset” and “dimensions” modules independent of “css” module
Reported by: | 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 10 years ago by
Component: | unfiled → build |
---|---|
Milestone: | None → 1.next |
Priority: | undecided → low |
Status: | new → open |
comment:2 Changed 10 years ago by
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 10 years ago by
@mikesherov - gotcha. Thanks for the quick clarification. I'm definitely anti-code-duplication.
comment:4 Changed 10 years ago by
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 10 years ago by
Owner: | set to mikesherov |
---|---|
Status: | open → assigned |
Summary: | Make “offset” and “dimensions” modules independent of “css” module → investigate Making “offset” and “dimensions” modules independent of “css” module |
comment:6 Changed 10 years ago by
Type: | enhancement → feature |
---|
Bulk change from enhancement to feature.
comment:7 Changed 10 years ago by
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.
This is definitely a reasonable request to explore for (maybe 1.8.x) 1.9