Description
Move changes to book/10-end
, decided against creating Chapter 11:
- retire inefficient
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) - GA events example (Chapter 11: screenshots from GA dashboard)
- style for spinner from
nprogress
(change content inside chapter in question): - flash of font (change content inside chapter in question)
- add comment about passing
quantity
tocreateSession
for per seat subscription (change content inside chapter in question) - (will not implement, no taxes for SaaS software, Stripe charges 0.5%) Stripe: look into taxes:
- node v14.18.1
- next v12.0.3 (webpack v5, add two plugins for babel, react and react-dom v17.0.2)
- @mui/material v5.0.6 (breaking changes)
- retire
dotenv
forapp
; updatenext.config.js
and update names for environmental variables; updateREADME
file
Notes:
- imports:
npx @mui/codemod v5.0.0/preset-safe pages npx @mui/codemod v5.0.0/preset-safe components
MyApp
,MyDocument
Select
,event.stopPropagation()
- removed
<InputLabel>Notification type</InputLabel>
- theme, createTheme, type -> mode
- versions for
mobx
,mobx-react
- version of
eslint
inapi
- upgraded versions for
socket.io-client
,socket.io
,@types/socket.io
, remove@types/socket.io-client
, updatesocket.ts
, updatestore/index.ts
-
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: -
fixed redirect for logged-in user:
redirectUrl = `/your-settings?teamSlug=${user.defaultTeamSlug}`; asUrl = `/teams/${user.defaultTeamSlug}/your-settings`;
t.slug === selectedTeamSlug || userObj.defaultTeamSlug
-
c1f02ef convert
DiscussionPageComp
page to functional componentDiscussionPageCompFunctional
(explainuseState
,useEffect
,useRef
,usePrevious
,firstGridItem
, Express routes fordiscussion-f
page)- https://www.digitalocean.com/community/tutorials/five-ways-to-convert-react-class-components-to-functional-components-with-react-hooks
- https://reactjs.org/docs/hooks-effect.html
- https://stackoverflow.com/questions/62654874/replacing-componentdidupdate-with-useeffect
- https://stackoverflow.com/questions/53446020/how-to-compare-oldvalues-and-newvalues-on-react-hooks-useeffect
- https://stackoverflow.com/questions/53255951/equivalent-to-componentdidupdate-using-react-hooks
- add to content:
const mounted = useRef(); useEffect(() => { if (!mounted.current) { // do componentDidMount logic mounted.current = true; } else { // do componentDidUpdate logic } return () => { // do componentWillUnmount logic } }, [someProp]);
- explain firing of
MyDocument.render
andMyApp.getInitialProps
:
console.log('MyDocument.render');
console.log('MyApp.getInitialProps');
explain firing of lifecycle methods:
console.log('DiscussionPageComp.componentDidMount');
console.log('before condition DiscussionPageComp.componentDidUpdate');
console.log('inside condition DiscussionPageComp.componentDidUpdate');
console.log('DiscussionPageComp.componentWillUnmount');
explain firing of useEffect
hook:
console.log('useEffect 1 for DiscussionPageCompFunctional');
console.log('useEffect 2 for DiscussionPageCompFunctional');
- move changes from
book/11-end
tobook/10-end
; removebook/11-begin
andbook/11-end
- replace codebase inside
saas
with codebase insidebook/10-end
- review instructions for
Node.js 14 running on 64bit Amazon Linux 2
:engines
inpackage.json
- build locally before deploy; only
start
script runs frompackage.json
at AWS EB - review
config.yml
- review names of env vars
- redeploy demo (https://saas-app.async-await.com and https://saas-api.async-await.com)