Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lifeart/ember-cli-template-trimmer
Ember templates trimmer ast transform
https://github.com/lifeart/ember-cli-template-trimmer
Last synced: 25 days ago
JSON representation
Ember templates trimmer ast transform
- Host: GitHub
- URL: https://github.com/lifeart/ember-cli-template-trimmer
- Owner: lifeart
- License: mit
- Created: 2019-06-29T18:53:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T20:59:09.000Z (almost 2 years ago)
- Last Synced: 2024-10-02T12:21:10.336Z (about 1 month ago)
- Language: JavaScript
- Size: 5.6 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-ember - ember-cli-template-trimmer - This addon removes newlines on compile stage. (Packages / Minifiers)
README
ember-cli-template-trimmer
==============================================================================This addon removes newlines on compile stage, for cases like this:
```hbs
```
to this:
```hbs
```
\* any text nodes inside ``, `` will be saved.
\** single space nodes will be saved.
\** text nodes having text + (newlines || spaces) will be saved
---
# why?
---
this reduces `glimmer-vm` opcodes count, memory usage, and increase final rendering/rerendering speed.
---
Bonus:
```hbs
{{#if false}}
this dead block will be removed at all
{{/if}}
```\* This addon DON'T modify nodes (including text content), it only remove matched.
Stats fom one of my projects (gzipped results):
`template-trimmer`: 150.42 `->` 144.92 `kb` \
`ember-hbs-minifier`: 150.42 `->` 144.96 `kb` \
`template-trimmer` + `ember-hbs-minifier`: 150.42 `->` 144.71 `kb`---
Can I use it with [ember-hbs-minifier](https://github.com/simplabs/ember-hbs-minifier)?
- Yes---
Compatibility
------------------------------------------------------------------------------* Ember.js v2.18 or above
* Ember CLI v2.13 or above
* Node.js v8 or aboveInstallation
------------------------------------------------------------------------------```
ember install ember-cli-template-trimmer
```Usage
------------------------------------------------------------------------------[Longer description of how to use the addon in apps.]
Contributing
------------------------------------------------------------------------------See the [Contributing](CONTRIBUTING.md) guide for details.
License
------------------------------------------------------------------------------This project is licensed under the [MIT License](LICENSE.md).