Title: [Feature]: Optional compiled-template path for `view` · Issue #138 · bQuery/bQuery · GitHub
Open Graph Title: [Feature]: Optional compiled-template path for `view` · Issue #138 · bQuery/bQuery
X Title: [Feature]: Optional compiled-template path for `view` · Issue #138 · bQuery/bQuery
Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case view evaluates directive expressions at runtime. That is exactly rig...
Open Graph Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case view evaluates directive exp...
X Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case view evaluates directive exp...
Opengraph URL: https://github.com/bQuery/bQuery/issues/138
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature]: Optional compiled-template path for `view`","articleBody":"**Pre-flight checklist**\n- [x] I searched existing issues and did not find a duplicate request.\n- [x] I explained the problem or use case, not just the desired API.\n\n**Problem or use case**\n`view` evaluates directive expressions at runtime. That is exactly right for the zero-build CDN story, but it leaves performance on the table for build-using apps and keeps an expression parser/evaluator on the hot path — which is also where the documented `bq-for`/object-expression edge cases live (#136). Svelte compiles templates to optimized JS, and Vue offers a compile step; bQuery has no opt-in equivalent, so larger views pay runtime-evaluation cost they could avoid.\n\n**Proposed solution**\nOffer an **optional**, build-tool-agnostic compile step that pre-parses `bq-*` expressions and emits optimized update functions, while the runtime evaluator remains the default for zero-build usage. This must be strictly opt-in to preserve the \"zero mandatory build step\" goal and must not introduce a bundled build tool of bQuery's own (a non-goal) — it should be a small transform usable from any bundler plus a CLI invocation. Compiled and runtime paths must be behaviorally identical so authoring is unchanged.\n\n**Possible API or UX shape**\n```ts\n// Optional, e.g. as a Vite/esbuild/rollup-agnostic transform:\nimport { compileViews } from \"@bquery/bquery/view/compiler\";\n\n// build step: precompiles bq-* expressions in templates to update fns\n// runtime is unchanged for zero-build users — same directives, same behavior\n```\n\n**Alternatives considered**\nStaying runtime-only forever — acceptable but cedes a measurable performance axis to Svelte/Vue for apps that already build. Making compilation mandatory — violates the zero-build goal and the no-bundled-build-tool non-goal; opt-in is the only design consistent with bQuery's identity.\n\n**Relevant area**\n`view`\n\n**Additional context**\nLower priority than #136/#137 for *stability*, but it both improves performance parity and reduces the runtime parser surface where the known edge cases live. Area could also be classified as \"build or tooling\"; filed under `view` since the behavior it optimizes is the view layer.\n","author":{"url":"https://github.com/JosunLP","@type":"Person","name":"JosunLP"},"datePublished":"2026-06-26T21:25:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/138/bQuery/issues/138"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5fb22c85-b60b-ffad-e023-d41cf8106671 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EDE4:3E5F9F:7A9A87:A82BF8:6A4DD632 |
| html-safe-nonce | c80e8fdbc265fadf576b77334b3f9670f0375004bbf0069b41a863003a859583 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREU0OjNFNUY5Rjo3QTlBODc6QTgyQkY4OjZBNERENjMyIiwidmlzaXRvcl9pZCI6IjE3NTI3OTE3Njc0ODcyMDY5NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b18bdb53a0c476468f5b035c53f990eda81a350088e2c02ecd6abb50e9ddea27 |
| hovercard-subject-tag | issue:4755238280 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bQuery/bQuery/138/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8766530311022a1cd1ea36516f2bb1118dc3da568ce60fdd5f1cc8b1e1aa5be4/bQuery/bQuery/issues/138 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8766530311022a1cd1ea36516f2bb1118dc3da568ce60fdd5f1cc8b1e1aa5be4/bQuery/bQuery/issues/138 |
| og:image:alt | Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case view evaluates directive exp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JosunLP |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git |
| octolytics-dimension-user_id | 256381806 |
| octolytics-dimension-user_login | bQuery |
| octolytics-dimension-repository_id | 1139284244 |
| octolytics-dimension-repository_nwo | bQuery/bQuery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1139284244 |
| octolytics-dimension-repository_network_root_nwo | bQuery/bQuery |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width