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

Conversation

@marbemac
Copy link
Contributor

  • Improves documentation / readme with more examples
  • Adds refMap property to resolve result. Description in types file.
  • Increases test coverage a bit by adding some new tests and removing some unneeded code.

@marbemac marbemac requested a review from XVincentX November 24, 2018 18:46
@marbemac
Copy link
Contributor Author

Ugh, my local git was setup with the wrong commit signer - fixed for future.

Copy link
Contributor

@XVincentX XVincentX left a comment

Choose a reason for hiding this comment

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

Ok, thanks a lot. This PR has clarified some important things on the library as well as adding the feature I was looking for. 🚀

// }
// }
// }
// ==> result is the original object, with local refs resolved and replaced
Copy link
Contributor

Choose a reason for hiding this comment

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

I get what you mean here, however I'd say "it's a new object with local refs resolved and replaced"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a new object though, it's better than that :). Added a few new test assertions to demonstrate the immutability principles, check them out: https://github.com/stoplightio/json-ref-resolver/blob/feat/ref-map/src/__tests__/resolver.spec.ts#L139-L147

Structural sharing is particularly important for frontend applications like react, that can take advantage of it to re-render less parts of the screen since === will remain true for much of the object (anything that was not a ref).

@XVincentX
Copy link
Contributor

@marbemac

image

I can't merge this PR — I'm afraid you'll have to do it.

Feel free to address the comments; or just merge it.

@marbemac marbemac merged commit cd9ccc9 into master Nov 26, 2018
@marbemac marbemac deleted the feat/ref-map branch November 26, 2018 18:47
@marbemac
Copy link
Contributor Author

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants