New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(change_detection): make INTERPOLATE_REGEXP customizable #7417

Merged
merged 1 commit into from May 26, 2016

Conversation

Projects
None yet
5 participants
@lacolaco
Contributor

lacolaco commented Mar 4, 2016

  • Please check if the PR fulfills these requirements
  • The commit message follows our guidelines: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit-message-format
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
    Feature
  • What is the current behavior? (You can also link to an open issue here)
    The pattern for interpolation is not able to modify. INTERPOLATE_REGEXP is a variable and is referred in Parser directly.
  • What is the new behavior (if this is a feature change)?
    Add new public api, INTERPOLATE_REGEXP, which allows us customize interpolation regexp pattern. (for Python Jinja and more template languages).
    Similar api is in AngularJS as $interpolateProvider.

And Parser takes the pattern for interpolation from DI.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    Parser constructor required new parameter interpolateRegexp as second argument.
  • Other information:
    Close #7305
@@ -63,7 +62,8 @@ export class Parser {
_reflector: Reflector;
constructor(/** @internal */
public _lexer: Lexer, providedReflector: Reflector = null) {
public _lexer: Lexer, @Inject(INTERPOLATE_REGEXP) public _interpolateRegex: RegExp,

This comment has been minimized.

@tbosch

tbosch May 26, 2016

Member

The compiler should not be configured via DI but rather via a new field on CompilerConfig (a new class that replaces ChangeDetectorConfig once you rebase).

@tbosch

This comment has been minimized.

Member

tbosch commented May 26, 2016

Need a rebase as well.

@lacolaco

This comment has been minimized.

Contributor

lacolaco commented May 26, 2016

I've rebased but then new feature's tests were dropped.
I'll add tests in parser_spec.ts.

@lacolaco

This comment has been minimized.

Contributor

lacolaco commented May 26, 2016

New approach: CompilerConfig.interpolateRegexp as new constructor optional argument.

new CompilerConfig(true, true, true, null, /<<([\s\S]*?)>>/g)
feat(change_detection): make INTERPOLATE_REGEXP customizable
BREAKING CHANGES:

`Parser` constructor required new parameter `config: CompilerConfig` as second argument.

@mhevery mhevery merged commit c3fafa0 into angular:master May 26, 2016

2 checks passed

cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details

vicb added a commit to vicb/angular that referenced this pull request Jun 2, 2016

Revert "feat(change_detection): make INTERPOLATE_REGEXP customizable (a…
…ngular#7417)"

This reverts commit c3fafa0.

The symbols should be configured at the component level and not be global to the compiler.

tycho01 added a commit to tycho01/angular that referenced this pull request Jun 10, 2016

Revert "feat(change_detection): make INTERPOLATE_REGEXP customizable (a…
…ngular#7417)"

This reverts commit c3fafa0.

The symbols should be configured at the component level and not be global to the compiler.

tycho01 added a commit to tycho01/angular that referenced this pull request Jun 21, 2016

feat(change_detection): make INTERPOLATE_REGEXP customizable (angular…
…#7417)

BREAKING CHANGES:

`Parser` constructor required new parameter `config: CompilerConfig` as second argument.

tycho01 added a commit to tycho01/angular that referenced this pull request Jun 21, 2016

Revert "feat(change_detection): make INTERPOLATE_REGEXP customizable (a…
…ngular#7417)"

This reverts commit c3fafa0.

The symbols should be configured at the component level and not be global to the compiler.

@lacolaco lacolaco deleted the lacolaco:laco-inject-interpolate-regexp branch Jul 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment