Skip to content

Commit 4dff93b

Browse files
update Open Source Docs from Roblox internal teams
1 parent ca8d4f1 commit 4dff93b

File tree

6 files changed

+133
-16
lines changed

6 files changed

+133
-16
lines changed

content/common/navigation/engine/guides.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ navigation:
5454
path: /projects/collaboration
5555
- title: Activity history
5656
path: /projects/activity-history
57-
- title: External tools
58-
path: /projects/external-tools
57+
- title: File-based workflows
58+
path: /scripting/sync
59+
section:
60+
- title: Script Sync
61+
path: /scripting/sync
62+
- title: Third-party tools
63+
path: /projects/external-tools
5964
- title: 3D workspace
6065
path: /workspace/
6166
section:
Lines changed: 3 additions & 0 deletions
Loading

content/en-us/projects/external-tools.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
---
22
title: Third-party tools
3-
description: These popular tools can enhance developer productivity.
3+
description: These popular tools for managing Roblox projects as a set of local files can enhance developer productivity.
44
---
55

6-
For professional development studios, setting up third-party tools and investing in automation can dramatically improve developer productivity. Roblox's cloud-first approach has many advantages, but moving certain portions of the development workflow _outside_ of the cloud can help larger teams track changes over time, review code, and use the languages and tools with which they're already familiar.
6+
For professional development studios, setting up third-party tools and investing in automation can dramatically improve developer productivity. Roblox's cloud-first approach has many advantages, but moving certain portions of the development workflow **outside** of the cloud can help larger teams track changes over time, review code, and use the languages and tools with which they're already familiar.
7+
8+
- If you just want to use an external text editor or keep code in version control, [Script Sync](../scripting/sync.md) is a great choice.
9+
- If you want to manage your entire project as a set of local files, this page covers some tools and strategies.
710

811
<Alert severity="info">
912
Although this page covers several popular tools, it shouldn't be taken as a strict recommendation of them. Every team has different needs, so this page is intended to help you examine ways to improve your workflow rather than tell you to download anything in particular.
1013

11-
Tools mentioned on this page are not maintained by Roblox and may change or stop working at any time.
14+
The tools on this page are not maintained by Roblox and can change or stop working at any time.
1215
</Alert>
1316

1417
## The syncing problem
1518

1619
At its core, using external tools with Roblox is a _syncing_ problem:
1720

18-
- You want your Roblox scripts to exist as `.luau` files on disk so that you can use your own tools to work on them.
21+
- You want your Roblox instances to exist as files on disk so that you can use your own tools to work on them.
1922
- You have to get your files back into your Roblox project after you've finished working on them.
2023
- If someone else changed those same files in the meantime, you have to handle any conflicts.
2124

22-
For the whole solution to feel seamless and automatic, you need to a) listen for changes to files and b) incorporate these changes back into Studio. In other words, you need a server and a Studio plugin, which is how [Rojo](https://rojo.space/) solves this problem.
25+
For the whole solution to feel seamless and automatic, you need to a) listen for changes to files and b) incorporate these changes back into Studio.
2326

24-
Rather than Roblox's cloud-first approach, Rojo allows for a "file system-first" approach. It extracts all script files in your project into Luau files. Then it runs a server. The Rojo plugin connects to the server to synchronize those files with Studio.
27+
Rather than Roblox's cloud-first approach, Rojo allows for a "file system-first" approach. It extracts instances in your project into external files. Then it runs a server. The Rojo plugin connects to the server to synchronize those files with Studio.
2528

2629
## Install Rojo with Foreman
2730

