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

Separate client and server logic - #45

Open
wingleung wants to merge 3 commits into
airbnb:masterfrom
wingleung:separate-client-and-server-logic
Open

Separate client and server logic#45
wingleung wants to merge 3 commits into
airbnb:masterfrom
wingleung:separate-client-and-server-logic

Conversation

@wingleung

@wingleungwingleung commented May 10, 2018

Copy link
Copy Markdown

Getting #5 started...

existing endpoint left intact to not break current implementations, or should we break?

new import on server side apps
import { renderReact } from 'hypernova-react/server';
new import client side
import { renderReact } from 'hypernova-react/client';

ljharb
ljharb previously requested changes May 10, 2018

@ljharbljharb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is the right way to do it, but we should change index.js so that it pulls in client and server (so there's only one source of truth)

@wingleung

Copy link
Copy Markdown
Author

@ljharb good that the concept is the right way to go, worked it out a little more please review.

@ljharbljharb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM but i'll let others review/merge

Comment threadsrc/index.js
},
server: () => renderReactStaticServer(name, component),

client() {},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: client() {} is preferred over client: () => {}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

thanks for noticing, arrow function is indeed not necessary in object methods

@ljharb
ljharb dismissed their stale reviewMay 11, 2018 19:54

deferring to others

@ljharb
ljharb requested a review from goatslackerMay 11, 2018 19:55
@wingleung
wingleungforce-pushed the separate-client-and-server-logic branch 2 times, most recently from 53149e7 to aad6a8aCompareMay 12, 2018 07:02
@wingleung
wingleungforce-pushed the separate-client-and-server-logic branch from b645d05 to e8fb23fCompareJuly 26, 2018 09:21
@wingleung

Copy link
Copy Markdown
Author

@ljharb@goatslacker ready to review, this PR splits server and client code making client code smaller

@ljharb
ljharbforce-pushed the separate-client-and-server-logic branch from e8fb23f to 681dbf3CompareAugust 15, 2018 19:43
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@wingleung@ljharb