@dosgato/templating 0.0.56 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/provider.d.ts +63 -2
- package/dist/provider.js +2 -1
- package/package.json +1 -1
package/dist/provider.d.ts
CHANGED
|
@@ -1,19 +1,79 @@
|
|
|
1
1
|
export interface CSSBlock {
|
|
2
|
+
/**
|
|
3
|
+
* The CSS as a string. Provide either this or `path`.
|
|
4
|
+
*/
|
|
2
5
|
css?: string;
|
|
6
|
+
/**
|
|
7
|
+
* A file path to the CSS. The rendering server will read the file on startup.
|
|
8
|
+
*/
|
|
3
9
|
path?: string;
|
|
10
|
+
/**
|
|
11
|
+
* This CSS is actually SASS and requires a compile. The rendering server will
|
|
12
|
+
* perform the compilation on startup.
|
|
13
|
+
*/
|
|
14
|
+
sass?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* A version string following SEMVER. If multiple blocks are provided with the same name,
|
|
17
|
+
* the one with the highest version number will be chosen. If blocks of different major
|
|
18
|
+
* versions are provided, an alert will appear in the log.
|
|
19
|
+
*/
|
|
4
20
|
version?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The CSS provided by this block applies to elements that are not on screen at
|
|
23
|
+
* page load, i.e. modals and dialogs.
|
|
24
|
+
*
|
|
25
|
+
* Setting it true will improve our time-to-first-paint, but any CSS that does
|
|
26
|
+
* apply to elements on screen at page load will cause a visible re-render that
|
|
27
|
+
* may disturb the user.
|
|
28
|
+
*/
|
|
5
29
|
async?: boolean;
|
|
6
30
|
}
|
|
7
31
|
export interface JSBlock {
|
|
32
|
+
/**
|
|
33
|
+
* The javascript as a string. Provide either this or `path`.
|
|
34
|
+
*/
|
|
8
35
|
js?: string;
|
|
36
|
+
/**
|
|
37
|
+
* A file path to the javascript. The rendering server will read the file on startup.
|
|
38
|
+
*/
|
|
9
39
|
path?: string;
|
|
40
|
+
/**
|
|
41
|
+
* A version string following SEMVER. If multiple blocks are provided with the same name,
|
|
42
|
+
* the one with the highest version number will be chosen. If blocks of different major
|
|
43
|
+
* versions are provided, an alert will appear in the log.
|
|
44
|
+
*/
|
|
10
45
|
version?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The javascript provided by this block does not need to run before the DOM finishes
|
|
48
|
+
* loading. For instance, if the javascript only places event listeners and does not
|
|
49
|
+
* modify the DOM or create globals on first run, it is eligible for this flag.
|
|
50
|
+
*
|
|
51
|
+
* Setting it true will improve our time-to-first paint, but any DOM manipulations on
|
|
52
|
+
* first run will cause visible repaints that may disturb the user.
|
|
53
|
+
*
|
|
54
|
+
* Additionally, you cannot depend on load order of any async JS, so libraries like
|
|
55
|
+
* jquery that create globals intended for later use must be loaded synchronously
|
|
56
|
+
* (unless their dependents are smart enough to wait for the global to be defined).
|
|
57
|
+
*/
|
|
11
58
|
async?: boolean;
|
|
12
59
|
}
|
|
13
60
|
export interface FileDeclaration {
|
|
61
|
+
/**
|
|
62
|
+
* The path to the file.
|
|
63
|
+
*/
|
|
14
64
|
path: string;
|
|
65
|
+
/**
|
|
66
|
+
* A version string following SEMVER. If multiple files are provided with the same name,
|
|
67
|
+
* the one with the highest version number will be chosen.
|
|
68
|
+
*/
|
|
15
69
|
version?: string;
|
|
16
|
-
|
|
70
|
+
/**
|
|
71
|
+
* The mime type of the file. If omitted, it will be automatically detected from the
|
|
72
|
+
* file data.
|
|
73
|
+
*
|
|
74
|
+
* If needed, you may also specify a non-default charset with e.g. `text/html; charset=ascii`
|
|
75
|
+
*/
|
|
76
|
+
mime?: string;
|
|
17
77
|
}
|
|
18
78
|
/**
|
|
19
79
|
* This class is a parent class for Component, but it can also be used as a standalone
|
|
@@ -80,7 +140,8 @@ export declare abstract class ResourceProvider {
|
|
|
80
140
|
/**
|
|
81
141
|
* Template code will need to generate HTML and CSS that points at the static files
|
|
82
142
|
* provided above. In order to do so, we need information from the template registry (since
|
|
83
|
-
* we have to deduplicate with other registered templates at startup time
|
|
143
|
+
* we have to deduplicate with other registered templates at startup time, and the structure
|
|
144
|
+
* of the webpath in general is the render server's concern).
|
|
84
145
|
*
|
|
85
146
|
* In order to avoid an ES6 dependency on the registry, we will have the registry write
|
|
86
147
|
* back to this map as templates are registered.
|
package/dist/provider.js
CHANGED
|
@@ -66,7 +66,8 @@ ResourceProvider.files = new Map();
|
|
|
66
66
|
/**
|
|
67
67
|
* Template code will need to generate HTML and CSS that points at the static files
|
|
68
68
|
* provided above. In order to do so, we need information from the template registry (since
|
|
69
|
-
* we have to deduplicate with other registered templates at startup time
|
|
69
|
+
* we have to deduplicate with other registered templates at startup time, and the structure
|
|
70
|
+
* of the webpath in general is the render server's concern).
|
|
70
71
|
*
|
|
71
72
|
* In order to avoid an ES6 dependency on the registry, we will have the registry write
|
|
72
73
|
* back to this map as templates are registered.
|