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

[WIP] Map functionality #50

Closed
wants to merge 2 commits into from

Conversation

jbrantly
Copy link

Addresses #48

Instead of trying to explain what I meant I figured I'd just show. This is a partial implementation that only covers shallow rendering. In the added unit test, if mapping functionality was not available, the output would show <Wrapper(BasicClass) />. With mapping we are able to unwrap the class and set the display to whatever we want. Of course the mapping would also allow many other kinds of modifications like changing props, children, etc.

If you like this concept I can continue fleshing it out.

One big question I have is how you could pass options to the serializer, especially something like a mapping function.

Oh, and since I work on a Windows machine I needed to make a couple changes to allow the tests to run on Windows.

@codecov-io
Copy link

codecov-io commented Feb 28, 2017

Codecov Report

Merging #50 into master will decrease coverage by -0.65%.
The diff coverage is 96.42%.

@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
- Coverage   96.34%   95.69%   -0.65%     
==========================================
  Files           7        7              
  Lines          82       93      +11     
==========================================
+ Hits           79       89      +10     
- Misses          3        4       +1
Impacted Files Coverage Δ
src/shallow.js 100% <100%> (ø)
src/index.js 100% <100%> (ø)
tests/core/fixtures/class.js 91.66% <85.71%> (-8.34%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ae7351...7208e02. Read the comment docs.

@adriantoine
Copy link
Owner

adriantoine commented Mar 2, 2017

Hi @jbrantly!

It actually looks quite interesting! If you add support for other wrapper types (shallow and react wrappers), and add documentation and unit tests, I'd be happy to merge it!

Thanks a lot for your contribution!

@jbrantly
Copy link
Author

jbrantly commented Mar 7, 2017

FYI, I'm still planning on finishing this, just have to find the time.

@adriantoine
Copy link
Owner

Hey @jbrantly, no problem, there's no rush at all!

I made a few changes on master, (upgrading dependencies and CI stuff) so there are conflicts on your PR now, sorry for that.

@adriantoine
Copy link
Owner

Is this still in progress? @jbrantly

@adriantoine adriantoine changed the title Map functionality [WIP] Map functionality Apr 11, 2017
@adriantoine
Copy link
Owner

Closing this as it hasn't been updated in a while, and a map functionality has been made by @pedrottimark in #56.

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.

3 participants