LearnNewsExamplesServices
Frontmatter
id7160
titleIntegrate Template Processing into `dist/development` Build
stateClosed
labels
enhancement
assigneestobiu
createdAtAug 2, 2025, 1:30 PM
updatedAtAug 2, 2025, 2:41 PM
githubUrlhttps://github.com/neomjs/neo/issues/7160
authortobiu
commentsCount1
parentIssue7130
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtAug 2, 2025, 2:41 PM

Integrate Template Processing into dist/development Build

Closed v10.3.0 enhancement
tobiu
tobiu commented on Aug 2, 2025, 1:30 PM

1. Summary

Use the new reusable astTemplateProcessor to enable build-time html template transformation for the dist/development Webpack environment.

2. Rationale

To ensure feature parity and a consistent developer experience, html templates must be correctly processed in the dist/development environment. This allows developers who use this environment (e.g., for TypeScript or specific debugging scenarios) to use the template syntax.

3. Scope & Implementation Plan

  1. Create Webpack Loader: Create a custom Webpack loader (e.g., buildScripts/webpack/loader/template-loader.mjs).
  2. Implement Loader Logic:
    • The loader will receive the file content.
    • It will perform the same pre-emptive regex check from sub-task #7159 .
    • If the check passes, it will import and call the processFileContent() function from astTemplateProcessor.mjs.
    • It will return the transformed code (or the original code if the check fails) to the Webpack compilation chain.
  3. Configure Webpack: Update the Webpack configuration for dist/development to use this new loader for all .mjs files.

4. Definition of Done

  • The custom Webpack loader is created and functional.
  • The dist/development build process correctly transforms html templates into VDOM objects.
  • Applications running in dist/development mode render components using html templates correctly.
tobiu assigned to @tobiu on Aug 2, 2025, 1:30 PM
tobiu added the enhancement label on Aug 2, 2025, 1:30 PM
tobiu added parent issue #7130 on Aug 2, 2025, 1:30 PM
tobiu referenced in commit a04d286 - "Integrate Template Processing into dist/development Build #7160" on Aug 2, 2025, 2:40 PM
tobiu
tobiu Aug 2, 2025, 2:41 PM
Image
tobiu closed this issue on Aug 2, 2025, 2:41 PM