Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#10753 closed enhancement (fixed)

inline the evalScript function in manipulation.js as it's only used once

Reported by: mikesherov Owned by: mikesherov
Priority: low Milestone: 1.7.2
Component: manipulation Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

As far as I can tell, there is no reason to have this be a named function and can be inlines. Can save some bytes, so... 1.8?

Change History (15)

comment:2 Changed 12 years ago by jaubourg

Please, try and not be overzealous. It makes sense to have this portion of the code in a separate function from a maintenance perspective. I like the idea of saving bytes like anyone else but, by the same reasoning, jQuery itself would be one big function ;)

As a side note, wouldn't it be more productive to have a code review in an oksoclap or google docs rather than a myriad of tickets and pull requests? That way, you can pinpoint the opportunities for DRY and byte savings and yet have the whole team review it first before making a PR for each line :)

comment:3 Changed 12 years ago by mikesherov

jaubourg, from my perspective, when a function gets called twice, that's when it makes sense to have it be a separate function.

If you feel otherwise, as maintainability is mostly subjective, I'll respect that and defer to your expertise, but the idea that inlining a function that only gets called once would lead to jQuery being one big function is a slippery slope argument. On the flip side, I can make a slippery slope argument that all callbacks should be defined in there own functions in case we ever need to reuse them.

With regards to using google docs, I'm cool with that, I wasn't aware that was something commonly done by the team. How do I go about getting the team's attention if I create a google doc for all those changes?

comment:4 Changed 12 years ago by mikesherov

P.S. thanks for the feedback. I appreciate the time you're taking to help get me to be my most effective.

comment:5 Changed 12 years ago by dmethvin

As far as timing goes, I'd like to wait until we finish the crush of 1.7.1 to keep the pull queue clean. These could wait for 1.8 unless they're critical for other reasons such as fixing bugs.

comment:6 Changed 12 years ago by mikesherov

No problem. I'll close this PR till then.

comment:7 in reply to:  3 Changed 12 years ago by jaubourg

I dunno who's in charge of this but maybe getting onto the jquery bug team mailing list would be a good first step given how active you've been lately :)

Dave?

Replying to mikesherov:

jaubourg, from my perspective, when a function gets called twice, that's when it makes sense to have it be a separate function.

If you feel otherwise, as maintainability is mostly subjective, I'll respect that and defer to your expertise, but the idea that inlining a function that only gets called once would lead to jQuery being one big function is a slippery slope argument. On the flip side, I can make a slippery slope argument that all callbacks should be defined in there own functions in case we ever need to reuse them.

With regards to using google docs, I'm cool with that, I wasn't aware that was something commonly done by the team. How do I go about getting the team's attention if I create a google doc for all those changes?

comment:8 Changed 12 years ago by Rick Waldron

@jaubourg the bugs team mailing list was recently made public for reading, but only bugs team members can actually post to it.

@mikesherov - I've sent you an invite to the bugs team mailing list. This will give you posting permission

comment:9 Changed 12 years ago by jaubourg

@rick I knew about the list being made public, I was obviously talking about posting permission

comment:10 Changed 12 years ago by Timmy Willison

Component: unfiledmanipulation
Milestone: None1.8
Owner: set to mikesherov
Priority: undecidedlow
Status: newassigned

comment:11 Changed 12 years ago by mikesherov

Resolution: wontfix
Status: assignedclosed

this will be fixed when JSHint is implemented here: https://github.com/jquery/jquery/pull/602/files#L14L359

comment:12 Changed 12 years ago by mikesherov

Resolution: wontfix
Status: closedreopened

comment:13 Changed 12 years ago by mikesherov

Status: reopenedassigned

comment:14 Changed 12 years ago by Mike Sherov

Resolution: fixed
Status: assignedclosed

Fix #10753. Inline evalScript as it's only used in one place

Changeset: 07866a04ddcac0b912cd0a7e382fea8667b32d0e

comment:15 Changed 12 years ago by dmethvin

Milestone: 1.81.7.2
Note: See TracTickets for help on using tickets.