-
-
Notifications
You must be signed in to change notification settings - Fork 738
Description
Move changes to book/10-end, decided against creating Chapter 11:
- retire inefficient
generateNumberSlugandgenerateSlug- either use_idasslugor generate unique values withMath.random(Chapter 11, explain motivation) -
bodyParser.rawtoexpress.rawfor 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
quantitytocreateSessionfor 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
dotenvforapp; updatenext.config.jsand update names for environmental variables; updateREADMEfile
Notes:
- imports:
npx @mui/codemod v5.0.0/preset-safe pages npx @mui/codemod v5.0.0/preset-safe components MyApp,MyDocumentSelect,event.stopPropagation()- removed
<InputLabel>Notification type</InputLabel> - theme, createTheme, type -> mode
- versions for
mobx,mobx-react - version of
eslintinapi - 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 allgetInitialPropswithgetStaticProps(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
DiscussionPageComppage to functional componentDiscussionPageCompFunctional(explainuseState,useEffect,useRef,usePrevious,firstGridItem, Express routes fordiscussion-fpage)- 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.renderandMyApp.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-endtobook/10-end; removebook/11-beginandbook/11-end - replace codebase inside
saaswith codebase insidebook/10-end - review instructions for
Node.js 14 running on 64bit Amazon Linux 2:enginesinpackage.json- build locally before deploy; only
startscript runs frompackage.jsonat 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)