Open tima101 opened 3 years ago
About getInitialProps: https://nextjs.org/docs/api-reference/data-fetching/getInitialProps Should it be changed to the getStaticProps or getServerSideProps in fetching data for pages?
EDIT: sorry if this isn't the right place, is there a section for questions/suggestions?
@marcosCapistrano Thanks for suggestion. I don't think there are many (or any) instances for using getStaticProps
(fetch data and render page at build time instead of request time). But worth looking into it. I added task to my list.
Move changes to
book/10-end
, decided against creating Chapter 11:generateNumberSlug
andgenerateSlug
- either use_id
asslug
or generate unique values withMath.random
(Chapter 11, explain motivation)bodyParser.raw
toexpress.raw
for Stripe's webhook (change content inside chapter in question)nprogress
(change content inside chapter in question):quantity
tocreateSession
for per seat subscription (change content inside chapter in question)dotenv
forapp
; updatenext.config.js
and update names for environmental variables; updateREADME
fileNotes:
MyApp
,MyDocument
Select
,event.stopPropagation()
<InputLabel>Notification type</InputLabel>
mobx
,mobx-react
eslint
inapi
socket.io-client
,socket.io
,@types/socket.io
, remove@types/socket.io-client
, updatesocket.ts
, updatestore/index.ts
[x] check if which page and store methods should be made private (see multiple methods in
DiscussionPageComp
)see if it makes sense to replaceRequires removing allgetInitialProps
withgetStaticProps
(fetch data at build time and render page) orgetServerSideProps
(fetch data at request time and render page) (InvitationPageComp
:getInitialProps
->getServerSideProps
)getInitialProps
, serializing data, separate export:[x] fixed redirect for logged-in user:
t.slug === selectedTeamSlug || userObj.defaultTeamSlug
[x] https://github.com/async-labs/saas/commit/c1f02ef4545141f91e831fbf7297a39a98ae1413 convert
DiscussionPageComp
page to functional componentDiscussionPageCompFunctional
(explainuseState
,useEffect
,useRef
,usePrevious
,firstGridItem
, Express routes fordiscussion-f
page)useEffect(() => { if (!mounted.current) { // do componentDidMount logic mounted.current = true; } else { // do componentDidUpdate logic }
return () => { // do componentWillUnmount logic } }, [someProp]);
MyDocument.render
andMyApp.getInitialProps
:explain firing of lifecycle methods:
explain firing of
useEffect
hook:book/11-end
tobook/10-end
; removebook/11-begin
andbook/11-end
saas
with codebase insidebook/10-end
Node.js 14 running on 64bit Amazon Linux 2
:engines
inpackage.json
start
script runs frompackage.json
at AWS EBconfig.yml