Small program development framework after about two years of iteration, the development of more and more mature and perfect, regardless of the framework level or development tool level, experience has risen to a level, take the opportunity of “Baby Growth Assistant” project, summarize the status quo of small program development at this point in 2019.
Project background
Do treasure to dad nearly a year, will take some effort to adjust the knowledge structure, pay attention to infants and young children grow up, now baby in nutrition surplus side is more and more common to the obvious “rich” baby, is to children what is fat what is thin, in order to have a reliable authority standard to measure the growth of the child health, I have checked the infant growth standard provided by the World Health Organization, which provides the distribution proportion information of height, weight, BMI (measuring fat and thin) and other indicators of infants under 5 years old in the unit of day. That is to say, any number of days can check the height, weight and BMI values that are most consistent with the law of healthy growth. It can also find the position of the current growth data of the baby in the overall sample base, so as to measure the growth state of the baby and assist in correcting the feeding problems of the baby.
After a week of development, the initial version is now online, welcome to scan code experience.
The overall feeling
Two years ago, when the small program was just launched, IT was also my first contact with small program development. At that time, I did a DEMO project aimlessly and wrote a “Small program Guide”, the content was very superficial. I thought that after two years of rereading the small program development document, there would be a lot of “hard goods”, but there was no. Compared to two years ago, the biggest change is the small program framework introduced the components and plug-ins two concepts, greatly promoted the development of the small program experience, but in the eyes of the more familiar with modern front-end framework developers, these are already time-tested best practices, no defects is a small program, with is natural, so this is not a surprise.
In addition, the entry to the applets plug-in library is a bit too deep, not on the document’s level 1 navigation, and not integrated into the development tools, which is a bit strange.
There are five points that really impress me.
- The real preview and debug features of the development tool are extremely useful and are exactly as expected. Since I hadn’t followed the iterative process of this feature before, it was a big shock to me. It was amazing to go from 0 to 100 in one step.
- The new Applets Development Guide is well worth reading to help improve your understanding of the overall technical architecture of applets and reduce some of the pitfalls.
- Nice animation API. Animation API is actually the syntax sugar of CSS animation, the purpose is to make CSS animation programmable, is a very good function, the use experience is mediocre, not good, not bad.
- It’s in the interest of developers and users. Some changes of the small program framework are very intentional, such as the addition of several open ability components, developers can show the basic information of users in the case of not authorized login, many do not need the user system, just want to show the user’s avatar business, finally have the right way to achieve; For users, basic information is not available to developers, reducing meaningless licensing and win-win.
- The paradigm of no back end development – small program cloud development. The definition of small programs for developers never just programmers group, but including product managers, designers, and even middle school students, all the people who need to develop a small program, so little more iteration more simple application development framework, and with cloud development, can say really did anyone can learn by simple small program to develop a fully functional. This point will be expanded separately.
Applets cloud development
Small program cloud development is officially launched by wechat without back-end development services. The posterior end of the development mode is not a new thing, even the word after three to five years of development have been some gas, is not known, but the posterior to the thoughts and experience of some typical reflect incisively and vividly, in the small program cloud development detail place and with the right combination of business, other than I know before the posterior end of the service, small program cloud development gave me the feeling is like: A man who had never touched a piano played Chopin in the first place.
In fact, no back-end can be simply summed up as database, storage space, computing power (cloud function) and the package lease of their operation and hosting services. Simply put, it is a very simple thing, and these several things are organically integrated by small program development tools, but it shows a new vitality.
Cloud development is provided by the relational database, but in the document from the beginning to the end you couldn’t see the words non-relational, only a few simple example, it can understand this thing how to use, the rest of the many don’t even have to see the document, just wait to use it to check, simple business on small program can realize database to add and delete; Storage space does not say, originally simple, integration into the cloud development API is as always simple to understand; Cloud function was nearly a year or two out of new things, BAT, three cloud services are doing for a long time I don’t understand the function of cloud and I $50 per year of ali cloud than what’s the advantage of the virtual machine, but such a thing were integrated in small program after the user authentication, it has become the artifact, the document, copy paste the sample code, simple steps can realize the user login; Combining database and storage services, as long as not too complex business can be handled by cloud functions. Cloud functions use Nodejs language, I really can’t think of small program development where can also use the back end, so I say that small program cloud development is the model of backendless development, is the best practice of the integration of backendless technology.
This echoes zhang’s view of technology in a recent annual speech to the effect that its value lies not in the technology itself, but in the right application scenarios. In fact, in the video dynamic function of wechat 7.0, the video soundtrack uses AI technology to match the background music. If you haven’t used this feature, I suggest you try it now. My personal feeling is that it’s done exceptionally well, even better than many marketing powerpoint presentations that boast AI as a gimmick. The first few pieces of music I push are usually matched by AI, because I often shoot my son. I find that the music I push can be matched with the content of the video in terms of emotional type. Whether it is cute, dynamic or funny can be accurately judged, which is very important and can enhance the emotional expression of the video. Make a video that wasn’t fun that much fun; Then, the rhythm of the music can also match the actions of the characters, and sometimes the rhythm can even match the mouth movements of the characters. The final effect is that I often feel that the background music has become the finishing touch of the dynamic video, which is probably only experienced by myself can know how great it is. The application of AI technology is so good, but the wechat team has never been publicly mentioned, and people who have not even seen Zhang Xiaolong’s speech may never know this small function in wechat, in fact, the use of the most cutting-edge AI technology, and perfect.
Some regret
Despite all this, there are still some regrets, mainly four.
- Canvas applications are limited. The project I am working on this time involves data presentation. I originally hoped to draw with canvas, but canvas is a native component and renders independently from webView. As a result, there is an exception when I use it with swiper component, which shows that the TAB slides but the canvas in the TAB does not move. The final solution is to draw it on canvas first, then save the screen and process it into a background image. There is no way, because my PHOTOSHOP level can’t draw the effect I want.
- The official community is still not ideal. Seems to be active can be ignored so a little bit, but in general, the accumulation of the number of questions is not enough, often can not search out the problem, and the development of the problem if you wait for the official reply to you, it is estimated that the answer will make you more angry, not as efficient as Baidu down. There is also an obvious flaw in the search function of the community. The magnifying glass behind the search input box cannot be clicked, and the search results can only be entered through the enter key. It is hard to imagine that this community is made by the wechat team.
- There are still some aspects of the development document that are not detailed enough, such as some interfaces of canvas and some interfaces of file operation, how to say, you will have a feeling of not understanding how to read when you do not understand, and then look at the feeling of “Oh that’s what it means” after you understand it.
- The performance of the development tool is not very stable. During the development process, I find that the performance of canvas drawing and file operation is sometimes inconsistent with that of the real computer, and then I don’t know when to look again, it is inexplicably normal, which is wonderful. Then there’s the age-old problem of editors that don’t work well and have stupid bugs, and when you right-click a piece of code on a small laptop, the selection disappears and the code scrolls on the web one line or so.
About cross-platform development frameworks
I noticed recently that there is a cross-platform development framework that can unify the various front-end development platforms including applets. The front-end version can be “developed once, run everywhere”. The advantages are obvious. If the requirements require both a small program and an H5, and the business is exactly the same, then the code can be reused 100%, perfect.
But I don’t like this kind of technical architecture, I prefer to use the most direct way to develop the target platform, first of all, the framework of the small program itself to the current extent, is available, I think teasing the development experience is to nitpick bones. Even considering the code reuse, I don’t think a set of code at the same time run on small programs and H5 is a kind of good technical architecture, because my experience is that each platform has its own characteristics of the business, will produce different business requirements, with the passage of time, they will become something different, by that time want to get rid of this framework, The cost is probably at the refactoring level.
And the packaging itself will bring a lot of problems, need to follow up platform update, need to continue to wipe flat differences, you can save time to code reuse and cover the maintenance cost, may be I haven’t met the right scenario, I can only think of to do outsourcing use the compare save trouble, anyway, do not need their maintenance follow-up, really don’t think the other situation.
The last
Limited by this small program project is relatively simple, this experience is not comprehensive and in-depth, summarize the above points, generally speaking, small program has done particularly well, good development experience, other details later have the opportunity to further experience it.
Front-end road original technical article, reproduced please indicate the source: refined-x.com/2019/02/25/…
Unwilling to mediocre you, come to charge with me, pay attention to the scenery, get more wonderful content.