Skip to content

Instantly share code, notes, and snippets.

View nelsonpecora's full-sized avatar

Nelson Pecora nelsonpecora

View GitHub Profile
@nelsonpecora
nelsonpecora / post-prisma.md
Last active November 13, 2019 06:20
Post-Prisma data handling

As Prisma 1 is feature-frozen and Prisma 2 is going in some directions (no generated SDL schemas, code-first) that might not fit our needs, I've started research on some alternatives.

Data Layer

Prisma 2

PROS:

  • no separate server needed
  • nested mutations (OpenCRUD)
"""
Content is the interface for all of our varied types of records.
When serving content over the API, only the Content ID is exposed, not
the internal IDs from concrete record tables.
"""
interface Content {
id: ID!
contentType: ContentType! # e.g. ARTICLE, BUNDLE, IMAGE, etc
memberOf: [Content!]!
# When records are members of another type of content, they have a
@nelsonpecora
nelsonpecora / render.js
Created June 20, 2019 19:55
Janky server-side rendering of prosemirror docs
const _ = require('lodash');
const cuid = require('cuid');
function renderText(renderBranch, renderLeaf) {
return (acc, node) => {
if (node.doc) {
return renderText(renderBranch, renderLeaf)(acc, node, node.doc);
} else if (node.content) {
return renderBranch(acc, node, node.content);
} else if (node.text) {
@nelsonpecora
nelsonpecora / 2018_clay_retrospective.md
Last active November 28, 2018 21:43
My thoughts on Clay after three years

Clay Retrospective

The Good

  • allowing maximum flexibility in component design
  • standardized editing interfaces across components
  • style variations!
  • page templates were a good idea (but needed better organizational ux)
  • simplified permissions structure was a good idea
    • with friction for certain changes
@nelsonpecora
nelsonpecora / amphora_roadmap.md
Created January 23, 2018 17:25
Possible roadmap to amphora updates
  1. page history / pass user to plugins (for specific page updates)
  2. break out amphora-fs plugin
  3. break out amphora-memoization plugin
  4. deprecate lists
    • autocomplete → elasticsearch
    • new page templates api
  5. nginx / kong
  6. streams!
  7. break out amphora-scheduling plugin
  8. break out amphora-webhooks plugin
@nelsonpecora
nelsonpecora / amphora_breakdown.md
Last active January 22, 2018 22:17
A breakdown of the current state of amphora and how it should actually be structured

What Amphora Does

  • saves + retrieves data from db
    • components
      • @published
      • model.js
      • alternate render ext.model.js
      • upgrade.js
      • extensions
    • pages

CSS Considerations

These are considerations that we want to keep in mind as we design systems for styling components and sites. Not all considerations must be met 100%, but the weighting of relative importance will determine what we want the system to focus on.

  • maintainability
    • ease of creating new components
    • ease of creating new sites
    • ease of updating components
    • ease of updating sites
  • developer / designer happiness

Kiln 5.0 Documentation

Narrative

Introduction

  • npm installation stuff
  • clay-kiln component
  • kilnInternals component list
  • user experience
@nelsonpecora
nelsonpecora / site-specific.yaml
Created July 5, 2017 17:48
Site-specific behaviors: site transclusion vs (site args)
# site transclusion
someField:
_label: Some Field
_has:
- label
-
fn: description
value: Some site-specific field
-
fn: site-specific
@nelsonpecora
nelsonpecora / di-add.scss
Created June 29, 2017 21:07
Strict style rules
// sites/di/ad.css
@import 'mixins';
@import 'styleguide';
.ad {
display: none;
margin: 0 auto;
position: relative;
text-align: center;