Giter Site home page Giter Site logo

ssg-prototype's Introduction

The primary way ssg will work:

During BUILD

  1. readSiteInfo - from config - POJO
  2. createMarkdownIndex - zero config - an array of markdown
  3. createDataIndex - from config - POJO
  4. readSrcRoutes - from filesystem - array of svelte files
  5. readOldManifest - from cache - Map<path, data+getslice> (validateOldManifest?)
  6. createRoutes - from config - Map<path, data+getslice>
  7. generateManifest - zero config
  8. diffManifests - zero config - Map<path, data+getslice>
    • PLAN stops here
  9. buildFiles - zero config - generate Files
    • execute getDataSlice and append to index
    • not necessarily HTML -> JS, CSS and JSON
  10. postBuild - from config - pass index, output
    • FullData => RSS
    • Serverside Redirects?

--checkPlan flag

During DEV

  1. readSiteInfo - from config - POJO
  2. createMarkdownIndex - zero config - an array of markdown
  3. createDataIndex - from config - POJO
  4. readSrcRoutes - from filesystem - array of svelte files
  5. createRoutes - from config - Map<path, data+getslice>
  6. generateManifest - zero config
  7. servePath - zero config - generate Files
    • execute getDataSlice and append to index
    • not necessarily HTML -> JS, CSS and JSON

Concepts:

  • Site global info is readable anywhere. changing it forces complete rebuild.
  • We break up data fetching into (cheap) data index and (expensive) data slices. We memoize data slice calls and attach them to data Index in a FullData object, with which we can do final builds like for RSS.
  • ssg can generate pages, images, and misc files - we just call these "files"
  • plugins can: - contribute indexes - map from index they own to files - map from FullData index to files - map from indexes to new index? -> eg how to generate tags/categories
  • themes - fallback files

Features to design for:

  • swappable themes
  • shadowed/eject templates and webpack config
  • We want programmatic page creation
  • We want incremental builds
  • We want a nice dev mode
  • We want redirects -> clientside as well as serverside
  • We want typescript/postprocessing/postcss
  • We want RSS (dataslices)
  • we can stop and rerun any stages if misconfigured
  • REPL for data
  • Filesystem routing
  • postprocessing step - generate tags page, generate links per page

Nonfeatures:

  • No js in main page - just has mount points for svelte
  • No clientside routing
  • No functions/api routes
  • No plugins

ssg-prototype's People

Contributors

swyxio avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.