Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Conversation

@davide-dc-dev
Copy link
Contributor

Copy link
Contributor

@jasonLaster jasonLaster left a comment

Choose a reason for hiding this comment

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

Wow. looks great!


return sources.find(source => source.get("url") === url);
return sources.find(source => {
return source.get("url") === url;
Copy link
Contributor

Choose a reason for hiding this comment

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

this could be source.url == url

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've tried but it triggers some errors and tests failed

Copy link
Contributor

@darkwing darkwing Feb 13, 2018

Choose a reason for hiding this comment

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

Do you happen to know which? Travis says everything is all good :)

Also, can we do:

return sources.find(source => source.get("url") === url);

@davide-dc-dev
Copy link
Contributor Author

I get these errors If I put source.url == url

testsfailed

@darkwing
Copy link
Contributor

Wow, you're right; source.get("url") returns a URL while source.url return undefined

@davide-dc-dev
Copy link
Contributor Author

I've done some logs and I discovered that even the source in the function getPrettySource with source.url that I put returns an undefined. Actually It returns an URL with source.get("url").It's strange because the tests are all passed.

sourcesundefined

sourceundefined2

mapvalue

const updatedSource = existingSource.merge(source);
return state.setIn(["sources", source.id], updatedSource);
}
return state.mergeIn(["sources", source.id], new SourceRecordClass(source));

Choose a reason for hiding this comment

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

this converts the new Record into a Map, see this immutable bug. This causes the failures to retrieve attributes without using get().

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks! is there a good work around?

Choose a reason for hiding this comment

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

hey @jasonLaster... I changed state.mergeIn() in L197 to:
state.setIn(["sources", source.id], new SourceRecordClass(source);
and every source.get("x") with source.x and all tests now pass! I think @DavideDeCenzo may try to finalize it

Copy link
Contributor

Choose a reason for hiding this comment

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

oh thanks. that's promising. Re-opening

@jasonLaster
Copy link
Contributor

I think this PR has kinda gone out of scope. @DavideDeCenzo how do you feel about picking up something else while we try and figureout immutable.js!

@jasonLaster jasonLaster reopened this Feb 27, 2018
@davide-dc-dev
Copy link
Contributor Author

Thanks @giatorta Now It works!

@davide-dc-dev
Copy link
Contributor Author

@jasonLaster Now it should be better , the tests are passed also

@darkwing darkwing force-pushed the Immutable-records branch from c335f2b to 5c256fa Compare March 1, 2018 22:40
@jasonLaster jasonLaster merged commit ce97962 into firefox-devtools:master Mar 2, 2018
@jasonLaster
Copy link
Contributor

We're in! Great job @DavideDeCenzo

darkwing added a commit that referenced this pull request Mar 2, 2018
@davide-dc-dev davide-dc-dev deleted the Immutable-records branch March 2, 2018 20:18
jasonLaster pushed a commit that referenced this pull request Mar 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants