Comments (9)
Hi @RobWattCT ,
- I am answering "no" to the TypeScript question and using it in that manner without any issues. Because TypeScript is not used in the project.
- You can use the " index.js " file instead of "schema.js" like this:
import works from './works'
import testimonials from './testimonials'
import brands from './brands'
export const schemaTypes = [works, testimonials, brands]
from project_professional_portfolio.
The fact is sanity v3 and v2 has various connection process however the v2 method works for v3. The only difference for me was to use npm run dev on the backend folder instead of sanity start. Other than that everything is still the same. Good luck.
from project_professional_portfolio.
export const schemaTypes = [works, testimonials, brands]
Just wondering if you have some steps to get this working in V3?
also where are you adding the above? in index.js? do we just delete the old schema.js? is it now unused?
from project_professional_portfolio.
export const schemaTypes = [works, testimonials, brands]
Just wondering if you have some steps to get this working in V3? also where are you adding the above? in index.js? do we just delete the old schema.js? is it now unused?
Specifically in the index.js files and export as stated, everything should work perfectly even with version 3 but the React Tooltip is deprecated in this version to "Tooltip ", and at the backend, Sanity start is now npm run dev
from project_professional_portfolio.
export const schemaTypes = [works, testimonials, brands]
Just wondering if you have some steps to get this working in V3? also where are you adding the above? in index.js? do we just delete the old schema.js? is it now unused?
Specifically in the index.js files and export as stated, everything should work perfectly even with version 3 but the React Tooltip is deprecated in this version to "Tooltip ", and at the backend, Sanity start is now npm run dev
Thanks, i decided to recreate the project from scratch fresh sanity install. Though I'm having the issue with the tooltip. Any chance you can post a code snippet from skills.jsx?
from project_professional_portfolio.
The steps in the video do not work with the latest version of Sanity, version 3.
i.e. It's no longer possible to follow the exact steps of the video's Sanity setup and result in getting the Sanity Server up and running with the schema displaying.
There's a new prompt to setup the project for TypeScript (yes/no ?). Need clarity on that.
The project uses a schema.js file inside /schemas/, but installing the latest Sanity generates index.js file, with different code to schema.js (excluding what gets added to pull in the project's other schemas files).
It would be great if this could be addressed or if I could get some help on a workaround as I would love to build this tutorial without roadblocks.
@adrianhajdin and team, I love your work! Thank you for investing into the community.
You can do this schema at ./schemas/index.js
for V3
export const schemaTypes = [
{
name: 'works',
title: 'Works',
type: 'document',
fields: [
{
name: 'title',
title: 'Title',
type: 'string',
},
{
name: 'description',
title: 'Description',
type: 'string',
},
{
name: 'projectLink',
title: 'Project Link',
type: 'string',
},
{
name: 'codeLink',
title: 'Code Link',
type: 'string',
},
{
name: 'imgUrl',
title: 'ImageUrl',
type: 'image',
options: {
hotspot: true,
},
},
{
name: 'tags',
title: 'Tags',
type: 'array',
of: [
{
name: 'tag',
title: 'Tag',
type: 'string'
}
]
},
],
},
{
name: 'testimonials',
title: 'Testimonials',
type: 'document',
fields: [
{
name: 'name',
title: 'Name',
type: 'string'
},
{
name: 'company',
title: 'Company',
type: 'string'
},
{
name: 'imgurl',
title: 'ImgUrl',
type: 'image',
options: {
hotspot: true,
},
},
{
name: 'feedback',
title: 'Feedback',
type: 'string'
}
]
},
{
name: 'brands',
title: 'Brands',
type: 'document',
fields: [
{
name: 'imgUrl',
title: 'ImgUrl',
type: 'image',
options: {
hotspot: true,
},
},
{
name: 'name',
title: 'Name',
type: 'string'
}
]
},
{
name: 'abouts',
title: 'Abouts',
type: 'document',
fields: [
{
name: 'title',
title: 'Title',
type: 'string'
},
{
name: 'description',
title: 'Description',
type: 'string'
},
{
name: 'imgUrl',
title: 'ImgUrl',
type: 'image',
options: {
hotspot: true,
},
},
]
},
{
name: 'skills',
title: 'Skills',
type: 'document',
fields: [
{
name: 'name',
title: 'Name',
type: 'string'
},
{
name: 'bgColor',
title: 'BgColor',
type: 'string'
},
{
name: 'icon',
title: 'Icon',
type: 'image',
options: {
hotspot: true,
},
},
]
},
{
name: 'workExperience',
title: 'Work Experience',
type: 'document',
fields: [
{
name: 'name',
title: 'name',
type: 'string'
},
{
name: 'company',
title: 'Company',
type: 'string'
},
{
name: 'desc',
title: 'Desc',
type: 'string'
}
]
},
{
name: 'experiences',
title: 'Experiences',
type: 'document',
fields: [
{
name: 'year',
title: 'Year',
type: 'string'
},
{
name: 'works',
title: 'Works',
type: 'array',
of: [{ type: 'workExperience' }]
},
]
},
{
name: 'contact',
title: 'Contact',
type: 'document',
fields: [
{
name: 'name',
title: 'Name',
type: 'string'
},
{
name: 'email',
title: 'Email',
type: 'string'
},
{
name: 'message',
title: 'Message',
type: 'text'
}
]
}
]
from project_professional_portfolio.
The prompt to use typescript is not showing anymore and it automatically installs all the files of typescript. Anyone know how to change this???]
from project_professional_portfolio.
For the people having trouble with the different versions of Sanity What you have to do is to import your file name into the script.js file inside the schemas folder:
import tesstimonials from "./testimonials"
export const schemaTypes = [testimonials]
You create the "testimonials" file as instructed in the video and skip creating a chema.js file
from project_professional_portfolio.
Sanity V3 -vs- V2
For what its worth, here is my input that fixed the issue when using Sanity V3 -vs- Sanity V2
CONSIDER the MIGRATION documentation for Sanity below:
SanityMigrationV2ToV3
Migration Cheat Sheet
INSTALLATION
- Use:
npm install openai@latest
NOTE: use SUDO if not a root user and/or have issues installing from the command.
This WILL INSTALL
the latest version as V2 of Sanity is deprecated. If you want to BOOSTfreemium from JavascriptMastery2022, you can follow the tutorial but say 'Y' to install version 3.
What was seen in the tutorial were these commands:
npm install -g @sanity/cli
Select: -Y to install version 3
Then
sanity init --coupon javascriptmastery2022
- Do not select TypeScript if you just want to use javascript and follow the tutorial
- Everything else is pretty musch self explanatory.
To Initialize: AVOID
sanity start
USE INSTEAD
@/backend_sanity directory
npm run dev
schema.js -vs- index.js
index.js
is used as an entry point in V3 instead of schema.js
that was used in V2
- In the index.js, add the following:
index.js
import works from './works'
import testimonials from "./testimonials"
import brands from './brands'
import abouts from './abouts'
import experiences from './experiences'
import skills from './skills'
import workExperience from './workExperience'
import contact from './contact'
export const schemaTypes = [testimonials, works, brands, abouts, experiences, skills, workExperience, contact]
NOTE:8 This is after you copy the assets in the schemas directory. The above syntax is demonstrating how to invoke the content added in this directory. V2 is much different:
RESULTS
from project_professional_portfolio.
Related Issues (20)
- node-sass error HOT 1
- Images in About Section doesn't show after connecting to Sanity. HOT 8
- Module not found HOT 4
- The Portfolio projects are not being removed HOT 1
- Can you help me with Navigation dots HOT 2
- line 105 work.jsx {work.tags[0]} GIVES ME WHITE SCREEN OF DEATH HOT 2
- Contact form not working HOT 5
- Navbar animation flickering HOT 2
- React Tooltip always render his content, is not on a hover HOT 1
- .
- Please add a dependencies installation procedure on ReadMe
- Email validation? (allow emails from .tech .io etc?) HOT 1
- testimonials map issue HOT 6
- Navbar HOT 4
- Github and Eye SVG does not show in mobile/tablet devices HOT 1
- Can't Get React Frontend to work In New WSL Install HOT 1
- SanityClient issue HOT 1
- Page goes Blank After adding AppWrap
- The About Section is not updating via sanity. How to fix this? Help me to fix this issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from project_professional_portfolio.