Skip to content

Conversation

@dmethvin
Copy link
Member

Fixes #283

src/css.js Outdated
return ret;
};

migrateWarnProp( jQuery, "cssProp", {}, "jQuery.cssProp is deprecated and has no effect" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cssProps, not cssProp. :-) The same in a few other places.

@dmethvin
Copy link
Member Author

I'm opening a ticket for this in jQuery, it can't be landed as-is.

Copy link
Member

@Krinkle Krinkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will trigger a warning when accessing property "cssProps" of object jQuery. It will trigger for var a = jQuery.cssProps;, jQuery.cssProps = b;.

Indirectly, it will also trigger for var c = jQuery.cssProps[ key ] and jQuery.cssProps[ key ] = d, by being supersets of A and B. But as it stands, this code would trigger 2 warnings for access of jQuery.cssProps given jQuery core from before jquery/jquery#4005, and would trigger 1 warning given jQuery core from after jquery/jquery#4005.

Is there a way we can do a catch-all for properties being set within this object? From the reply at jquery/jquery#4005, it sounds like you have something in mind, but aside from the old non-standard setters and too-new ES6 Proxy, I don't know of a way.

@dmethvin
Copy link
Member Author

dmethvin commented Mar 24, 2018 via email

@dmethvin
Copy link
Member Author

Here's the PoC: http://jsbin.com/wewofay/edit?js,console

I still need to do a perf comparision. Hoping that getting will stay pretty fast and it doesn't really matter if setting gets slower since it shouldn't happen often at all.

@Krinkle Krinkle dismissed their stale review March 25, 2018 02:57

Looks good. I supppse it’ll be conditional on Proxy being available, without fallback?

dmethvin added a commit to dmethvin/jquery-migrate that referenced this pull request Mar 25, 2018
Fixes jquery#283
Closes jquery#291

squash! Switch to Proxy for detecting writes
@dmethvin
Copy link
Member Author

@Krinkle Yeah, I've updated the PR to use Proxy but still can't land it quite yet because it needs (at minimum) a version check which will be provided by #299. At that point it could be landed although it may make more sense to wait until core does its next release which will include the changes I have in jquery/jquery#4005 .

@dmethvin
Copy link
Member Author

This shows that Proxy makes things "slower", even in the read case, but the numbers for both are so incredibly high that I'm not convinced they're right. If they are, the Proxy is certainly fast enough IMO. The most common case by far would be just reading the object so I'm not concerned about the read/write case at all, I just included it for completeness.

https://esbench.com/bench/5ab914eef2949800a0f61973

dmethvin added a commit to dmethvin/jquery-migrate that referenced this pull request Mar 29, 2018
Fixes jquery#283
Closes jquery#291

squash! Switch to Proxy for detecting writes
@jquery jquery deleted a comment Oct 8, 2018
@jquery jquery deleted a comment Oct 8, 2018
@jquery jquery deleted a comment Oct 8, 2018
@dmethvin dmethvin closed this May 27, 2019
@dmethvin dmethvin deleted the 283-cssProps branch May 27, 2019 02:50
@mgol
Copy link
Member

mgol commented May 27, 2019

@dmethvin Why did you close this one?

@dmethvin
Copy link
Member Author

Whoops, I accidentally deleted the branch on my fork. I've got it locally and can push it back up though.

@dmethvin dmethvin restored the 283-cssProps branch May 27, 2019 11:50
@dmethvin dmethvin reopened this May 27, 2019
dmethvin added a commit to dmethvin/jquery-migrate that referenced this pull request Jun 9, 2019
Fixes jquery#283
Closes jquery#291

squash! Switch to Proxy for detecting writes
dmethvin added a commit to dmethvin/jquery-migrate that referenced this pull request Jun 9, 2019
Fixes jquery#283
Closes jquery#291

squash! Switch to Proxy for detecting writes
@dmethvin
Copy link
Member Author

dmethvin commented Jun 9, 2019

Merged as 18618af

@dmethvin dmethvin closed this Jun 9, 2019
@dmethvin dmethvin deleted the 283-cssProps branch June 9, 2019 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warn and fill jQuery.cssProps

3 participants