ripple 0.2.76 → 0.2.78
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/package.json +6 -6
- package/src/compiler/index.js +2 -2
- package/src/compiler/phases/1-parse/index.js +0 -5
- package/src/compiler/phases/3-transform/client/index.js +1621 -1673
- package/src/compiler/phases/3-transform/server/index.js +350 -77
- package/src/compiler/utils.js +60 -0
- package/src/runtime/{index.js → index-client.js} +6 -0
- package/src/runtime/index-server.js +32 -0
- package/src/runtime/internal/client/runtime.js +4 -0
- package/src/runtime/internal/server/context.js +67 -0
- package/src/runtime/internal/server/index.js +107 -22
- package/src/server/index.js +1 -1
- package/src/utils/escaping.js +26 -0
- package/tests/client/__snapshots__/basic.test.ripple.snap +9 -0
- package/tests/client/basic.test.ripple +13 -0
package/package.json
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"description": "Ripple is an elegant TypeScript UI framework",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dominic Gannaway",
|
|
6
|
-
"version": "0.2.
|
|
6
|
+
"version": "0.2.78",
|
|
7
7
|
"type": "module",
|
|
8
|
-
"module": "src/runtime/index.js",
|
|
9
|
-
"main": "src/runtime/index.js",
|
|
8
|
+
"module": "src/runtime/index-client.js",
|
|
9
|
+
"main": "src/runtime/index-client.js",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
12
12
|
"url": "git+https://github.com/trueadm/ripple.git",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
26
|
"types": "./types/index.d.ts",
|
|
27
|
-
"worker": "./src/runtime/index.js",
|
|
28
|
-
"browser": "./src/runtime/index.js",
|
|
29
|
-
"default": "./src/runtime/index.js"
|
|
27
|
+
"worker": "./src/runtime/index-server.js",
|
|
28
|
+
"browser": "./src/runtime/index-client.js",
|
|
29
|
+
"default": "./src/runtime/index-server.js"
|
|
30
30
|
},
|
|
31
31
|
"./package.json": "./package.json",
|
|
32
32
|
"./server": {
|
package/src/compiler/index.js
CHANGED
|
@@ -19,13 +19,13 @@ export function parse(source) {
|
|
|
19
19
|
/**
|
|
20
20
|
* @param {string} source
|
|
21
21
|
* @param {string} filename
|
|
22
|
-
* @param {{
|
|
22
|
+
* @param {{ mode?: 'client' | 'server' }} options
|
|
23
23
|
* @returns {{ js: { code: string, map: RawSourceMap }, css: { code: string, map: RawSourceMap } | null }}
|
|
24
24
|
*/
|
|
25
25
|
export function compile(source, filename, options = {}) {
|
|
26
26
|
const ast = parse_module(source);
|
|
27
27
|
const analysis = analyze(ast, filename);
|
|
28
|
-
const result = options.
|
|
28
|
+
const result = options.mode === 'server'
|
|
29
29
|
? transform_server(filename, source, analysis)
|
|
30
30
|
: transform_client(filename, source, analysis, false);
|
|
31
31
|
|
|
@@ -828,11 +828,6 @@ function RipplePlugin(config) {
|
|
|
828
828
|
}
|
|
829
829
|
}
|
|
830
830
|
|
|
831
|
-
if (this.type.label === '</>/<=/>=') {
|
|
832
|
-
debugger;
|
|
833
|
-
console.log('HERE', this.value, this.type);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
831
|
if (this.type.label === '{') {
|
|
837
832
|
const node = this.jsx_parseExpressionContainer();
|
|
838
833
|
node.type = 'Text';
|