Syntax Video
Monorepos - What, Why, When and How | Full Stack React + Hono Example
- 0:00 intro
- 0:27 what is a monorepo?
- 1:33 why do we need monorepos?
- 4:04 when should we NOT use monorepos?
- 5:23 real world monorepo examples
- 8:12 tools to create workspaces / monorepos
- 9:16 example app overview
- 9:52 workspace setup
- 10:51 namespaces
- 12:45 Tip: Share Configuration
- 12:57 shared typescript settings
- 13:50 sharing eslint config
- 15:39 Tip: Typescript Path Aliases
- 16:53 Tip: Use the pnpm Task Runner
- 18:15 Tip: Proxy API Request
- 20:07 Tip: Client Build / Static Serve / SPA Redirect
- 22:29 Tip: Sharing Hono Types
- 24:45 Tip: Hono RPC Client Build
- 26:15 Tip: Restructure and Restrict Exports
- 28:08 other monorepo tools
- 29:04 monorepo alternatives
- 32:02 thanks!
intro
in this video we're going to talk about Mono repos we're going to talk about why they exist what they are when and why you might use them and then I'm going to take you through some tips and tricks for working inside of monor repos by showing you a real world full stack react application that I put together that has a v in react front end and a hono API backend that all live inside of the same monoo if that sounds good to you let's dive in my name is CJ welcome to syntax [Music]
what is a monorepo?
so let's break it down mono means one and repo is short for repository so it is one repository essentially you have one repo where all of your apps all of your packages all of the things that potentially make up the product that you're working on you might have an API you might have a react frontend you might have a nextjs landing page or marketing page you might have a package that's sharable UI components you might have another package that's sharable types so it's essentially a way of structuring all of your apps and codes into a single repository now a lot of times when people hear monor repo they think of a monolith and that is not what a monor repo is a monolithic application is one big application think of something built with Ruby on Rails where it has all the front end code all the backend code all the database everything lives in the same app that's a monolithic application that's different than a monor repo which could have multiple apps and multiple packages now that's not to say that you couldn't have a monolith inside of a monoo but they are two distinctly different
[Music] things now why on Earth would you want to do this it mainly comes down to code sharing and code D duplication right let's say you're working for a company that potentially has two different react apps maybe you have an admin dashboard and then maybe you have like a client facing tool both of those apps potentially are styled in the same way and potentially want to use the same components so a monor repo would allow you to have both of those apps living next to each other in your apps full and then you can have a package called UI components that defines all of your reusable components it could use storyboard it could have tests all of that could live there but then both of your applications could easily import from it and share those reusable components now another reason we might use monor repos is to share types and so for instance you could have your API also inside of this folder and then you could potentially have another folder inside the packages folder called types and then you could Define all of the reusable things there like tasks or users all of the things that you
why do we need monorepos?
potentially need to use in both your front end and in your backend and with a mono repo setup now all of that code can live in one place and then easily imported into all of the places that need it and now you have a single source of truth instead of needing to copy paste these types or Define them in multiple places now another type of shared code you might have are utilities or formatters right so let's say the front end and the back end both need to format strings or dates in the same way you could Define that code in a package inside this monor repo and then use that package as a dependency in both your front end and your back end it might also have utilities for like converting values or doing things that aren't specific to the front end or backend essentially like business logic that you might need in both the front end and the back end and you can Define that inside of a shared package inside a monor repo now another reason you might use a monor repo is potentially the structure of your team right so if you have a cross functional team where people are sometimes working on the back end sometimes working on the front end a monoo helps with that because it's all within a single code base so it allows for more easier collaboration and
instead of needing to hop between various repos depending on what you're working on now another reason you might use a monor repo is if you work at a company where you need to keep everything internal because a lot of the benefits I've talked about so far are code sharing and you might have just thought well can't I just publish all of my packages to mpm and then add them as dependencies that way yes but that's really only if your code is public if you work at a company where you have proprietary code or things that you don't want to share with the world a monor repo makes it much easier to share those dependencies without needing some sort of private hosted package repository or different things like [Music] that now some of the reasons you might not use a mono repo is if you potentially need to control who has access to what code right because once you're working inside of a monor repo everything that lives in there is a single repo so you must give anyone that wants to work on it access to that whole repo so if you work at a place that likes to keep things a bit more secure and siloed based on a person's role or
when should we NOT use monorepos?
where they are in the company then a monor repo probably isn't the way to go you probably want to have some sort of internal private package repository host so that if people need access to things as dependencies they could be easily installed but if they need access to the direct source code then that can be handled via giving them direct access to a specific repo versus giving them access to an entire mono repo and then another downside of monor repos is that it requires more storage right so everything lives in this exact same code base so any developer that needs to clone it down has to clone down all those apps and all those packages so at a certain point this actually could get very large especially if there's a lot of G history and then one last downside potentially is figuring out how to deploy a mono repo a lot of deployment Services don't play very nice if your apps don't live in the root directory and so you're going to have to figure out some build processes to make sure that all of these apps living in this monor repo can be deployed to wherever you need to deploy them [Music] to now let's look at some real world examples of monos and if you haven't
real world monorepo examples
heard of this before this is probably going to make things a little bit more clear when you come across various GitHub repos like this so first let's look at react this is react by Facebook here on GitHub but you will notice at the root is this folder called packages and if we go inside of there there is a folder called react and there it is this is the actual react core Library this folder right here all of these other folders are subpackages and for instance we also have react Dom and we also have react client and we also have uh react server and it makes sense for react to be structured this way because a lot of times you may need to reach for one of these but not the other and so they're all defined here in the case of react which is actually published publicly to mpm each one of these folders is actually published as a separate mpm package but whenever you're running this code yourself locally like if you were to clone down the actual react repo they have internal dependencies right react Dom is very likely dependent on react and has it listed as a dependency but
instead of needing to pull it from MPN it can actually reference it directly using whatever monor repo tool they use to reference these without needing to install them all the way from mpm if you take a look at vel's nextjs what do you know they have a packages directory and if you look inside of there there's create next app there's next font there's next all of these sub packages live here but internally they might need to reference each other so they can do that within this monor repo you can take a look at buns so it has this packages directory and inside of there you have all the various bun subpackages uh we could take look at TL draw which is an open source canvas drawing tool and what do you know they have a packages folder with various internal packages they also have an apps directory that contains multiple different apps so all of the other projects I've shown you so far are more like developer tooling or dependencies that you might install so they don't really have applications but in the case of TLD draw they have applications because they're deployed to the web so this com folder is very likely the app that's hosted at TLD
draw. deev and then Docs is the app that's hosted on their docs URL whatever that is but inside of packages they have all of the reusable stuff that isn't necessarily an app itself now all of these examples I showed you are public open source repos but one of the most popular examples of a company doing this internally is Google they actually have a single monolithic repository that stores all of Google's code everything google.com Gmail everything that exists at Google even like the angular Library it's stored inside of their monolithic repo and this article talks about why they do that some of the tools they developed internally to do it but just so you know this is a technique that's used at a lot of places including some of the biggest tech companies in the [Music] world now there are a few different ways to go about creating monor repos for instance npm has a workspaces feature and you can actually add this to your package.json which defines where your workspaces live and a workspace is any
tools to create workspaces / monorepos
given package or app inside of a monor repo so in this example they have a package called a that lives in the packages a directory and so this setup would allow them to have that sub package yarn also has a workspaces feature so this also gets toin inside of your package.json uh dino has a workspaces feature which you can put in your d. Json or your package.json bun also has a workspaces feature which lives in your package.json and pnpm also has a workspaces feature now pnpm is what I'm going to be using cuz it's my preferred tool for working with dependencies and they also have a lot of nice built-in things that you don't necessarily get with some of these other workspace tools but they specifically Define their workspaces inside of a workspace do yaml file so it's not inside of your package.json but this whole idea of packages apps workspaces it's very similar regardless of what tool you decide to [Music] use now for a quick demo of the app this is just a tasks management application so we have a react front end here where
example app overview
we can create some tasks that hits our hono API and then we receive the data back over here and we're using tan stack router so we do have multiple Pages we have the task view page we also have the task edit page where you can delete tasks and the main goal of this is to really just demonstrate having multiple client side routes because in a more complex application it would be similar you just might have more Fields than just the name field for a task but it would work in potentially a similar [Music] way now first up inside of our repo you can see we have this pnpm DW workpace Doo file and this is how we tell pnpm where our workspaces are in this case we have two different folders We have the apps folder and this folder contains applications so like apis or V frontends or react front ends or spel front ends or whatever else all of that's going to live in the apps directory and then we also have the packages directory and this is going to be any reusable code that isn't itself directly in applications so we could have reusable types reusable utility functions
workspace setup
reusable components those different types of things and they're going to live in the packaging directory so to set this up make sure you have a workspace file and then from there each of those folders can now start to have those applications and what you'll notice is every single one of these folders within apps and within packages has its own complete setup so each one of these has its own package.json and configuration and each one of these apps also has its own package.json and configuration and everything [Music] else now one of the aspects of working with pnpm workspace in a monor repo is these packages and these apps can reference each other without needing to be published to npm or GitHub or anything like that so for instance I have this shared eslint config which I'll dive deeper into in a second but this package is defined here and its name is at tasks app lint config now any other package or app that I have in this monor repo can reference that package via the workspace so for instance this API client if we look at its
namespaces
package.json it has a dependency on task appes lint config and you can see the version here is specified as workspace this lets pnpm know that whenever we're installing dependencies this should be found in the workspace by looking at the workspace config to see what those workspaces are and it should be installed from there it shouldn't try to reach out to npm and and install it from there so in this case our packages can reference each other so so in the case of this API client package it has a dependency on the API because it needs its types to create that client and so if we look at the API package.json it has a dependency on task app eslint config and you'll notice that all of my packages are namespaced as/ tasks app and you basically want to do this so you don't run into any conflicts right if I just called this package API we could run into conflix of like real packages from npm being called that so you want to make sure that you namespace this to whatever your application or whatever your company is and so every single one of my apps and packages in here all uses that exact same namespace and this is also convenient because whenever I'm looking at Imports in my code if I see
that it's coming from my specific namespace I know that this code is coming from my workspace it's not coming from PM or anything like that and so this is one of the major benefits of pmpm workspaces is you can have this structure where each one of these packages or apps has its own configs and in own way of doing things but they can all reference each other to like reduce duplication and also share code and
Tip: Share Configuration
configuration now my first tip for working in mono repos is to share as much of the configs as possible now this is very timec consuming and cumbersome to set up but it's definitely worth it so in this app here I have a TS config at the root that has all of my default settings and then every other app or project then extends from this TS config so if we look at the TS config in my API client package it extends that config and then adds all of its own specific settings if we take a look at apps and then API it has its own TS config but it extends from that same base TS config and then adds all of its Project Specific settings and then we have the exact same thing inside of our vit app which is slightly more complicated because it has a couple of TS configs but both the app config extends and then adds any options that it needs to and then also the node config extends and then adds any options but you'll notice for all of those configs across my projects and packages none of them have to specify these settings because they're all specified in the base configs so this gives me a nice
shared typescript settings
consistent typescript experience across all of my code because they have the same base settings another piece of config that we're sharing is our es lint config and for this I've actually defined a package inside of my monor repo so here in packages I have es lint config and this defines my base config and then every other app or package I have can extend that config but if they don't need to make any changes to the settings they can just use this default config now my base config is using ant Fu's eslint config which is my preferred way of setting up eslint these days because it has a bunch of built-in plugins and a bunch of good default settings but from there I can customize it to have all of my preferred stylistic settings and add all of my preferred overrides for rules but now these settings are the same across all of my projects and for this package I actually have two different exports so if one of the packages or apps in my mono repo just needs to use the config and doesn't want to make any modifications it can reference that config file directly but if they do want to make customizations like enable or disable rules or add different plugins that are Project Specific they can pull
sharing eslint config
in this create config and then pass in their own custom settings that get overridden here so for example if we take a look at our API client package it just pulls in that config directly doesn't make any modifications it's using all of the default if we take a look at apps and then API this one is making a few modifications because I need to add some new ignore rules and then also this is a backend that's using drizzle so I'm using the drizzle es lint plugin but because I'm using that create config function I made it has all of the base settings and then these are all of the overrides and then same thing for our vit react app so it essentially needs to enable all of the react es Lent rules for accessibility and hooks and everything else and then I can also add plugins that are react specific and then also turn off or modify some of these other rules specifically for this react app but now no matter where I'm working whether it's the back end or the front end or in a package they all have these exact same rules so I can ensure a consistent Dev [Music] experience now my next tip deals with
Tip: Typescript Path Aliases
setting up path aliases now I have multiple apps here and in each one I want to be able to have some aliases so if you look at the TS config in our API it has a path Alias of at/ API and this is my tip essentially if you're going to set up path alias is every single app should have some unique prefix because in some build scenarios where packages are dependent on each other you potentially will need to set up these paths for the dependent packages and it can get confusing or conflict if all of your path aliases are just at slash so for my API its Alias is at/ API and then for my react app its Alias is set up at SL web and so this way if these packages are dependent on each other we can actually set up path aliases that correspond to the correct package so for for instance our API client is dependent on the API and if we look at its TS config we actually set up the paths here so that whenever it sees at/ API it knows where to find that code and if it was just at slash this potentially could
conflict if it had a dependency on web as well so that's my tip is set up your aliases to be specific to each project so you can differentiate them and you don't run into any [Music] conflicts my next tip is to use the built-in task Runner of pmpm so I have two apps here I have my hono app and my react vit app and both of them have a Dev script but I need to typically start them up at the same time so in my root package.json I have a Dev script that does pnpm run- r so this stands for recursive and it essentially looks at all of our packages and subm modules and if they have a Dev script it runs them all in this case I'm also passing dash dash parallel because I want them all to run at the same time without that it'll essentially wait for each one to finish before it calls the next and then I'm also passing in aggregate output so we see one single feed that has output from all of the tasks that are running and so now if I run pmpm run Dev from the route it's going to find that task and then spin up my react feed app and also spin
Tip: Use the pnpm Task Runner
up my hono app and so this is really great and it works crossplatform so as long as everyone on your team or everyone working within your monor repo is using pnpm then they'll be able to run these tasks on top of that you can see I have all of my other tasks set up and specifically if you look at the build script it does not run in parallel because there are various dependencies right and sometimes one package needs to be built before the other and pmpm is able to figure that out based on dependencies and so we don't run this in parallel so that our builds run in the correct order but for tests or linting we can run those tasks across all of our projects all in one [Music] go my next tip is to use vits proxy server if you have for instance a separate API and a separate front end so now that I've spun up both of my apps the API is running on Port 8787 cuz it's using Wrangler which is a cloud flare tool and then our front end is running on Port 5173 because it's V and so if we look in the browser our API is here and then our V app is here now if I want
Tip: Proxy API Request
these two apps to talk to each other we could run into a chors issue because our back end is on the origin Local Host 8787 and our front end is on the origin Local Host 5173 but whenever we deploy this application it's all going to live on the same domain so when you visit the index the react and V app will load but anything that is/ API the hono app will respond so check this out if I attempt to create a new task here which is going to hit the hono API we see the requests go out but you'll notice it's to 5173 so with this setting our react app is just making requests against itself essentially but the V Dev server will see that and then proxy those requests through to the hono API so inside of our vit config there is a section down here called server and this is where you can specify your proxy settings and my settings here say that if any request goes out to / API that should be proxied to Local Host 8787 so in the browser we can see that request went to 5173 API slask and so the V Dev server saw that
request and then in turn proxied it to 8787 API tasks now this is great because when I'm writing my react code to make these requests I can just make fetch requests against SL API I don't have to specify the full URL because whenever I'm deployed that's how it will behave anything that/ API will load the hono app anything at the root load the react app and so this is definitely the way to set things up if your API and client are going to be hosted on the same server whenever you [Music] deploy my next tip deals with deployment and how to deal with the client build of your react app where to put it and how to serve it up from your API so whenever we deploy we're going to build our react front end and that's just going to get turned into static assets because it's just a v app but we want those static assets to be built into the same folder that we're going to deploy our API from so if we take a look back at our V settings I actually have this build setting right here that says the out dur is in the API folder and then in the
Tip: Client Build / Static Serve / SPA Redirect
public folder so go up a directory into the API package and then build it into public so when I run a build it's actually going to Output those files here in this public folder now as you can see from my editor these are get ignored because I don't want to commit those built assets to my repo but now that this public folder lives inside of here I can configure my API to serve that public folder and all of the static assets inside of it now this configuration is going to depend on where you're deploying to and what kind of app you're using I'm specifically deploying this API to cloudflare workers and then using their static assets feature so in my Wrangler config I have an assets setting that says the directory is public and so essentially when I deploy this folder everything in that public folder is going to be served up as a static asset now the other piece of configuration you're going to need is for working with a single page application right because our react app here is all static files in this case I'm using tan stack router but you might be us using react router but essentially we have client side routes and if someone were to visit those routes directly we want to make sure that the static assets are served up so specifically for my hono API I have a
middleware that looks at the incoming request and if it does not begin with SL API then it serves it up from our static assets but if it does begin with/ API then that means hono needs to handle it now this is specific to cloudflare and static assets if you're deploying with hono and node they actually have a static asset middleware that you can just add directly but for my specific type of deployment this is the middleware that I need that basically says if a request is not to/ API then we need to serve our root index.html and then react will load and and tanack router will kick in and load the correct page and like I said this configuration is going to vary wildly depending on where you're deploying to and what you're using for your backend but you essentially just want to search for the spa rewrite configuration or Spa redirect settings and whatever provider or whatever framework you're using will likely have some documentation on that [Music] now my next tip is how we can share validators between both our backend API
Tip: Sharing Hono Types
and our front-end because we want to run validation before we put something into the database but we also want to run validation on the front end before we send it to the backend and in this case I am using drizzle for my database but drizzle provides the drizzle Zod package so I can take my database schema and then instantly get Zod validators that correspond to the different types of things we're going to do for this table like selecting from the table or inserting into the table or updating rows in the table so all of these validators are directly based on my table schema here now you don't have to be using drizzle for this to work you could just Define your Zod validators separately but it is nice that drizzle has this built in and it allows us to change the schemas depending on what we're doing because for instance whenever we're inserting into the database there are certain fields that I don't necessarily want to include in the validation like because the ID is autogen at and the dates are autogenerated I don't want my schema to be validating for those so we can use the built-in omit function from Zod to say that this schema will not allow
those properties to be passed in and then beyond that we can add more validations so in this case I set a minimum length of one on the name column and a max length of 500 and depending on the type of database you're using you could also add constraints on the columns themselves but it's nice that you can further refine these schemas here and and say for instance you also had like URLs in your database you can use all of the things built into Zod validators so we could could specifically validate this string as a URL or validate this string as an email so this is great and I can use these validators in both my API and in my client so if we take a look at the API code which does the inserting into the database we can see when I Define my routes I pass in these validators so so right here for our create method you can see that the body is going to be validated using that insert task schema and if we take a look at our front end code specifically the form that allows us to create new tasks like this you can see that it's using that exact same validator like we can go to definition it's that exact same validator that's defined in our backend
code there but we can combine it with in this case with react hook form to use that exact same validator so it's validated on the client side before we send it to our [Music] backend now here specifically with hono they have this built-in RPC client where essentially you can take the type of your API and then use that type directly in the hono client to get a fully typed client that knows about all of your endpoints now this works fine as is but you could run into some performance issues inside of your editor because essentially every time you're using this variable here the typescript language server has to infer and figure out all of the types of your hono app but if you take a look at their docs under known issues they actually show you how you can essentially compile the types for the client ahead of time to get a much better editor experience so here inside of the app I have a packages directory and then I have this API client which has this specific code here and whenever we run a typescript build it's going to generate those types and so that code
Tip: Hono RPC Client Build
lives inside of here along with a few other types that I want to share but my main tip for you is here in our package.json I actually have a Dev script which runs the typescript compiler in watch mode and this means that the build process for this package is going to spin up at the same time as our hono API and our react web app and anytime there are changes inside of our hono API this build is going to automatically rerun recreate our types here and as you can see all of the hono endpoints are actually directly inside of this file so whenever our client side code is attempting to call any of these typed endpoints the typescript server doesn't have to figure that stuff out dynamically it's just using this statically built file that instantly gets updated anytime there are changes in our [Music] backet now because this package is dependent on the API there are a lot of types and things that the API does that we would potentially need dependen for as well inside of this sub package but this package is being used inside of our
Tip: Restructure and Restrict Exports
react app and I don't want it to be dependent on all of those other like backend specific things so if you take a look at our API and look at its package.json you can see that I have specific exports here and so any package that's dependent on the API only gets access to these two things you can either get access to the routes which is where we get that hono app type from or the schema which is where we get access to our Zod validators but that means we're not exposing all of the code from the API to the client we're only exposing these specific pieces and this allows us to be much more careful to not import like server specific packages or import environment variables or or different things like that essentially when we're working in these files we know that they're going to be accessed in both the client and the server and specifically if you're working with hono you can see how I set this up here I actually have a separate file here in my routes folder that exports a hono router that only has specifically the endpoints that I care about on it so this doesn't have all the extra middle Wares and everything else that that are specific to the back end it just has the endpoints that the front end needs to be able to call so the sole purpose of this
file is to export that router and then that router type is actually what is used inside of our hono client here but I have this reusable register routes function where I can pass just like a base hono app to it but I can also pass my full hono app which has all the middle Wares and everything else that it needs so all of our routes are registered in this one spot which means I can use them for the types but then I can also use them for the actual hono app now this is a little bit more work but I have found it's the best way to make sure that our API client here only has the dependencies that it needs and doesn't need all the extra stuff that the backend needs as [Music] well now when using pnpm workspaces it's up to you how you set up all of the various workspaces and for the app that I showed you today I set all of that up manually right I set up the es lint sharing and the TS config sharing manually and everything else there are other tools out there you can use in conjunction with pm chion workspaces to get more things kind of built in and generated for you so INX is one of those
other monorepo tools
I've used this for a few different projects and they actually have a CLI tool with a bunch of different generators built in and they set things up in a way where your TS configs and your es lent configs can be shared automatically and like I said they have generators of all types there's also turbo repo which I haven't used myself but it has similar tooling and then there's also lunna which I I do have experience with it I used it a long time ago before some of these other tools existed and now lerna is actually maintained by the same people that maintain in X but it has some features of its own as well so it's definitely worth checking [Music] out now I want to walk you through some alternatives to Mono repos as we talked about before monor repos aren't a silver bullet they're not going to solve all of your problems and sometimes you can run into configuration issues slow builds potentially privacy issues if multiple people have access to that repo so let's go over a few Alternatives and the first is git subm modules git subm modules allows you to have multiple separate git
monorepo alternatives
repos that are all referenced within the same git repo so they all still exist as separate git repos but there's a git subm module command you can run that actually pulls in that remote code and so this is fine I think one of the main issues you might run into with Git subm modules is if you need to reference other files via relative paths because like in the example I showed of configuration sharing we're essentially just importing files from parent director so you might run into some issues there where those git repos won't really ever work unless they're cloned inside of the parent repo that has them as subm modules but it is an option another option is to publish private modules and there's a lot of different ways to go about that so essentially instead of having everything in the same repo you could have them in separate repos do exactly what you're doing now but then if you want to share code you publish them to some registry and then install them as dependencies in the various projects that need to share those dependencies and so mpm actually has a paid tier where you can publish private packages and essentially only the team members that you allow can
install those packages so that's one way essentially you use mpm to publish it's not public only the people you allow will be able to install it but from there you can install those dependencies across your various repos now a free self-hosted solution to private packages is Verdo so you can install this on a server and then point all of your npm installs to this server and you can also publish packages there and what's nice about verdao is it actually serves as a proxy so if you try to install something from verdao but it actually lives on npm bashio will cash and proxy that install to pull it in from npm but you can publish modules here and for instance if you had this only existing on an intranet not exposed to the outside world only computers on your network would be able to install packages that were published there there also some paid hosted options so you can also take a look at GitHub packages they will essentially allow you to publish private packages inside of private repos and so you can publish them there and then reference them from other projects that's one solution and then there are some more Enterprise hosted Solutions so one one that I've used when I was Consulting before is this thing called
jrog artifactory this is not an ad for them check them out see if this is something you would actually want to use because it is a paid product but essentially it lives on your internet and it hosts all your packages but it can also host Docker containers and other things like that and then there's also AWS code artifact so if you're already in the AWS ecosystem you can spin this up and publish your private packages there there are likely other Solutions as well if you know let us know down in the comments but like I said monor repos aren't always the solution you want to reach for so if they're not there are other ways of sharing code and here are just a few [Music] options that's it for this video if you have any comments questions concerns let me know all of the code that I showed you today is going to be linked in the description so you can go check it out poke around steal some of the stuff and add it into your own mono repos YouTube thinks you're going to like this video so check it out and subscribe if you haven't yet all right I'll see you in the next one [Music]
thanks!
Quote it with credit and a link. Quoting Syntax