Skip to content

Conversation

@matthewepler
Copy link

No description provided.

Copy link
Owner

@joshdmiller joshdmiller left a comment

Choose a reason for hiding this comment

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

Great work. One thought - how might your code have to change in order to start with an initial liust of todos (say, from the server)?

// I see where you're going here, esp. towards the React lifecycles.
// It's useful to see it built from scratch.
// Is this something that developed over time and React just formalized,
// or is this a pattern React is championing and is just becoming defacto?
Copy link
Owner

Choose a reason for hiding this comment

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

More the latter; the idea is to make the UI a function of state (state => ui). A lot of frameworks build in this capability, but really React is the one that takes it all the way. Vue does a little too.

todoList.textContent = '';
// it's a little confusing to see you do it without a state object
// because in the first week's activities, the todo array is nested inside
// state{}. Not a big deal, but might throw some people off.
Copy link
Owner

Choose a reason for hiding this comment

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

Interesting feedback. Frankly, I never considered the activities related.

REFLECTION

Challenges:
* Knowing what is already in the DOM and what is being added. in renderTheUI(), my instinct
Copy link
Owner

Choose a reason for hiding this comment

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

These are all good thoughts. One feedback I would provide is to avoid premature optimization.

Where do you think a framework fits in here? How do they solve some of these challenges?

Copy link
Author

Choose a reason for hiding this comment

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

I think the framework would fit in when you need a direct and efficient relationship between data and the interface. Simply put, if there will be dynamic data, I want to instantly jump into React. Is that a crutch? Maybe?? But I don't see it being such a bad one if the tradeoff of relatively little bloat for ease of use is what i think it is. True?

Copy link
Owner

Choose a reason for hiding this comment

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

There is definitely a degree of "developer ergonomics" here, but I think there's more to it than that. Are you familiar with the virtual DOM in react? (ng2 has a similar concept)


COMMENTS
Part 2 of the Activities was way beyond what I could tackle on my own in just three days. Does this
mean I have gaping knowledge gap and I will be behind the curve next class?
Copy link
Owner

Choose a reason for hiding this comment

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

Emphatically not. 😄

Copy link
Author

Choose a reason for hiding this comment

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

whew. thanks.


// put it in the ul
todoList.appendChild( newLi );
function renderTheUi ({title, complete}) {
Copy link
Owner

Choose a reason for hiding this comment

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

This doesn't seem to be the same function signature as the activities.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I was confused about how to solve this one. I ventured away from the signature. Now I know when you write a signature in the Activities you intend it to stay that way! Thanks.

Copy link
Owner

Choose a reason for hiding this comment

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

lol Yeah, but there's a specific reason for this one. How might you handle the case where you need to load an initial set of todos (e.g. from the server)?

Copy link
Author

Choose a reason for hiding this comment

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

word. i think i solved for this in 2nd PR I made on 'day-001' but I may be missing the point altogether.

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.

2 participants