X Tutup
Skip to content

feat(tree-differ): refactor + allow reuse of Funnel's "includeFile" method#1986

Closed
caitp wants to merge 1 commit intoangular:masterfrom
caitp:tree-differ-refactor
Closed

feat(tree-differ): refactor + allow reuse of Funnel's "includeFile" method#1986
caitp wants to merge 1 commit intoangular:masterfrom
caitp:tree-differ-refactor

Conversation

@caitp
Copy link
Copy Markdown
Contributor

@caitp caitp commented May 19, 2015

Some refactoring to make the TreeDiffer api a bit more sane.

Additionally, in order to be able to reuse the Funnel plugin's more complicated
file selection options, without having to compute diffs for many, many unnecessary files,
it is now possible to provide a callback to determine whether a file is to be processed
or not. This filter is run after filename filters, if any, for extra convenience.

For performance, the "shouldBeProcessed" status of a file is cached and need not be computed
more than once.

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented May 19, 2015

@IgorMinar what do you think?

I noticed that one of the things slowing the Funnel port down dramatically, was that the TreeDiffer didn't take Funnel's special filtering procedures into consideration. So this refactoring enables it to do that. There's a memory cost, but it does speed things up a bit (although I'm not sure it's faster than the non-incremental funnel).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

includeFile as a function is a bit misleading since we already have includeExtensions as an array of strings. Maybe call it includeFilter and IncludeFilterCallback or IncludeFilterFn.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking filePathFilter or maybe just filter for brevity?

@IgorMinar
Copy link
Copy Markdown
Contributor

otherwise this looks great. thanks

@caitp caitp force-pushed the tree-differ-refactor branch from 4bb5d61 to 65d9cde Compare May 19, 2015 20:28
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"ignoreFiles callback returns false" => "includeFilter callback returns false"

@IgorMinar
Copy link
Copy Markdown
Contributor

this still looks like a useful change. do we want it despite the funnel challenges?

are there other plugins that could benefit from this?

@caitp
Copy link
Copy Markdown
Contributor Author

caitp commented May 21, 2015

this still looks like a useful change. do we want it despite the funnel challenges?

are there other plugins that could benefit from this?

I'm not sure what else would benefit from it off the top of my head, but it seems likely that others could.

I think it's good to land with the nit addressed

Some refactoring to make the TreeDiffer api a bit more sane.

Additionally, in order to be able to reuse the Funnel plugin's more complicated
file selection options, without having to compute diffs for many, many unnecessary files,
it is now possible to provide a callback to determine whether a file is to be processed
or not. This filter is run after filename filters, if any, for extra convenience.
@caitp caitp force-pushed the tree-differ-refactor branch from 65d9cde to 9ec60b4 Compare May 24, 2015 14:46
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to get #2053 in with some version of the PR I sent you to avoid caching absolute paths here (if you think it's worth caching at all, it doesn't seem unreasonable). This way, there should be roughly one set of cache map transitions on average, and new ones won't need to be created later on

@mhevery mhevery added area: build & ci Related the build and CI infrastructure of the project and removed area: build & ci Related the build and CI infrastructure of the project #development_infrastructure labels May 29, 2015
@IgorMinar
Copy link
Copy Markdown
Contributor

I'm extracting the code from this PR and redoing this PR. I'll keep it open in the meantime.

@IgorMinar IgorMinar added this to the M9: TypeScript and Build Stability milestone May 29, 2015
@mhevery mhevery modified the milestone: M9: TypeScript and Build Stability May 29, 2015
@naomiblack naomiblack added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews state: WIP labels May 29, 2015
@IgorMinar
Copy link
Copy Markdown
Contributor

this is being reworked in #2257

@IgorMinar IgorMinar closed this Jun 2, 2015
@angular-automatic-lock-bot
Copy link
Copy Markdown

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews area: build & ci Related the build and CI infrastructure of the project cla: yes state: WIP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup