Попробовал, наконец, разработку на Blazor. Это такой фреймворк под .NET, который позволяет писать фронтенд на C#. Работает он двумя способами: либо собирает весь проект в WebAssembly, и бедный пользователь грузит себе мегабайтную dll, либо устанавливает клиент-серверное соединение через SignalR и шлёт клиенту информацию об обновлённых DOM-элементах.
Вот вторую то я и пробовал. Казалось бы — каждое нажатие кнопки требует отправить на сервер запрос и получить ответ. Никогда такого не было! Но субъективно разницы во времени отклика нет (потому что веб и так достаточно медленный, хаха).
Фронтенд-часть пишется очень похоже на JSX: вёрстка реактивно вперемешку с кодом. Когда-то я очень ругал React за такой подход, потому что каша. Но нетипизированный JS по-умолчанию каша, а здесь же по факту получается очень удобно: статический анализ не даёт тебе делать ошибки и писать ерунду.
Но приятный полноценный язык программирования вместо JavaScript это лишь вишенка на торте. Самое крутое — вся сила серверного кода с полноценной возможностью обращения к базе данных, шеринг моделей данных между сервером и клиентом, и, наконец, Dependency Injection любого серверного модуля в «клиент»! То есть вы не просто пишете одно приложение вместо двух, вы ещё и получаете отсутствие ошибок при каком-нибудь изменении моделей API, когда сервер стал отдавать не то, что ожидает клиент. Вам вообще теперь не нужен API, достаточно закодить нужную функцию на серваке и инжектировать её в нужный фронтенд-модуль.
Это супер удобно, супер быстро, супер устойчиво к ошибкам. Теперь не хочется возвращаться даже на вполне крутой Vue 3. Но, система пока новая, она не обросла решениями от комьюнити, а браузерный API всё равно придётся дергать через JavaScript Interop. Для совсем кайфа нужно подождать годик, поскольку развитие идёт довольно быстро. Например, там нет очень нужного в таком деле hot reload, но в .NET 6 он уже анонсирован, и вроде как есть в превью, а релиз в ноябре.
#dev
#Oman🇴🇲
This oasis is called Vadi Bani Khalid and is one of the main attractions of the country. The Vadi landscape is striking in its diversity: here you will find both green oases with palm trees, and arid canyons with colorful cliffs. Picturers palm groves, transparent lakes and hills made of soft, golden sand. This place seems to invite us to plunge into an oasis of calm and harmony with nature.
🇮🇷🇴🇲According to an Associated Press report, Iran and Oman will collect tolls from all ships transiting the Strait of Hormuz during the two‑week ceasefire.
✍️ Recall Oman’s stance during the treacherous American attacks on the port of Salalah. Oman position and congratulate for the elect of new Iran's supreme leader so infuriated Trump that he even insulted the Sultan of Oman. Among the Arab nations, Yemen (Sana’a government) and Oman stood on the right side and did not bet on the losing horse! The current state of the UAE, Bahrain, Saudi Arabia, Kuwait, and Jordan is a testament to the wisdom of Omani policy.
#Iran#Oman
🇮🇷🤝🇴🇲 A new protocol has been finalized by Iran regarding the Strait of Hormuz and has been communicated to the IRGC Navy for implementation. This new protocol is based on the assumptions that, firstly, Iran’s enemies have no right to use the strait, and secondly, Iran must secure and compensate for all damages it has suffered through the strait.
👉Oman has agreed to cooperate with Iran’s new protocol in the Strait of Hormuz.
#Iran#Oman
🇮🇷🇴🇲Iran's Khatam al-Anbiya Central Headquarters: The Salalah port incident is suspicious
🔹The spokesperson for the Central Headquarters of Khatam al-Anbiya (PBUH), in response to the suspicious attack on Salalah port in Oman, said:
"The incident that occurred at Salalah port in the friendly, neighboring, and brotherly country of Oman appears very suspicious. The Islamic Republic of Iran is investigating this matter. The security and national sovereignty of Oman are respected by the Armed Forces of the Islamic Republic of Iran."
✍️ As we have said before, Iran has no intention of attacking civilian sites, and if it did, human casualties and financial damages in Arab countries would be unimaginable. The attack on Oman, which is considered a friend of Iran, is also very suspicious. Salalah port is also very far from southern Iran in terms of distance, and there is a possibility that this port was attacked by American drones. The U.S. is under pressure and spares no action against Iran!
#Iran#Oman
🇮🇷#Iran - 🇴🇲#Oman: Two alleged Iranian drones have struck Salalah Port in Oman, damaging port cranes. The Omani government has released a statement condemning the attack, stating that one port worker was “moderately injured.”
🇨🇳🇮🇷🇴🇲China urges Gulf states to unite against external interference amid widening conflict
China's foreign minister urged Gulf countries to unite to oppose external interference on March 2, after US-Israeli attacks on Iran triggered a widening conflict in the region.
China hoped that the Gulf states would strengthen unity and develop neighbourly friendship to "keep their future and destiny in their own hands", Chinese Foreign Minister Wang Yi said in a phone call with his Omani counterpart, according to a statement released by the ministry.
In a phone call with Iranian Foreign Minister Abbas Araqchi on the same day, Wang said he believed that Iran could maintain national and social stability as well as attach importance to the legitimate concerns of its neighbours, a separate statement showed.
#China#Iran#Oman
@asianomics
🇮🇷🎙Leader of Iran: The attacks in Oman and Turkey are not Iran's doing.
✉️ Seyyed Mojtaba Khamenei, the Leader of Iran, stated in this year's Nowruz message:
"I point out that the attacks which took place in Turkey and Oman—both of which have good relations with us—against certain locations in these countries were by no means carried out by the armed forces of the Islamic Republic or any other forces of the Resistance Front. "This is a deception employed by the Zionist enemy using the false flag tactic" to sow discord between the Islamic Republic and its neighbors, and it may also occur in some other countries."
#Iran#Oman#Turkey