tw-framework 0.3.0__tar.gz → 0.3.2__tar.gz
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.
- {tw_framework-0.3.0 → tw_framework-0.3.2}/PKG-INFO +1 -1
- {tw_framework-0.3.0 → tw_framework-0.3.2}/pyproject.toml +1 -1
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/compiler.py +24 -4
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework.egg-info/PKG-INFO +1 -1
- {tw_framework-0.3.0 → tw_framework-0.3.2}/README.md +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/setup.cfg +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tests/test_deployment.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/__init__.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/adapters/__init__.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/adapters/cloudflare.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/adapters/netlify.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/adapters/vercel.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/adapters/vercel_functions.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/advanced_diagnostics.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/asset_optimizer.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/ast_nodes.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/build.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/build_performance.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/build_report.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/cli.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/code_splitting.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/common.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/compiler_stats.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/dead_code.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/dependency_graph.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/deploy.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/dev.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/diagnostics.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/dynamic_imports.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/error_formatter.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/framework.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/hydration.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/incremental_cache.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/interpreter.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/ir.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/lexer.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/lowering.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/parser.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/partial_rebuild.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/performance_analyzer.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/plugin_runtime.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/production_optimizer.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/reactivity.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/render_css.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/render_html.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/route_optimizer.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/router.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/runtime_model.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/runtime_values.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/semantic.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/server.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/signature.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/static_dynamic_auto.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/streaming.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/test_build_cli_pytest.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/tree_shaking.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/twm_api_runner.js +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework/twm_parser.py +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework.egg-info/SOURCES.txt +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework.egg-info/dependency_links.txt +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework.egg-info/entry_points.txt +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework.egg-info/requires.txt +0 -0
- {tw_framework-0.3.0 → tw_framework-0.3.2}/tw_framework.egg-info/top_level.txt +0 -0
|
@@ -1161,6 +1161,15 @@ def tokenize(code, allow_inline_scripts=False):
|
|
|
1161
1161
|
):
|
|
1162
1162
|
word.append(advance_one())
|
|
1163
1163
|
continue
|
|
1164
|
+
if (
|
|
1165
|
+
ch == "."
|
|
1166
|
+
and word
|
|
1167
|
+
and word[-1].isdigit()
|
|
1168
|
+
and i + 1 < n
|
|
1169
|
+
and code[i + 1].isdigit()
|
|
1170
|
+
):
|
|
1171
|
+
word.append(advance_one())
|
|
1172
|
+
continue
|
|
1164
1173
|
break
|
|
1165
1174
|
word.append(advance_one())
|
|
1166
1175
|
word = "".join(word)
|
|
@@ -2609,10 +2618,16 @@ def parse_property_value(tokens, i):
|
|
|
2609
2618
|
if tok.type == "BRACE" and tok.value == "}":
|
|
2610
2619
|
return True, i
|
|
2611
2620
|
|
|
2612
|
-
# Fast path: single token value
|
|
2613
|
-
|
|
2614
|
-
|
|
2621
|
+
# Fast path: single token value.
|
|
2622
|
+
# A quoted STRING value is always complete on its own — its boundaries
|
|
2623
|
+
# are the quote marks, so it never needs line-greedy collection. This
|
|
2624
|
+
# matters for single-line elements with multiple properties, e.g.
|
|
2625
|
+
# `a { href "/" target "_blank" text "Home" }` — without this, `href`
|
|
2626
|
+
# would swallow every token through the rest of the line.
|
|
2627
|
+
if tok.type == "STRING":
|
|
2615
2628
|
return tok.value, i + 1
|
|
2629
|
+
|
|
2630
|
+
nxt = peek(tokens, i + 1)
|
|
2616
2631
|
if tok.type == "WORD" and (not nxt or nxt.type in {"NL"} or (nxt.type == "BRACE" and nxt.value == "}")):
|
|
2617
2632
|
return tok.value, i + 1
|
|
2618
2633
|
|
|
@@ -3221,6 +3236,8 @@ def render_value(value, context):
|
|
|
3221
3236
|
|
|
3222
3237
|
|
|
3223
3238
|
def html_escape(value):
|
|
3239
|
+
if isinstance(value, bool):
|
|
3240
|
+
value = "true" if value else "false"
|
|
3224
3241
|
s = "" if value is None else str(value)
|
|
3225
3242
|
return (
|
|
3226
3243
|
s.replace("&", "&")
|
|
@@ -3253,7 +3270,10 @@ def render_attrs(attrs, context):
|
|
|
3253
3270
|
logger.exception("transform_reactive_attrs failed; continuing without reactive directives")
|
|
3254
3271
|
parts = []
|
|
3255
3272
|
for name, raw_value in attrs:
|
|
3256
|
-
|
|
3273
|
+
if name.startswith("data-tw-"):
|
|
3274
|
+
value = raw_value
|
|
3275
|
+
else:
|
|
3276
|
+
value = render_value(raw_value, context)
|
|
3257
3277
|
if name in {"src", "href", "poster"}:
|
|
3258
3278
|
value = resolve_static_asset_url(value)
|
|
3259
3279
|
elif name == "srcset" and isinstance(value, str):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|