Skip to content

rewrite broccoli-replace plugin to be incremental #2050

Closed

Description

@IgorMinar

currently we use https://github.com/outaTiME/broccoli-replace in both browser and node tree

this plugin is accounting for 600-700ms during full build and 400-500ms during incremental rebuild.

if you look at the replacements we are doing they are fairly simple and can't cause us to waste that much time.

we should try to reimplement the plugin (with only the features we actually need) in plain javascript without any additional templating libraries. a few regular expression replacements should do the trick. the plugin should be implemented as a DiffingBroccoliPlugin

api compatibility would be nice, but is not required. example usage:

  nodeTree = replace(nodeTree, {
    files: ['**/test/**/*_spec.js'],
    patterns: [
      {
        // Override the default DOM adapter with Parse5 for all tests
        match: /"use strict";/,
        replacement:
            "'use strict'; var parse5Adapter = require('angular2/src/dom/parse5_adapter'); " +
                "parse5Adapter.Parse5DomAdapter.makeCurrent();"
      },
      {
        // Append main() to all tests since all of our tests are wrapped in exported main fn
        match: /$/g,
        replacement: "\r\n main();"
      }
    ]
  });

Activity

  1. added this to the milestone on May 21, 2015
  2. IgorMinar commented on May 21, 2015

    @IgorMinar
    ContributorAuthor

    watch out for #2051 as that might bite you, see #2053 for a patch or use stew.mv trick as we currently do (removed in #2053)

  3. modified the milestones: , on May 29, 2015
  4. added a commit that references this issue on May 29, 2015
    4d30f66
  5. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  6. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions