• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

?️We have prepared a lot of new things in HMPL.js for developers!

Sascha Оффлайн

Sascha

Заместитель Администратора
Команда форума
Администратор
Регистрация
9 Май 2015
Сообщения
1,486
Баллы
155
Within a month and a half since version 3, the template language has been expanded with new functionality and ecosystem modules.

All of this is great for web app development because sometimes people make new features and you never need them. It's not entirely correct, but imagine you have a phone and they add a widget or something that you would never put on your home screen. That's not the case here.

Here everything was prepared simply by the most obvious needs.

Well, let's see what's there now!

? Integration with Vite.js


One of the main innovations is the integration of HMPL with Vite.js. Now, you can include a

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

that processes files with the .hmpl extension in your projects.

vite.config.mjs


import { defineConfig } from "vite";
import hmplPlugin from "vite-plugin-hmpl";

export default defineConfig({
plugins: [
hmplPlugin({
memo: true,
sanitize: true,
}),
],
});




It is worth noting that the module is written for esm, since the entire Vite environment, as well as Rolldown and Vue.js, mainly support this.

↪ Nested Blocks


Finally, a month and a half after version 3, we have a full implementation of what is called block-helpers in template engines. We have been working towards this syntax for a year, but now it is simply perfect and will be relevant for many years to come.


<div>
<button class="getHTML">Get HTML!</button>
{{#request src="/api/test" after="click:.getHTML" repeat=false }}
{{#indicator trigger="pending"}}
<p>Loading...</p>
{{/indicator}}
{{/request}}
</div>




It's surprising that the most practical things are the most obvious. Simply, if we have a DOM tree with tags, then the structure should be similar to the tags. A very important change, because now the eye is simply pleased with how it looks in the markup.

?️ Syntax highlighting


Another nice change that concerns the extension for VS Code is that now the syntax of query blocks is highlighted in .hmpl and .html files.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



This is more of a useful change to make the code easier to navigate.

? And a few other changes


These changes include adding support for HTTP TRACE and OPTION methods, bug fixes, improved documentation, updated examples and starter app, and more.

? Fully tested


The test coverage of the entire module is 100%, so this functionality will work with a minimum number of bugs.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



You can view the report with tests on

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

, and the tests themselves are in the

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

folder.

? Feedback


You can write your thoughts about the new features in the comments, it will be interesting to read! Or, there is a thematic

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

for questions and suggestions, there I or someone else will try to answer!

✅ This project is Open Source


So you can take part in it too! This also means you can use it for commercial purposes:

Repo:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


Website:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Thank you for reading ❤!


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.




Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.





Источник:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу