このメモは、私(@ymmt2005)が長年にわたってソフトウェアプロダクト開発に関わってきて 2022年現在こうしたほうが良いと考えているベストプラクティスです。
科学的な分析等に基づくわけではない経験則であるため、今後も随時見直すことがありますし、 ここに書いてあることが常に正しいわけでもあらゆるソフトウェア開発に適するわけでもありません。
しかしながら、実務経験が豊富で、モダンな技術スタックに明るいエンジニアの経験則は一定の 役に立つのではないかと考えて記します。
# Serve nextJS app from a port through NGINX reverse proxy (HTTP) | |
# Path: /etc/nginx/sites-available/default | |
# Default server configuration for HTTP | |
server { | |
server_name www.DOMAINNAME.com DOMAINNAME.com; | |
# Serve any static assets with NGINX | |
location /_next/static { | |
alias /home/ubuntu/PROJECT_FOLDER/.next/static; |
tsconfig.json
の設定についてのメモ書きです。
target は 変換後のコードのECMAScriptバージョンを指定する
たとえば、Node.js 14はES2020をサポートしている。そのため、Node.js 14向けのコード(サーバなど)ならtarget: "ES2020"
を指定することで、余計なTranspileが省かれててコードサイズや実行時間が最適化される。
Lately I have been busy reading some new books on Domain Driven Design (DDD) and software architecture -- including a short yet eye-opening one in Python and a great one in F#. At the same time, it seems that more people in the Functional Programming world are looking at more formal approaches to modelling -- some examples here. This has brought some thought from the background of my brain about how we should model, organize, and architect software using the lessons we've learnt from functional programming.
Before moving on, let me be clear about this being just a dump of some thoughts, not always well-defined, definite
// Copyright 2020 Aibex, Inc <oss@aibex.com> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to | |
// deal in the Software without restriction, including without limitation the | |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |
// sell copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in |
function useAbortController() { | |
const abortControllerRef = React.useRef() | |
const getAbortController = React.useCallback(() => { | |
if (!abortControllerRef.current) { | |
abortControllerRef.current = new AbortController() | |
} | |
return abortControllerRef.current | |
}, []) | |
React.useEffect(() => { |
useSubscription
and useMutableSource
1 tearing and deopt behavior.
The tree below represents a React application mounting. During mount, two components read from an external, mutable source. The first one (List
) reads version 1 of that data and the second one (Item
) reads version 2.
N/A.
How can you configure a CloudFront distribution to pass all headers to the origin if the CloudFront distribution is deployed using CloudFormation? If you deploy the distribution in the AWS Web Console, you can select between None
, Whitelist
and All
. In CloudFront it appears that you can only assert a whitelist of allowed headers. This is done in this area of a CloudFormation resource describing a CloudFront distribution
Resources:
CloudFrontDistribution:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
import WatchConnectivity | |
class WatchSessionManager: NSObject, WCSessionDelegate { | |
static let sharedManager = WatchSessionManager() | |
private override init() { | |
super.init() | |
} | |
private let session: WCSession? = WCSession.isSupported() ? WCSession.default : nil |
2020/5/31追記:
自分用のメモに書いていたつもりだったのですが、たくさんのスターを頂けてとても嬉しいです。
と同時に、書きかけで中途半端な状態のドキュメントをご覧いただくことになっており、大変心苦しく思っています。
このドキュメントを完成させるために、今後以下のような更新を予定しています。
2021/1/22追記: