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

Add debug name to units and hooks, Fix examples #18

Merged
merged 3 commits into from Apr 16, 2019

Conversation

Projects
None yet
2 participants
@morsdyce
Copy link
Collaborator

morsdyce commented Apr 8, 2019

Fix examples to be able to run locally (breaks codesandbox).

There is an issue where there are duplicate react instances which doesn't allow to run both codesandbox examples and local examples.

We need to figure out how to run both at the same time.

@morsdyce morsdyce requested a review from adamkleingit Apr 8, 2019

@adamkleingit

This comment has been minimized.

Copy link
Collaborator

adamkleingit commented Apr 9, 2019

Actually, I think the examples should rely on the NPM version, not the development code.
Development should rely on unit tests.
And we should probably link to codesandbox with a specific tag/version, so that versioned docs always point to the correct version of the code

@morsdyce

This comment has been minimized.

Copy link
Collaborator Author

morsdyce commented Apr 9, 2019

@adamkleingit

This comment has been minimized.

Copy link
Collaborator

adamkleingit commented Apr 9, 2019

Why do you need examples do develop locally? After we have unit tests you don't need examples.
And after we publish a new version to NPM - we can update the examples with the correct version
Let's talk about it in the office :)

@morsdyce morsdyce referenced this pull request Apr 10, 2019

Merged

Babel macro support #19

@morsdyce

This comment has been minimized.

Copy link
Collaborator Author

morsdyce commented Apr 14, 2019

Restored examples to point to published version, removed reuse debugName

@@ -67,6 +80,7 @@ export const createStore = () => {
if (!store.unitContexts.has(unit)) {
const unitContext = {
unit,
debugName: unit.debugName || unit.name,

This comment has been minimized.

Copy link
@adamkleingit

adamkleingit Apr 16, 2019

Collaborator

I don't think a unit's debugName should be determined by its consumer, because there might be a few consumers to the same unit. So maybe it makes more sense to decorate the unit (see comment to Memo)


export const Memo = (unit, areEqual = shallowCompare) => {
export const Memo = (unit, areEqual = shallowCompare, debugName) => {

This comment has been minimized.

Copy link
@adamkleingit

adamkleingit Apr 16, 2019

Collaborator

Maybe a different decorator - DebugName(unit, name), or change to Decorate(unit, options)
I wonder why React's Memo is not curryed

@@ -1,4 +1,4 @@
import { Memo, reuseEffect, reuseReducer } from "../../reusable";
import { Memo, reuseEffect, reuseReducer } from "../../../../dist/reusable";

This comment has been minimized.

Copy link
@adamkleingit

adamkleingit Apr 16, 2019

Collaborator

Missed this one

@adamkleingit adamkleingit merged commit 41c7714 into master Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.