Laf Assistant: Cloud development has never been easier!

Original link: https://forum.laf.run/d/67

If a worker wants to do a good job, he must first sharpen his tools. IDE is also indispensable for us when writing code. It allows us to complete code writing more efficiently and improve development efficiency. Therefore, an IDE is one of our closest companions in writing code.

Although Laf cloud development is simple Web IDE, as long as you can open a browser, you can edit cloud functions anywhere.

But many people still want to be able to write cloud function code in the IDE.

Thanks to the development of laf-cli and the open API, Laf does not have any mandatory requirements for local code editors, which means that Laf can directly use or VS Codeany editor to complete the writing and debugging of cloud functions, as well as release and update.

laf-cli is an npm module, which can complete the cloud function management and cloud storage management of Laf cloud development through the command line. Using the command line, I wrote a VS Codeplugin: laf assistant

Laf's experience of using VS Code directly is not so perfect

VS Code is a free, open source, cross-platform code editor developed and maintained by Microsoft, with rich plug-ins and powerful functions. And a very important reason is that I am used to using VS Code. There are also quite a few developers who are also accustomed to using VS Code like me.

laf assistantI tried the Laf-cli module for a while before it came out . Every time a piece of code is modified, when debugging is required, more complex commands need to be entered.

For example, the cloud function name is: BatchTestDB, then I need to enter on the command line:laf func exec BatchTestDB -l 9

To switch cloud functions, you need to manually change the command. When a large number of logs appear, the experience is like this.

Another troublesome problem is that the content output in the terminal cannot be edited or folded . It is also very painful to view the log when outputting relatively large JSON data. At the same time, after a period of debugging, the content of the terminal will become more and more dazzling.

When it comes time to publish cloud functions, it can only be done by manually modifying the command line .

However, the debugging, release and management of cloud functions developed by Laf Cloud Web IDEwill obviously be more convenient and simpler than this method. Web IDEIn order to perfectly combine the excellent advantages with local development. I moved the idea of ​​developing a VS Code plugin .

Laf assistantcoding experience

In the edit box of the cloud function, click the right button to publish, download or run the cloud function. Combined with the key change function that comes with VS Code, for example, I changed the key to run the cloud function to ⌘+F1. After each modification Cloud function, after saving the cloud function, press the shortcut key ⌘+F1 to run the cloud function.

I output the log into a brand new text, which can be edited and folded at will, making it more convenient to use. If you need to save it, you can also save it directly to a file. Of course, you can also close the editor and discard the log content.

Code version management and collaboration

The Web IDE developed by Laf Cloud has no code system and version management. Web IDE does not save all the modified versions, but only exists in the local cache of the browser, which means that if you accidentally clear the cache or switch browsers, the draft in the Web IDE editor may disappear. At the same time, if the developed project requires multi-person collaboration, it will be quite troublesome.

In my opinion, Web IDE is suitable for rapid development and online release of simple cloud functions, as well as temporary code modification. If you encounter complex code situations, it is difficult to compare with the local development experience of VS Code.

At the same time laf assistant, the front-end code and the Laf cloud function code can be managed in one project, so as to realize the management of all front-end and back-end codes in one project. Moreover, the Web IDE cannot search the code, and if the codes of the front and back ends are all in one project, it is very convenient to search the codes in the front and back ends globally.

Combined with the use of Git, it is very convenient to implement code version management.

In addition, if collaborative development is required, laf assistantit is also supported to separately configure the Laf API address and Laf application Appid for the same project on different computers. Each developer can debug and develop in his own Laf application. When the code is released online, it can be published to Formal application. The contamination of test data is avoided.

laf assistantfollow-up upgrade plan

1. AI blessing

At present, the interface has been basically realized, and the cloud function code that can be directly used or simply modified can be written through a text description, and if you can’t write a certain JS or a certain database syntax, you can use a sentence to finish

Follow-up in VS Code, you only need to click the mouse or shortcut keys to automatically complete the cloud function code through AI.

2. Increase the management of cloud storage

The locally compiled front-end code can be hosted in Laf's cloud storage with one click.

3. Cloud functions will add more debugging modes

Parameters for custom debugging. In the future, real-time log monitoring will be added to facilitate the viewing of logs during front-end debugging.

4. Independent management panel

Click the Laf icon on the sidebar, and the content related to Laf cloud development will be displayed here.

5. More detail optimization

All developers can also give me optimization suggestions to make it laf-assistanteasier to use and make cloud development more refreshing!

Guess you like

Origin blog.csdn.net/alex_yangchuansheng/article/details/130574636