Skip to content

Commit 864521f

Browse files
Note Script Lab size restrictions in readme (#964)
1 parent e4afc31 commit 864521f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ A collection of code snippets built with [Script Lab](//github.com/OfficeDev/scr
1414
1. Clone your fork to your development computer.
1515
1. Ensure that you have Node, version 6.10+, installed. (To check the version run the command `node -v`.)
1616
1. Install `yarn` as a global package `npm install yarn --global`.
17-
1. Be sure your CLI is in the root of the office-js-snippets repo and run `yarn install`. (It is similar to `npm install`.)
17+
1. Be sure your CLI is in the root of the office-js-snippets repo and run `yarn install`. (It's similar to `npm install`.)
1818
1. Set up the original \OfficeDev\office-js-snippets as the upstream repo for your local repo by following the steps in [Configuring a remote for a fork](https://help.github.com/articles/configuring-a-remote-for-a-fork/).
1919
1. If you'll be using Visual Studio Code as your editor, install the [TSLint](https://marketplace.visualstudio.com/items?itemName=eg2.tslint) extension for Visual Studio Code.
2020

2121
### Adding a new sample
2222

2323
> For the git tasks in this procedure, the instructions assume that you're using a CLI. You are welcome to use a GUI git client. Consult the client's help to learn how to carry out the same tasks.
2424
25-
1. Create a snippet using [Script Lab](https://github.com/OfficeDev/script-lab/blob/master/README.md#what-is). Ensure that the name and description are what you want to be shown publicly. Use standard TypeScript indentation. Improper indentation can cause a failure of the build that you run in a later step. See also the [**Style guidelines**](#style-guidelines) section below.
25+
1. Create a snippet using [Script Lab](https://github.com/OfficeDev/script-lab/blob/master/README.md#what-is). Ensure that the name and description are what you want to be shown publicly. Make sure to keep your snippet small. Use standard TypeScript indentation. Improper indentation can cause a failure of the build that you run in a later step. See also the [**Style guidelines**](#style-guidelines) and [**Size restrictions**](#size-restrictions) sections below.
2626
1. Choose the Share icon, and then choose **Copy to Clipboard**.
2727
1. Paste the contents into a text editor.
2828
1. Near the top of the file, you will see the line `api_set: {}`. This needs to be changed to specify the host API version of the most recently added API that is used in your snippet. For example, if the snippet is for Excel and it uses some APIs that were introduced in Excel API 1.3, some in 1.4, and some in 1.5, then you need to specify `ExcelApi 1.5` as the value of the `api_set` property. Put a line break and four spaces before the value and no {} characters. To continue the example, when you're done the property would look like this:
@@ -130,6 +130,14 @@ A few style rules to observe:
130130
- Don't forget the semicolons.
131131
- `Libraries` in snippets must have a specific version. Eg. `[email protected]`.
132132

133+
## Size restrictions
134+
135+
Script Lab is designed for you to play with small code samples. Generally, a snippet should be at most a few hundred lines and a few thousand characters.
136+
137+
Your snippet can use hard-coded data. A small amount of data (say, a few hundred characters) is OK to hard code in Script Lab. However, for larger pieces of data, we recommend that you store those externally then load them at runtime with a command like `fetch`.
138+
139+
Keep your snippets and hard-coded data small since storing several large snippets could exceed Script Lab's storage and cause issues when loading Script Lab.
140+
133141
## Debugging the build script
134142

135143
- The scripts for building/validating the snippets are under the `config` folder -- in particular, under `build.ts`.

0 commit comments

Comments
 (0)