This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const baseName = "SOME_CONSTANT_NAME_FOR_THIS" | |
const repository = new Repository(this, `${baseName}Repository`, { | |
repositoryName: snakeCase(`${baseName}Repository`), | |
}); | |
const logGroup = new LogGroup(this, `${baseName}LogGroup`, { | |
retention: 90, | |
logGroupName: '/aws/ecs/graphql-api', | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QUERY PLAN | | |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |
Aggregate (cost=6806492.29..6806492.30 rows=1 width=32) (actual time=4573.820..4573.837 rows=1 loops=1) | | |
Output: COALESCE(json_agg(row_to_json((SubPlan 2))), '[]'::json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
// ... | |
resolve: { | |
alias: { | |
'react-router': path.resolve(__dirname, './node_modules/react-router'), | |
}, | |
}, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/node | |
/* eslint-disable @typescript-eslint/no-unused-expressions */ | |
// eslint-disable-next-line import/no-extraneous-dependencies | |
const sh = require('shell-tag'); | |
const detectChangedFiles = () => { | |
const appFolders = ['routes', 'pages', 'modules', 'hooks']; | |
const changedFiles = sh`git diff develop --name-only`; | |
return changedFiles.split(/\n/g).filter((file) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 1. Fetch on render - render on useEffect/constructor | |
* 2. Not using a fetch which is suspense ready/has suspense features (swr, react-query, or even a wrapper on top of fetch) | |
* 3. Not using fallback for loading state on wrappers for the request | |
* 4. Error handling > create a custom error boundary to catch problems when we are rendering and while fetching! | |
*/ | |
const fetcher = (url) => fetch(url).then((r) => r.json()); | |
const SuspensefulUserProfile = ({ userId }) => { | |
const { data } = someSuspenseReadyFetcher(userId); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1.: | |
module.exports = { | |
entry: './src/index.js' | |
} | |
// index.js | |
fetch = myFetch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"jsonstream":[ | |
"examples", | |
"tests" | |
], | |
"agent-base":[ | |
"tests" | |
], | |
"ansicolors":[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
... | |
plugins: [ | |
new webpack.DefinePlugin({ | |
__DEV__: JSON.stringify(process.MY_ENV_VARIABLE) | |
}), | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// generates a single file for your component.js | |
// only when used. | |
// This returns a promise, which needs to be resolved. | |
import('./components/component.js') | |
// creates a chunk for each file inside your components folder | |
// This is called require context (which require.context is used under the hood) | |
// Webpack is smart enough to do that for you! | |
const myComponents = (componentName) => import(`./components/${componentName}.js`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
// ... | |
output: { | |
futureEmitAssets: true | |
} | |
} |
NewerOlder