Widgets can now specify a template which is precompiled using Glimmer's
AST and then converted into our virtual dom code.
Example:
```javascript
createWidget('post-link-arrow', {
template: hbs`
{{#if attrs.above}}
<a class="post-info arrow" title={{i18n "topic.jump_reply_up"}}>
{{fa-icon "arrow-up"}}
</a>
{{else}}
<a class="post-info arrow" title={{i18n "topic.jump_reply_down"}}>
{{fa-icon "arrow-down"}}
</a>
{{/if}}
`,
click() {
DiscourseURL.routeTo(this.attrs.shareUrl);
}
});
```
|
||
|---|---|---|
| .. | ||
| benchmarks | ||
| bulk_import | ||
| import_scripts | ||
| .gitignore | ||
| alice.txt | ||
| bench.rb | ||
| check_forking.rb | ||
| compile_hbs.rb | ||
| diff_heaps.rb | ||
| discourse | ||
| docker_test.rb | ||
| measure.rb | ||
| memstats.rb | ||
| micro_bench.rb | ||
| osx_dev | ||
| profile_db_generator.rb | ||
| pull_translations.rb | ||
| rails | ||
| redis_memory.rb | ||
| require_profiler.rb | ||
| test_email_settings.rb | ||
| test_mem.rb | ||
| test_pretty_text.rb | ||
| user_simulator.rb | ||
| version_bump.rb | ||