Strapi 4

It has been a long time since I didn't write an article. I have been working on a small project with Strapi 4 as a back-end and React with TypeScript as a front-end. Now, let's talk about Strapi 4.

This article may be about my review of Strapi 4. You can visit this article for more information on Strapi 4.

Migration from v3 to v4

I was in the middle of developing with Strapi 3. Then the major update, v4, came. I thought it would be smooth. I ended up with the new development v4 instead of migrating it.

Luckily, the project wasn't in production yet. So, the wise solution was a new development with Strapi 4 instead of getting stuck migrating from v3 to v4. No documentation can help me at that moment.

SQL instead of NoSQL

My database was MongoDB. But there was no support or compatibility for Strapi 4 at that moment. So, I picked MySQL for it. No more support for NoSQL databases such as MongoDB.

I agree with this decision. I think NoSQL is not a good choice as a primary database. But it would be better for Strapi 4 to provide the migration.

Plugins compatibility and development

Plugins for Strapi 3 can not work for Strapi 4. That means we need to rewrite them to make they can work with Strapi 4. Let's imagine if we have more than 10 plugins. It is sad. Maybe a wise solution is to stick with v3.

Luckily, I only have one plugin. It is to export contents to CSV. Thanks for this plugin, https://github.com/lazurey/strapi-plugin-content-export-import. The plugin was ready for Strapi 4.

But the installation wasn't smooth. It would be better if just yarn install or npm install. There is also no plugin marketplace. I need to Google the plugin, found it on GitHub, and followed the instruction to install it.

Another issue with plugins is hard to develop, even rewrite the existing one. I searched the documentation of the plugin development to create a plugin. I found it but it wasn't helpful. Maybe it was my mistake. I tried to rewrite the existing one, the previous plugin that I mentioned before, but I was stuck. I ended up creating the same feature on a front-end instead.

REST API vs GraphQL

I love to work with REST API rather than GraphQL. But there are some reasons for me to choose GraphQL over REST API. So, I picked them both.

I worked with React as a front-end. GraphQL forced me to use React Hook which is something I hate. Orders of fields weren't working on GraphQL too. But GraphQL was able to get nested stuff that REST API wasn't able to. Strapi should provide nesting level configuration on REST API.

Conclusion

The new-look of Strapi 4 is awesome. I felt a better experience than Strapi 3. They claimed that Strapi 4 "lets developers create plugins without pain". I didn't find it. Maybe It was my mistake because I was still not familiar with it.

Anyway, Strapi is still an excellent headless CMS that I love to work with.

Related Articles