Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make .attr() keep properties defined as serialize:false #11

Open
marshallswain opened this issue Aug 12, 2021 · 2 comments
Open

Make .attr() keep properties defined as serialize:false #11

marshallswain opened this issue Aug 12, 2021 · 2 comments

Comments

@marshallswain
Copy link
Member

marshallswain commented Aug 12, 2021

I've started a test for this here: https://github.com/canjs/can-23/pull/10/files. Will be fixed by #10

@marshallswain
Copy link
Member Author

When calling .attr() with no arguments, it internally calls mapHelpers.serialize with the how prop set to 'attr', here:

Screen Shot 2021-08-12 at 4 56 20 PM

The serialize method calls map.forEach, here:

Screen Shot 2021-08-12 at 4 59 00 PM

Inside forEach, the getOwnEnumerableKeys method is called:

Screen Shot 2021-08-12 at 5 00 39 PM

This eventually runs the version of can.getOwnEnumerableKeys from can-map-define.

Screen Shot 2021-08-12 at 5 01 34 PM

On line 444, above, calling keysForDefinition removes any attribute defined with serialize:false:

Screen Shot 2021-08-12 at 5 08 59 PM

@marshallswain
Copy link
Member Author

@justinbmeyer Maybe we can make a canReflect symbol for keysForDefinition to replace the one in the last screenshot?

marshallswain added a commit to canjs/can-map that referenced this issue Aug 17, 2021
This is for can-23 legacy .attr() compatibility.

See canjs/can-23#11
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

No branches or pull requests

1 participant