Connection | CPU | Before | After | Improvement |
---|---|---|---|---|
Fast (200MB) | Fast | 1.5s | 0.2s | 750% |
Average (3G) | Fast | 5.6s 🐢 | 1.1s | 500% |
Average (3G) | Average | 7.5s 😞 | 1.3s | 570% |
Slow (Slow 3G) | Average | 22s 😱 | 4s | 550% |
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
{ | |
"plugins": [ | |
"stylelint-order" | |
], | |
"processors": ["stylelint-processor-styled-components"], | |
"extends": [ | |
"stylelint-config-recommended", | |
"stylelint-config-styled-components" | |
], | |
"rules": { |
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
/* Old (React Router) */ | |
<Link to="/my/page"> | |
A link | |
</Link> | |
/* New (Next.js router) */ | |
<Link href="/my/page" passHref> | |
<a> |
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 = { | |
webpack: (config, options) => | |
Object.assign(config, { | |
plugins: config.plugins.concat([ | |
new webpack.ProvidePlugin( | |
config.isServer | |
? {} | |
: { fetch: 'imports-loader?this=>global!exports-loader?global.fetch!whatwg-fetch' } | |
), | |
]), |
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 = { | |
webpack: (config, options) => | |
Object.assign(config, { | |
node: config.isServer ? undefined : { fs: 'empty' }, | |
}), | |
}; |
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
class HomePage extends React.Component { | |
static getInitialProps() { | |
// This only fires on the first SSR pass | |
} | |
componentDidMount() { | |
// This only fires in the client, when mounted (not on SSR) | |
} | |
… | |
} |
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
if (typeof window !== 'undefined') { | |
// Pls let me access `window` without everything blowing up | |
} |
Option | Default | Description |
---|---|---|
team |
(none) | Set the team label for this app |
project |
(none) | Set the project label for this app |
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 IronWorker = require('iron_worker'); | |
const Logger = require('logdna'); | |
const logger = Logger.setupDefaultLogger(process.env.KEY, {}); | |
// Task | |
logger.log('Starting job…'); | |
logger.log(`--BEGIN IRONWORKER PAYLOAD--`); | |
logger.log(IronWorker.params()); | |
logger.log(`--END IRONWORKER PAYLOAD--`); |
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
{ | |
"scripts": { | |
"deploy": "docker build -t $TAG . && docker push $TAG && manifold run -- iron register -e \"MANIFOLD_API_TOKEN=$MANIFOLD_TOKEN\" $TAG" | |
} | |
} |