0.16 changelog
- No more dev command
- Deployment is now independent of the
tinloof-remixcommand - There are no more autogenerated files, which make for simpler understanding by devs
- Deployment is now independent of the
- Faster previews
- New block picker
- Use Sanity's new perspective feature to preview content and simplify queries
- Several UX improvements
Have ideas on how we could improve the upgrade process of our toolkit? We're eager to hear them, reach us out in Slack or via email.
⚠️
Before procceeding, make sure you’ve migrated to v0.15. See Single-route, free paths: Tinloof toolkit 0.15 changelog (opens in a new tab)
Migration step-by-step
🚨 - high risk, usually because the file is commonly modified or has high complexity, proceed with caution
🔄 - Updated file, you need to modify it
🆕 - New file, simply add it to your project
❓ - Optional
💡
We recommend keeping a clone of your main branch in a separate code editor to keep it as a reference to help with more involved changes
- 🔄🚨🚨 Copy
app/.autogenerated/blockComponents.tsintoapp/components/blocks/blockComponents.ts- Also modify references to it, such as in
/app/components/BlocksRenderer.tsxandapp/components/PtRenderer.tsx - You should also include the
// %CLI/comments to help the CLI inject code when generating new blocks, as per the template reference (opens in a new tab)
- Also modify references to it, such as in
- 🔄🚨🚨🚨 Add
BLOCKS_BODY_FRAGMENTtoblock.queries.ts- example diff (opens in a new tab)- Also modify references to
.autogenerated/, such as in/app/components/BlocksRenderer.tsxandapp/components/PtRenderer.tsx` - You should also include the
// %CLI/comments to help the CLI inject code when generating new blocks, as per the template reference (opens in a new tab)
- Also modify references to
- 🔄🚨🚨🚨 Modify
app/config.ts- example diff (opens in a new tab)- Create a new
TYPES_WITH_ROUTESarray, which is copied fromapp/.autogenerated/typesWithRoutes.ts - ❓🚨🚨 Move the
envconstant fromapp/config.tsintoapp/env.ts- example (opens in a new tab)- Will require updating several imports across the codebase
- Create a new
- Update dependencies - base diff (opens in a new tab)
- 🔄
remix.config.js- source (opens in a new tab) - Delete
app/entry.server.tsxandapp/entry.client.tsx, unless you're customizing it - 🔄
app/hooks/usePreview.tsx- source (opens in a new tab) - 🔄
app/hooks/useSanityData.tsx- source (opens in a new tab) - 🔄
app/queries/collection.queries.ts- source (opens in a new tab) - 🔄🚨🚨
app/queries/filter.queries.ts- diff (opens in a new tab); source (opens in a new tab)- With Sanity's new perspective feature, we don't need to use
PREVIEW_ID_FILTERor!(_id in path("drafts.**"))inNON_PRIVATE_FILTERanymore
- With Sanity's new perspective feature, we don't need to use
- 🔄🚨🚨
app/queries/helper.queries.ts- base diff (opens in a new tab); base source (opens in a new tab)- Instead of receiving an
isPreviewprop, query helpers now receive aPreviewStateenum - We're also getting rid of
getTranslationsFragmentin favor of a staticTRANSLATIONS_FRAGMENT, which you can find ingeneric.queries.ts(opens in a new tab)
- Instead of receiving an
- 🔄🚨🚨
app/queries/route.queries.ts- base diff (opens in a new tab); base source (opens in a new tab)- If using the static
TRANSLATIONS_FRAGMENTmentioned above, include that in route queries - Include
// %CLI/INJECT-QUERY%to the end of the document
- If using the static
- 🔄🚨🚨🚨
app/root.tsx- base diff (opens in a new tab); base source (opens in a new tab) - 🔄🚨
app/routes/$.tsx- base diff (opens in a new tab); base source (opens in a new tab) - 🔄
app/routes/[feed.xml].tsx- base diff (opens in a new tab); base source (opens in a new tab) - 🔄 If using Google Analytics, update
/app/components/GoogleAnalytics.tsx- diff (opens in a new tab) - 🆕 app/routes/preview.tsx (opens in a new tab)
- 🆕 app/components/PreviewRoute.tsx (opens in a new tab)
- 🆕 app/routing/previewNeedsRefresh.ts (opens in a new tab)
- 🔄 Update
app/components/PreviewLoader.tsx- source (opens in a new tab) - 🔄🚨🚨🚨 Update
app/routing/resolveRouteData.ts- base diff (opens in a new tab); base source (opens in a new tab)- Big change is returning
_sanityRequestsfromconfiguredQuery
- Big change is returning
- 🔄🚨 Update
app/routing/resolveRouteTemplate.ts- base diff (opens in a new tab); base source (opens in a new tab) - 🔄🚨🚨🚨 Update
app/routing/routeLoader.ts- base diff (opens in a new tab); base source (opens in a new tab)- Big change is handling
_sanityRequestsfromresolveRouteDataand parsing previews differently
- Big change is handling
- 🔄🚨 Update
app/routing/urls.ts- base diff (opens in a new tab); base source (opens in a new tab) - 🔄 Update
app/routing/handle404.ts- source (opens in a new tab) - 🔄 Update
app/routing/pickAbTest.ts- source (opens in a new tab) - 🔄 Update
app/utils/getPublicPaths.ts- source (opens in a new tab) - 🔄 Update
app/utils/sanityClient.ts- source (opens in a new tab) - 🔄 Update
app/sanity/deskStructure.ts- base diff (opens in a new tab)- Removes the docs desk item
- Delete
app/sanity/pagesStructure.ts - 🔄🚨🚨 Update
app/sanity/sanity.config.ts- base diff (opens in a new tab); base source (opens in a new tab) - 🔄 Update
app/components/SanityImage.tsx- diff (opens in a new tab) - 🔄🚨 Update
app/types/generic.types.ts- base diff (opens in a new tab); base source (opens in a new tab) - 🔄🚨🚨 Update
app/types/route.types.ts- base diff (opens in a new tab); base source (opens in a new tab) - 🔄 Update
app/sanity/schemas/abTest.ts- source (opens in a new tab) - 🔄🚨 Update
app/sanity/schemas/blockSchema.ts- source (opens in a new tab) - 🔄🚨🚨 Update
app/sanity/schemas/documentSchema.ts- source (opens in a new tab) - 🆕 app/sanity/schemas/documents/translationsMeta.ts (opens in a new tab)
- Also add this new schema to
app/sanity/schemas/documents/index.ts
- Also add this new schema to
- 🆕 app/sanity/schemas/fieldInSingleton.ts (opens in a new tab)
- Was previously
app/sanity/schemas/hideFieldInSingleton.ts; Update imports to it.
- Was previously
- 🔄 Update
app/sanity/schemas/objects/blocksBody.ts- source (opens in a new tab)- Should include the custom
BlockArrayFieldfrom@tinloof/sanity-toolkit
- Should include the custom
- Add blocks'
custom.variantsproperty and delete the rest- It can be adapted from the previous
custom.explainer
- It can be adapted from the previous
- Delete documents'
custom.hasRoutesproperty - Delete
public/studio-docsfolder - Remove
localizeDocumentTitlefrom document schema previews - Update schema descriptions to no include emojis. You can start from this diff downwards (opens in a new tab).
💡
There may be several minor type issues. You can run Typescript's checker with
tsc --dry and fix them as they come up.