egghead-next
egghead-next copied to clipboard
Refactor Software Lib naming to Topic
“The discussions that you have [with your teammates] about naming have benefits far beyond the work that you are currently doing. They help you and your team develop a common view of what the system is and what it can become.” –Working Effectively with Legacy Code
This refactoring is motivated by my efforts to sync all egghead-rails tags into Sanity. We are also in the midst of thinking about and rethinking the schema. This feels like a good chance to reuse existing schema objects as tagging becomes a primary concern of Sanity.
The shift from Software Libarary
to Topic
is to be more encompassing
of what can go in this bucket and to better align with the topic
context that we've started using in egghead-rails. Things like a11y
and JavaScript
aren't really software libraries. They are however
topics of the different kinds of content provided by egghead.
Then, instead of Versioned Software Libraries, it is TopicTaggings
.
This name does a couple things in addition to aligning it with the
updated naming of Topic
.
- It drops the "Versioned" qualifier since that isn't required and
doesn't make sense for a topic like
a11y
. - It suggests that it is a concept to be applied to (or tagged to) a piece of content.
Open to discussion on this, hence the RFC tag.
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.
egghead-io-nextjs – ./
🔍 Inspect: https://vercel.com/eggheadio/egghead-io-nextjs/G5guoGjMyp3ep4daCxCWeN3fpZR7
✅ Preview: https://egghead-io-nextjs-git-jb-prepare-sanity-schem-c9cc3b-eggheadio1.vercel.app
egghead-next-storybook – ./
🔍 Inspect: https://vercel.com/eggheadio/egghead-next-storybook/4eH1tx5Pvp8K9qTfXnBALwskcKtc
✅ Preview: https://egghead-next-storybook-git-jb-prepare-sanity-4204ec-eggheadio1.vercel.app
I'm realizing I'll need to re-think this approach. Sanity doesn't know that the object is being renamed. Instead it thinks one object is being removed and another is being added. It doesn't know how to associate the old data with the new object. Without writing some custom data migration code (https://www.sanity.io/docs/migrating-data).
Another approach would be to create parallel topic
and topicTagging
objects, get those synced with software-libraries
and versioned-software-libraries
, update references, and then remove {versioned-,}software-libraries
. That is going to be more involved than what I originally imagined for this PR.
tags are the tags themselves and taggings are tags associated with the thing tagged
I haven’t looked into this deeply but that’s the canonical difference.
To actually merge this would, iirc, require migrating a bunch of existing Sanity data to the new namings. Closing for now since it is stale and not a quick-merge. We can always revisit this if it seems valuable.