feat(*): separating block templating from regular one#2279
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the core templating engine to separate block directives into a new advanced module, updates the build and test configurations to include the advanced engine, and adds localization support for missing advanced templating.
- Decouple block (
{{if}},{{each}}) handling intoinfragistics.templating.advanced.js. - Refactor
infragistics.templating.jsto use the global$.igregistry and hook into the advanced module. - Update tests, build bundles, linting, instrumentation, and i18n for the advanced templating engine.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/templating/tests.html | Include the advanced templating script in the test harness |
| src/js/modules/infragistics.templating.js | Refactor core engine to use $.ig.*, add cache keys and warnings |
| src/js/modules/infragistics.templating.advanced.js | Add new advanced templating implementation for block directives |
| src/js/modules/i18n/infragistics.templating-en.js | Add noAdvancedTemplating localization string |
| build/packages/combined-files.js | Include the advanced module in the combined bundle |
| build/config/templating/jshint.json | Add advanced module to lint configuration |
| build/config/templating/instrument.json | Include advanced module for test instrumentation |
Comments suppressed due to low confidence (2)
tests/unit/templating/tests.html:14
- No unit tests were added to cover the new {{if}} and {{each}} directives provided by the advanced templating engine; please add test cases for these features.
<script type="text/javascript" src="../../../src/js/modules/infragistics.templating.advanced.js"></script>
src/js/modules/infragistics.templating.advanced.js:1
- [nitpick] The new advanced templating module lacks documentation for its public API and usage examples; consider adding JSDoc or inline comments to describe its functions and integration steps.
/*!@license
| if (typeof $.ig._tokenizeDirectives === "function") { | ||
| tmpl = $.ig._tokenizeDirectives(tmpl); | ||
| } else { | ||
| console.warn($.ig._getLocaleString("noAdvancedTemplating")); |
There was a problem hiding this comment.
[nitpick] Warning logic for missing advanced module is duplicated in multiple branches; extracting it into a central helper would reduce repetition and improve maintainability.
Suggested change
| console.warn($.ig._getLocaleString("noAdvancedTemplating")); | |
| $.ig._warnNoAdvancedTemplating(); |
ChronosSF
approved these changes
Jul 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #ISSUE_NUMBER
Additional information (check all that apply):
Checklist:
README.MD