@@ -144,7 +147,7 @@ For a detailed walkthrough of using React to create a Roblox UI, see [React + Ro
144147

145148
## Version control
146149

147-
Having a set of plain text files on your computer unlocks a variety of capabilities, but the primary one is _version control_. You can store your scripts and configuration files in a [Git](https://git-scm.com/) or [Mercurial](https://www.mercurial-scm.org/) repository; host remote repositories and review code changes in [GitHub](https://github.com), [GitLab](https://gitlab.com), or [Bitbucket](https://bitbucket.org); and use whichever text editor you like.
150+
Having a set of plain text files on your computer unlocks a variety of capabilities, but the primary one is _version control_. You can store your files in a [Git](https://git-scm.com/) or [Mercurial](https://www.mercurial-scm.org/) repository; host remote repositories and review code changes in [GitHub](https://github.com), [GitLab](https://gitlab.com), or [Bitbucket](https://bitbucket.org); and use whichever text editor you like.
148151

149152
[Visual Studio Code](https://code.visualstudio.com) has the largest extension ecosystem, but [Sublime Text](https://www.sublimetext.com), [Notepad++](https://notepad-plus-plus.org), and [Vim](https://www.vim.org) are all popular choices. Whichever editor you choose, matching the capabilities of the Studio script editor will require some extensions.
150153

@@ -155,12 +158,6 @@ You might also consider adding:
155158
- A language server like [Luau Language Server](https://github.com/JohnnyMorganz/luau-lsp) for autocompletion, type checking, and more
156159
- [Open Cloud](../cloud/guides/index.md) scripts (not synced to Studio) to [update a published experience](/cloud/reference/Universe#Cloud_UpdateUniverse) or [restart servers](/cloud/reference/Universe#Cloud_RestartUniverseServers)
157160

158-
## Assets
159-
160-
The tools on this page are most applicable to scripts; 3D artists already use external tools like Blender and Maya, store the source files in version control, and import their creations into Studio. After you have a Studio asset, we recommend making use of [packages](../projects/assets/packages.md) whenever possible.
161-
162-
The Roblox implementation of packages follows many of the same principles as the tools on this page: a centralized repository with version history that offers a seamless way to keep all copies of an asset in sync. For more information on how they can improve your workflow, see [Packages](../projects/assets/packages.md).
163-
164161
## Undo everything
165162

166163
Because third-party tools sync changes back to Roblox Studio rather than replacing it, no part of this workflow involves any lock-in. At any time, you can stop using one or all of these tools and go back to editing your experience exclusively in Studio. The lack of risk makes experimenting with third-party tools particularly appealing.

content/en-us/scripting/index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ A big part of adapting to a new development environment is configuring it to mee
132132
- The [Script Analysis](../studio/script-editor.md#script-analysis) window shows a summary of errors and warnings, but you might find its utility limited; the Script Editor already highlights these issues as you type.
133133
- Logging capabilities are minimal, with no concept of log levels like `DEBUG` or `FATAL`. Use `Global.LuaGlobals.print()` and `Global.RobloxGlobals.warn()`.
134134

135-
For more information about configuring Studio for scripting, see [Script Editor](../studio/script-editor.md). For information on using your favorite text editor and version control system, see [External tools](../projects/external-tools.md).
135+
For more information about configuring Studio for scripting, see [Script Editor](../studio/script-editor.md).
136+
137+
<Alert severity="success">
138+
To use your favorite text editor and version control system rather than the built-in editor, see [Script Sync](./sync.md).
139+
</Alert>
136140

137141
## Your second script
138142

content/en-us/scripting/sync.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: Script Sync
3+
description: Use Studio's Script Sync feature to edit your Luau scripts in an external text editor.
4+
---
5+
6+
import BetaAlert from '../includes/beta-features/beta-alert.md'
7+
8+
<BetaAlert betaName="Script Sync" leadIn="Script Sync is currently in Studio beta. To enable this feature, select " leadOut="." components={props.components} />
9+
10+
Roblox Studio has a built-in [script editor](../studio/script-editor.md) for editing the code in your Roblox project. The editor includes key features like linting, type checking, autocomplete and collaborative editing.
11+
12+
Many developers, however, have a preferred text editor, such as [Visual Studio Code](https://code.visualstudio.com), [Sublime Text](https://www.sublimetext.com), [Notepad++](https://notepad-plus-plus.org), or [Vim](https://www.vim.org). Popular development environments often have features or plugins that don't exist in Studio. To use an external text editor with Studio, enable the **Script Sync** feature.
13+
14+
Script Sync works by synchronizing the scripts in your [data model](../projects/data-model.md) to text files on your local disk. Changes made to the Luau files on disk are applied to the scripts in Studio, and vice versa. This synchronization means that you can edit a script in an external editor like VS Code and immediately see the change in Studio.
15+
16+
## When to use Script Sync
17+
18+
- If you want to use your preferred text editor or check code into version control, but use Studio for everything else, Script Sync is a good fit. It also works with Roblox's [built-in collaboration tools](../projects/collaboration.md), which third-party tools often do not.
19+
20+
Script Sync works well with existing Roblox projects, as it's an extra feature rather than a total shift in how you manage the project.
21+
22+
- If you want to check your entire project (not just code) into version control or use your file system as the source of truth for your project, [third-party tools](../projects/external-tools.md) like Rojo are a better choice.
23+
24+
<Alert severity="info">
25+
It is currently not possible to control Roblox Studio's debugger from an external development environment.
26+
</Alert>
27+
28+
## Set up Script Sync
29+
30+
1. In the **Explorer**, select one or more folders that you want to sync.
31+
1. Right-click and select **Script Sync****Sync with Directory**.
32+
33+
<img src="../assets/scripting/external-tools/script-sync.png" alt="The Explorer window with the Script Sync menu expanded." width="400" />
34+
35+
1. Choose a directory on your computer (or create a new one) and click **Save**.
36+
1. In Studio, right-click on the folder again and select **Script Sync****Reveal in Explorer** (Windows) or **Reveal in Finder** (macOS).
37+
1. Open the directory in your preferred text editor.
38+
39+
Alternatively, right-click an individual script in Studio and select **Open in External Editor**.
40+
41+
You can sync individual scripts, but we **highly** recommend syncing folders; if you sync a folder, Script Sync automatically syncs its child folders and scripts, which lets you create, delete, and rename scripts without having to enable syncing each time.
42+
43+
<Alert severity="success">
44+
You only have to set up syncing once. When you restart Studio and open your place, Script Sync remembers what you were syncing and resumes automatically.
45+
</Alert>
46+
47+
## Key tips
48+
49+
- Script Sync only syncs `Class.Script`, `Class.LocalScript`, `Class.ModuleScript` and `Class.Folder` instances. All other instances in a synced folder are ignored. Avoid syncing folders that contain scripts alongside other instances.
50+
- Don't sync scripts that have attributes or tags. Script Sync ignores these, which can lead to data loss if you create or delete scripts or start syncing with an older version of your files on disk.
51+
- Script Sync requires the names of scripts be compatible with your file system—no duplicate names or unsupported characters. If Studio encounters any of these issues, it throws an error and asks you to resolve the situation before resuming sync.
52+
- If any synced files or folders change while Studio is closed, Studio asks you how you want to resolve the situation when you reopen the place.
53+
- Deleting a top-level (or "root") instance—the instance you initially synced—on your local disk can cause Studio to throw an error. To delete a top-level instance:
54+
55+
1. In Studio, right-click the script or folder and select **Script Sync****Stop Sync**.
56+
1. Choose the **Delete file(s)** or **Delete folder(s)** option to delete the instance from your local disk.
57+
1. Delete the script or folder in Studio.
58+
59+
You can delete child instances in Studio or on your local disk without disabling syncing, and the deletion syncs as you'd expect.
60+
61+
## Set up a language server
62+
63+
Language servers give your text editor language-specific features like autocomplete, type checking, "go to definition," and more. For VS Code, we recommend [Luau Language Server](https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.luau-lsp).
64+
65+
Language server protocol (LSP) extensions need to understand the data model hierarchy of a project to work properly. The VS Code extension comes with a companion Studio plugin ([Luau Language Server Companion](https://create.roblox.com/store/asset/10913122509/Luau-Language-Server-Companion)) that provides this data.
66+
67+
**We highly recommend installing both.** If you use the VS Code extension and companion Studio plugin, language features will work correctly in VS Code while using Script Sync.
68+
69+
## Recommended extensions
70+
71+
<Alert severity="info">
72+
The community maintains these extensions. We recommend them based on their functionality, but can't offer guarantees about performance or security. Before installing an extension, check that it comes from a reputable source and isn't malicious.
73+
</Alert>
74+
75+
- [Roblox Luau LSP](https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.luau-lsp) and [Luau Language Server Companion](https://create.roblox.com/store/asset/10913122509/Luau-Language-Server-Companion) - Language features (see above)
76+
- [selene](https://marketplace.visualstudio.com/items?itemName=Kampfkarren.selene-vscode) - Static code analysis (linting)
77+
- [StyLua](https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.stylua) - Automatic code formatting
78+
79+
## Sync rules
80+
81+
When syncing an instance with children with a directory on disk, Studio will automatically sync create, rename, move, and delete operations on children with the corresponding files and folders on disk. This approach lets you maintain your code without having to manually stop and start syncing on individual scripts.
82+
83+
On disk, Script Sync uses the following rules to disambiguate the different types of scripts from each other.
84+
85+
| Naming convention on disk | Instance type in Studio |
86+
| :---- | :---- |
87+
| `name.luau` | `Class.ModuleScript` |
88+
| `name.server.luau` | Script with `Server` `Class.Script.RunContext` |
89+
| `name.client.luau` | Script with `Client` `Class.Script.RunContext` |
90+
| `name.local.luau` | `Class.LocalScript` |
91+
| `name.legacy.luau` | Script with `Legacy` `Class.Script.RunContext` |
92+
| `name.plugin.luau` | Script with `Plugin` `Class.Script.RunContext` |
93+
| `name/` (directory) | `Class.Folder` |
94+
| `name/init.*.luau` | Script instance with children. Type (`*`) is determined by the above rules. |
95+
96+
## Settings
97+
98+
Script Sync has several settings in the **Studio Settings** window (<kbd>Alt</kbd><kbd>S</kbd> or <kbd></kbd>⌥<kbd>S</kbd>). The default options are a good fit for most use cases.
99+
100+
| Setting | Description |
101+
| :---- | :---- |
102+
| Auto resume sync on place open | Whether Studio should resume syncing when you open a place. Disabling this setting dramatically reduces the utility of Script Sync. |
103+
| Resume conflicted sync on place open | How Studio should handle conflicts when you open a place. The default option, **Do not resume**, forces you to resolve conflicts manually to avoid data loss. You can also choose to prefer the version on disk or the version in Studio. |
104+
| Keep local files/directories after sync | How to handle files on disk after you select **Script Sync** > **Stop Sync** in Studio.
105+
| File extension | The file extension to use for scripts on disk.

tools/checks/utils/allowedHttpLinks.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,3 +737,6 @@ https://www.youtube-nocookie.com/embed/j6OPA95-1O0
737737
https://www.youtube-nocookie.com/embed/-HYByqvW2uc
738738
https://de.wikipedia.org/wiki/Eulerwinkel
739739
https://json-schema.org/
740+
https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.luau-lsp
741+
https://marketplace.visualstudio.com/items?itemName=Kampfkarren.selene-vscode
742+
https://marketplace.visualstudio.com/items?itemName=JohnnyMorganz.stylua

0 commit comments

Comments
 (0)