I’m in the process of moving my blog and personal site from gatsby to frontity: https://czaplinski.io
While doing it, I’ve collected some notes on things that we might improve:
-
I think that we could create a very barebones “hello-world” theme which has just 1 component and no configuration. I think this would help users to understand what is the “baseline” for a fronity app. Especially for someone used to
create-react-app
ornext
or gatsby, this could make more sense initially. -
When running
npx frontity create
and asking the user to select a theme we should probably explain in one sentence what a theme is! For many JS developers who have used gatsby or next.js this is something completely new and they might not understand why they need to select a theme!We should say that you should use mars or 2020 if you already have a WP instance and that you want to see how it would look like with a frontity theme. And you could use a “barebones” theme if you have a completely green field and just want to see what the simplest possible app looks like.
-
We should ask the user to add the api endpoint as a question in the CLI (JuanMa has actually mentioned it already in Add WP REST API url directly from command line when "frontity create")
-
Maybe we could always add the packages:
"@frontity/tiny-router", "@frontity/html2react",
by default and with default settings so that we do not need to specify them in the
frontity.settings.js
for a basic theme. This way, we only have the theme andwp-source
defined in thefrontity.settings.js
, which is the absolute minimum.A more advanced user could always override them with e.g. a specific
beforeSSR()
action if they want. I think it would be less overwhelming to a first time user who doesn’t need to configurehtml2react
andtiny-router
right away. -
Similarly to the previous point, I think we should add the image and iframe processor by default and only require the user to specify a
libraries
property in theindex.js
of the theme if they want to add new libraries / extend existing ones. Like:const marsTheme = { // ...roots //...state //...actions // Make specifying this optional libraries: { html2react: { processors: [image, iframe], }, }, };
-
We should add more comments to the
frontity.settings.js
& theindex.js
generated by default by the CLI with some more information about the purpose of each setting, some examples:- explain why all the code is under
packages
. - explain what is
mars-theme
and that it’s like a “starter” theme in WordPress. - explain what is the purpose of the wp-source package in the
frontity.settings.js
- explain that the settings, state & actions in index file are merged with the ones in frontity.settings.js
- explain why all the code is under
This is not a complete list (because I’m not done with migrating ) so I ll add to it as I go along.