import * as path from 'path'; | |
import * as url from 'url'; | |
function forEachDeep(obj, cb, options = { depth: 6 }) { | |
(function walk(value, property = undefined, parent = null, objPath = []) { | |
return value && typeof value === 'object' && objPath.length <= options.depth | |
? Object.entries(value).forEach(([key, val]) => | |
walk(val, key, value, [...objPath, key]) | |
) | |
: cb([property, value], parent, objPath); |
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
release: yarn rw prisma migrate deploy | |
web: bin/start-nginx node index.js |
🚶♂️ 23km █████████████▏░░░░░░ | |
🏃♂️ 12km ██████▌░░░░░░░░░░░░░ | |
🚴♂️ 0km ░░░░░░░░░░░░░░░░░░░░ | |
34km total |
import { ApolloServer, gql } from 'apollo-server-micro'; | |
const typeDefs = gql` | |
type Query { | |
sayHello: String | |
} | |
`; | |
const resolvers = { | |
Query: { |
import React, { Suspense, useState } from "react"; | |
import { unstable_createResource as createResource } from "react-cache"; | |
import { | |
Combobox, | |
ComboboxInput, | |
ComboboxList, | |
ComboboxOption | |
} from "./Combobox2.js"; | |
function App({ tabIndex, navigate }) { |
React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.
Table of Contents
React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.
React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".
With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.