This is a private repo so I can’t share, but has anything been changed in the release that would impact the loading of handlers?
Here’s settings:
const settings = {
"name": "marketing-frontend-app",
"state": {
"frontity": {
"url": "https://www.hoffmanacademy.com",
"title": "Hoffman Academy",
"description": "Learn Piano Online",
"keywords" : "piano"
}
},
"packages": [
{
"name": "hoffman-theme",
},
{
"name": "@frontity/wp-source",
"state": {
"source": {
//"url": 'https://wpe.hoffmanacademy.com',
"url" : 'http://localhost:10008',
"homepage": "home-page",
"redirections" : "404",
},
"postTypes" : [{
type: "resource",
endpoint: "resource",
archive: "/resources",
},
{
type: "mega_topic",
endpoint: "/mega_topic",
archive: "/mega_topics",
},
{
type: "mega_footer",
endpoint: "/mega_footer",
archive: "/mega_footers",
},
{
type: "mega_main",
endpoint: "/mega_main",
archive: "/mega_mains",
}],
"taxonomies": [
{
taxonomy: "topic",
endpoint: "/topics/",
postTypeEndpoint: "/resource",
params: {
per_page: 5,
_embed: true,
},
},
{
taxonomy: "audience",
endpoint: "/audiences/",
postTypeEndpoint: "/resource",
params: {
per_page: 5,
_embed: true,
},
},
{
taxonomy: "feature",
endpoint: "/features/",
postTypeEndpoint: "resource",
params: {
per_page: 5,
_embed: true,
},
},
]
}
},
"@frontity/tiny-router",
"@frontity/yoast",
"@frontity/html2react",
]
};
export default settings;
Here’s index.js:
import {MENU} from "./const/menu";
import {topicHandler, topicsHandler} from "./handlers/topicHandler";
import {resourceHandler, resourcesHandler,resourceByTopicHandler, popularPostsHandler, featuredResourceHandler, relatedResourcesHandler} from "./handlers/resourceHandler";
import {searchHandler} from "./handlers/searchHandler";
import {topicMenuHandler, mainMenuHandler, footerMenuHandler} from "./handlers/menuHandler";
import {practiceCalculatorHandler, popularSongsHandler} from "./handlers/customPageHandlers";
import {settingsHandler} from "./handlers/settingsHandler";
import { CookieHelper } from "./helper/cookie-helper";
if(typeof process.env.NEW_RELIC_KEY !== 'undefined' && typeof process.env.NEW_RELIC_APP_NAME !== 'undefined') {
require('../../../newrelic');
}
const before = async ({ libraries, actions, d, f }) => {
/*
libraries.source.handlers.push(mainMenuHandler);
await actions.source.fetch("/mainmegamenu");
libraries.source.handlers.push(footerMenuHandler);
await actions.source.fetch("/footermegamenu");
libraries.source.handlers.push(topicMenuHandler);
await actions.source.fetch("/topicmegamenu");
*/
libraries.source.handlers.push(settingsHandler);
await actions.source.fetch("/theme-settings");
};
export default {
name: "hoffman-theme",
roots: {
theme: Root
},
state: {
theme: {
autoPrefetch: "in-view",
menu: MENU,
isMenuOpen: false,
featured: {
showOnList: false,
showOnPost: false,
},
salePopUpOpen : false,
salePopUpDismissed : false,
saleOn : false,
sale : {
sale_button_text: "Act Now",
sale_button_url: "https://www.hoffmanacamy.com/blog",
sale_headline: "Save 10%",
sale_image: {sizes:{medium:''}},
sale_running: false,
sale_supporting_text: "We have great stuff!"
},
cookiesAccepted : true,
liveBroadCasting : false,
}
},
actions: {
theme: {
openMenu: ({ state }) => {
},
closeMenu: ({ state }) => {
},
openSalePopUp: ({ state }) => {
state.theme.salePopUpOpen = true;
},
dismissSalePopUp: ({ state }) => {
CookieHelper.setSaleDismissedCookie();
state.theme.salePopUpOpen = false;
},
setSalePopUp: ({ state }) => {
state.theme.salePopUpOpen = !CookieHelper.getSaleDismissedCookie();
},
closeSalePopUp: ({ state }) => {
state.theme.salePopUpOpen = false;
},
init: ({ libraries }) => {
// Add the handler to wp-source.
libraries.source.handlers.push(topicHandler);
libraries.source.handlers.push(topicsHandler);
libraries.source.handlers.push(resourceHandler);
libraries.source.handlers.push(resourcesHandler);
libraries.source.handlers.push(resourceByTopicHandler);
libraries.source.handlers.push(searchHandler);
libraries.source.handlers.push(topicMenuHandler);
libraries.source.handlers.push(mainMenuHandler);
libraries.source.handlers.push(footerMenuHandler);
libraries.source.handlers.push(practiceCalculatorHandler);
libraries.source.handlers.push(popularSongsHandler);
libraries.source.handlers.push(popularPostsHandler);
libraries.source.handlers.push(featuredResourceHandler);
libraries.source.handlers.push(relatedResourcesHandler);
},
beforeSSR: before,
beforeCSR: before,
},
},
libraries: {
source: {
}
}
};