Skip to content

Instantly share code, notes, and snippets.

View stevector's full-sized avatar

Steve Persch stevector

View GitHub Profile
@scottopolis
scottopolis / gatsby-dynamic.js
Created November 26, 2019 16:09
Dynamic Content in Gatsby with Apollo and WPGraphQL
// This is just for example purposes, copy/pasting this won't work out of context. It is from the Gatsby Publisher theme by Static Fuse.
import React from 'react'
import { Box } from '@chakra-ui/core'
import Layout from '../../components/Layout'
import PostEntry from '../../components/PostEntry'
import Pagination from '../../components/Pagination'
import HeaderArchive from '../../components/HeaderArchive'
import SEO from '../../components/SEO'
import { useQuery } from '@apollo/react-hooks'
import gql from 'graphql-tag'
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active June 20, 2024 10:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma