marko 5.34.5 → 5.35.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -82,8 +82,13 @@ exports.p = function (domCompat) {
|
|
82
82
|
domCompat.patchConditionals((conditional) => (...args) => {
|
83
83
|
const signal = conditional(...args);
|
84
84
|
const skipAttrs = args.length <= 1;
|
85
|
-
return (scope,
|
86
|
-
return signal(
|
85
|
+
return (scope, rendererOrOp) => {
|
86
|
+
return signal(
|
87
|
+
scope,
|
88
|
+
domCompat.isOp(rendererOrOp) ?
|
89
|
+
rendererOrOp :
|
90
|
+
create5to6Renderer(rendererOrOp, skipAttrs)
|
91
|
+
);
|
87
92
|
};
|
88
93
|
});
|
89
94
|
|
@@ -124,8 +129,8 @@ exports.p = function (domCompat) {
|
|
124
129
|
_j_(null, null, realFragment);
|
125
130
|
return realFragment;
|
126
131
|
},
|
127
|
-
(scope, input
|
128
|
-
if (
|
132
|
+
(scope, input) => {
|
133
|
+
if (domCompat.isOp(input)) return;
|
129
134
|
renderAndMorph(scope, rendererFromAnywhere, renderer, input);
|
130
135
|
}
|
131
136
|
);
|
package/docs/compiler.md
CHANGED
@@ -206,6 +206,13 @@ Default: [environment based](https://github.com/marko-js/marko/blob/0f212897d2d3
|
|
206
206
|
|
207
207
|
Enables production mode optimizations.
|
208
208
|
|
209
|
+
#### `optimizedRegistryIds`
|
210
|
+
|
211
|
+
Type: `Map<string, string>`<br>
|
212
|
+
Default: `undefined`
|
213
|
+
|
214
|
+
If `optimize` is enabled you can provide a Map which the compiler will use to store shorter registry/template id's in. This can only be used if the same `optimizedRegistryIds` are used for both server and client compilations.
|
215
|
+
|
209
216
|
#### `resolveVirtualDependency`
|
210
217
|
|
211
218
|
Type:
|
package/docs/getting-started.md
CHANGED
@@ -1,6 +1,22 @@
|
|
1
1
|
# Getting started
|
2
2
|
|
3
|
-
|
3
|
+
## Setup
|
4
|
+
|
5
|
+
### Marko Run (Recommended)
|
6
|
+
|
7
|
+
[Marko Run](https://github.com/marko-js/run) makes it easy to get started with little to no config and is the recommended starting point for a new Marko project.
|
8
|
+
|
9
|
+
To set up your project:
|
10
|
+
|
11
|
+
1. `npm init marko -- -t basic`
|
12
|
+
2. `cd ./<PROJECT_NAME>`
|
13
|
+
3. `npm run dev`
|
14
|
+
|
15
|
+
Open `src/routes/_index/+page.marko` in your editor to change the index page. See the [routing documentation](https://github.com/marko-js/run#file-based-routing) to learn how to add additional pages to your project.
|
16
|
+
|
17
|
+
### Other setups
|
18
|
+
|
19
|
+
If you just want to test out Marko in your browser, use the [Try Online](https://markojs.com/try-online) feature. You can open it in another tab and follow along. For other setups, check out the [Installation](./installing.md) page.
|
4
20
|
|
5
21
|
## Hello world
|
6
22
|
|
package/docs/installing.md
CHANGED
@@ -9,10 +9,10 @@ If you just want to play around with Marko in the browser, head on over to our [
|
|
9
9
|
If you're starting from scratch, you can use Marko's [CLI](https://github.com/marko-js/cli) commands to quickly create a starter app:
|
10
10
|
|
11
11
|
```bash
|
12
|
-
|
12
|
+
npm init marko
|
13
13
|
```
|
14
14
|
|
15
|
-
This will use an interactive [CLI](https://github.com/marko-js/cli) to automatically create a project for you using the pre-made starter template of your choosing. The `basic` template is the most minimal and the easiest way to get started. It uses our
|
15
|
+
This will use an interactive [CLI](https://github.com/marko-js/cli) to automatically create a project for you using the pre-made starter template of your choosing. The `basic` template is the most minimal and the easiest way to get started. It uses our recommended app framework [Marko Run](https://github.com/marko-js/run) that handles building, bundling, and serving your web application. These projects are config-free with built-in file based routing and automatic code reloading.
|
16
16
|
|
17
17
|
## Custom Bundling
|
18
18
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "marko",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.35.0",
|
4
4
|
"description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
|
5
5
|
"keywords": [
|
6
6
|
"front-end",
|
@@ -64,7 +64,7 @@
|
|
64
64
|
"build": "babel ./src --out-dir ./dist --extensions .js --copy-files --config-file ../../babel.config.js --env-name=production"
|
65
65
|
},
|
66
66
|
"dependencies": {
|
67
|
-
"@marko/compiler": "^5.
|
67
|
+
"@marko/compiler": "^5.37.0",
|
68
68
|
"@marko/translator-default": "^6.0.1",
|
69
69
|
"app-module-path": "^2.2.0",
|
70
70
|
"argly": "^1.2.0",
|
@@ -82,8 +82,13 @@ exports.p = function (domCompat) {
|
|
82
82
|
domCompat.patchConditionals((conditional) => (...args) => {
|
83
83
|
const signal = conditional(...args);
|
84
84
|
const skipAttrs = args.length <= 1;
|
85
|
-
return (scope,
|
86
|
-
return signal(
|
85
|
+
return (scope, rendererOrOp) => {
|
86
|
+
return signal(
|
87
|
+
scope,
|
88
|
+
domCompat.isOp(rendererOrOp)
|
89
|
+
? rendererOrOp
|
90
|
+
: create5to6Renderer(rendererOrOp, skipAttrs),
|
91
|
+
);
|
87
92
|
};
|
88
93
|
});
|
89
94
|
|
@@ -124,8 +129,8 @@ exports.p = function (domCompat) {
|
|
124
129
|
___createFragmentNode(null, null, realFragment);
|
125
130
|
return realFragment;
|
126
131
|
},
|
127
|
-
(scope, input
|
128
|
-
if (
|
132
|
+
(scope, input) => {
|
133
|
+
if (domCompat.isOp(input)) return;
|
129
134
|
renderAndMorph(scope, rendererFromAnywhere, renderer, input);
|
130
135
|
},
|
131
136
|
);
|