dotnet / dotnet/templating

Improve processing of different file formats when generating content

Open
#5,788 1 comment 0 reactions 0 assignees View on GitHub
area: content-generation area: performance Priority:2 triage:transfer-to-sdk triaged
Dominant language
No language data
Stars
1.7k
Forks
399
Avg merge
3d 5h
Merged PRs (30d)
39

Description

### Background

Now, when processing the files template engine treat all the files (unless specified as `copyOnly`) as:
- textual
- trying to perform replace and other operations
This causes performance issues and accidentally errors when generating the content when the content of the file matches the replacement.

### Suggestion
Improve detection of the file format and the rules upon that.
Not limited to:
- enrich the defaults for "copy-only", for example in web templates libs are often included, etc
- if the file is detected binary, do "copy-only" mode by default
- if the file is well-known textual type, process operations in it

Ways for detection:
- probe first bytes to detect binary template
- https://www.nuget.org/packages/EmptyFiles

Consider same rules in template testing framework for scrubbing.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.