Bug Tracker

Modify

Ticket #10753 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

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

comment:2 Changed 2 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 follow-up: ↓ 7 Changed 2 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 2 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 2 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 2 years ago by mikesherov

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

comment:7 in reply to: ↑ 3 Changed 2 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 2 years ago by rwaldron

@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 2 years ago by jaubourg

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

comment:10 Changed 2 years ago by timmywil

  • Owner set to mikesherov
  • Priority changed from undecided to low
  • Status changed from new to assigned
  • Component changed from unfiled to manipulation
  • Milestone changed from None to 1.8

comment:11 Changed 2 years ago by mikesherov

  • Status changed from assigned to closed
  • Resolution set to wontfix

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

comment:12 Changed 2 years ago by mikesherov

  • Status changed from closed to reopened
  • Resolution wontfix deleted

comment:13 Changed 2 years ago by mikesherov

  • Status changed from reopened to assigned

comment:14 Changed 2 years ago by Mike Sherov

  • Status changed from assigned to closed
  • Resolution set to fixed

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

Changeset: 07866a04ddcac0b912cd0a7e382fea8667b32d0e

comment:15 Changed 2 years ago by dmethvin

  • Milestone changed from 1.8 to 1.7.2

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.