Contribute to Frontity (Code Base Guide)

These threads will be helpful for the understanding frontity code base, so we can contribute.
If I go wrong, don’t hesitate to correct me.

Note:- sometimes you need to be familiar with React, TypeScript to understand below threads

Global Store structure

{
  roots: {
    theme: {
      '$typeof': Symbol(react.memo),
      type: [Function],
      compare: null,
      displayName: 'Theme'
    }
  },
  fills: {},
  state: {
    router: { path: '/', page: 1, location: [Function: location] },
    theme: { menu: [Array] },
    source: {
      data: [Function: data],
      dataMap: {},
      category: {},
      tag: {},
      post: {},
      page: {},
      author: {},
      attachment: {},
      apiUrl: 'https://test.frontity.io/wp-json',
      isWPCom: false
    },
    frontity: {
      url: 'https://test.frontity.io',
      title: 'Test Frontity Blog',
      description: 'WordPress installation for Frontity development',
      name: 'my-app',
      mode: 'html',
      platform: 'server',
      initial: [Object],
      packages: [Array]
    }
  },
  actions: {
    router: { init: [Function], set: [Function] },
    theme: { beforeSSR: [Function] },
    source: { fetch: [Function], init: [Function] }
  },
  libraries: {
    source: {
      api: [Api],
      resolver: [Resolver],
      populate: [AsyncFunction: populate]
    }
  },
  name: '@frontity/wp-source',
  getSnapshot: [Function: getSnapshot]
}

Some Important Files

  • @ frontity/connect/src/connect.js
  • @ frontity/wp-source/index.ts

Hey @smit.soni22, thanks for starting this post :slight_smile:

I’m actually writing docs about this and I want to release them as soon as possible although I’ve been super busy lately. Once I finish I’ll let you know and we can talk more about what’s missing and need to be extended.

thanks @luisherranz , take your time.

In mean time I will update code for comment section.

1 Like