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/projects/scripts.qmd
+30-2Lines changed: 30 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,8 @@ declared file as the destination of the file list that would have been written i
114
114
115
115
If you want to create project scripts with TypeScript, `quarto run` enables you to use the [Deno](https://deno.land/) TypeScript interpreter bundled with Quarto. This interpreter also includes much of Deno's [standard library](https://docs.deno.com/runtime/manual/basics/standard_library). For example, to use the Deno YAML parser you would do this:
116
116
117
+
### Quarto 1.6 breaking changes
118
+
117
119
::: callout-warning
118
120
119
121
Quarto 1.6 includes updates to Deno and Deno's standard library which forced us to make breaking changes to the import syntax. We apologize for the inconvenience.
@@ -127,7 +129,13 @@ import { parse } from "https://deno.land/std/yaml/mod.ts"; // Quarto 1.5 and ear
Although Deno hosts its standard library online, it's important to note that in both Quarto 1.6 and 1.5, the library is *not downloaded from a remote server* (in fact, importing from remote servers is disabled entirely in the Quarto Deno interpreter). Rather, the Deno standard library is shipped with Quarto, making standard library URLs available in an offline cache.
132
+
Although Deno hosts its standard library online, it's important to note that in Quarto 1.5, the library is *not downloaded from a remote server* (in fact, importing from remote servers is disabled entirely in the Quarto Deno interpreter).
133
+
Quarto 1.6 ships with a version of Deno that has an unfortunate interaction between its standard library and the feature that disables downloading the library from the remote servers.
134
+
As a result, Quarto 1.6 might download some files (once, and then cache them) when the standard library is invoked.
135
+
Future versions of Quarto will ship with Deno 2, which does not suffer from this issue.
136
+
137
+
If you want to enforce the behavior from Quarto 1.5, you can set the [environment variable](/docs/advanced/environment-vars.qmd) `QUARTO_RUN_NO_NETWORK` to `true`.
138
+
Note that this means that the imports from `stdlib/` will not work in general.
131
139
132
140
You may come across example code that embeds versions directly in Deno library imports. For example:
133
141
@@ -142,4 +150,24 @@ These version-bound imports **will not work** with Quarto (as its local standard
142
150
import { format } from "stdlib/datetime";
143
151
```
144
152
145
-
You may also see examples of Deno code that imports 3rd party libraries directly from URLs. As noted above, this functionality is not available in Quarto Deno scripts. Rather, you should download any external libraries you wish to use, include them with your project source code, and import them using relative file paths.
153
+
You may also see examples of Deno code that imports 3rd party libraries directly from URLs.
154
+
As noted above, this functionality is generally not available in Quarto Deno scripts.
155
+
Rather, you should download any external libraries you wish to use, include them with your project source code, and import them using relative file paths.
156
+
157
+
### Making `.ts` scripts portable across multiple versions of Quarto
158
+
159
+
If you need your project or extension to both include TypeScript project scripts and work with Quarto 1.5 and 1.6, use the following technique:
0 commit comments