You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build-apps/use-third-party-libraries.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Every developer learns one of the most important principles of software engineering early in their career: DRY (Don’t Repeat Yourself). Using third-party libraries can save your time as you do not need to develop the functionality that the library provides. Openblocks provides some built-in third-party libraries for common uses, and you can manually import other libraries on demand.
4
4
5
-
### Built-in third-party libraries
5
+
### Built-in libraries
6
6
7
7
Openblocks provides some JavaScript built-in libraries for use:
8
8
@@ -14,20 +14,20 @@ Openblocks provides some JavaScript built-in libraries for use:
Openblocks supports setting up preloaded JavaScript and libraries which can be **app-level** or **workspace-level**.
20
20
21
-
***App-level**JavaScript****gets loaded only in the app where defined. Plus, app A cannot use libraries that are set up for app B.
22
-
***Workspace-level**JavaScript**** will be loaded when you open any application in your workspace. All the apps can access those libraries. There can be a certain impact on app performance, especially when you have complex JavaScript functions that aren't being used in every app.
21
+
***App-level**libraries****get loaded only in the app where defined. Plus, app A cannot use libraries that are set up for app B.
22
+
***Workspace-level**libraries**** will be loaded when you open any application in your workspace. All the apps can access those libraries. There can be a certain impact on app performance, especially when you have complex JavaScript functions that aren't being used in every app.
23
23
24
24
{% hint style="info" %}
25
25
**Tips you should know before setting up libraries:**
26
26
27
27
* External libraries are loaded and run in the browser.
28
28
* NodeJS-only libraries are not supported now.
29
29
* URLs of external libraries need to support cross-domain.
30
-
* The export of the library must be set directly on the window object, global variables like (var xxx = xxx) do not take effect.
30
+
* The export of the library must be set directly on the window object, global variables like `var xxx = xxx` do not take effect.
31
31
* The external libraries run in a restricted sandbox environment and the following global variables are not available:
Navigate to the left sidebar, click <imgsrc="../.gitbook/assets/image (1).png"alt=""data-size="line"> > **Other** > **Scripts and style** > **Add a library**. Then paste the **cowsay** link here.
69
69
@@ -73,15 +73,15 @@ Now you can write code in **JS query** to test its usage with `cowsay.say`:
73
73
74
74
<figure><imgsrc="../.gitbook/assets/write code in JS query (2).png"alt=""><figcaption></figcaption></figure>
75
75
76
-
or in **Properties** to use:
76
+
or in component **Properties**:
77
77
78
78
<figure><imgsrc="../.gitbook/assets/or in Properties (2).png"alt=""><figcaption></figcaption></figure>
79
79
80
80
And since you have set up cowsay just for **Openblocks's new application 1,** you can not use cowsay in another app.
81
81
82
82
<figure><imgsrc="../.gitbook/assets/in another app (1).png"alt=""><figcaption></figcaption></figure>
83
83
84
-
####Import on Workspace-level libraries
84
+
### Import on Workspace-level libraries
85
85
86
86
Navigate to **Workspace settings** > **Advanced** > **JavaScript library** > **Add a library**. Then paste the **cowsay** link here and click **Save**. Now you can use **cowsay** library **** in any app of your workspace.\
87
87
.png>)
0 commit comments