[Translation] When node. js encounters webmatrix 2

Source: Internet
Author: User
Tags install node website performance joyent css preprocessor
    • Preface
    • Body
    • How far have we been
    • Enter webmatrix 2
    • Node. js smart sensing
    • Support for Jade and ejs
    • Best less editor on the planet
    • Coffeescript Editor
    • Mobile Simulator
    • Expansion and Open Source
    • Participate
    • Original
    • Attachment (English-Chinese)

Now, node. JS is in full swing. Undoubtedly, it breaks through a thick layer of paper on the client and server, so that the front and back ends can complete a complete Web application only through the Javascript language.ProgramHowever, there has never been a complete set of nodes. JS development tools that enable node. JS promotion is slow, and the usage in actual projects is relatively low. Most of them are stuck in the experiment and gadgets stage. Webmatrix is Microsoft's latest web development tool. It contains all the elements required to build a website. You can start with an open-source web project or built-in web template, or directly writeCode. Simple and completely free, so that the development site has never been so simple (for more detailed information about webmatrix, go here ). With the upgrade of the webmatrix version and the popularity of node. JS, it also strengthened its support for node. js and related technologies.

Reprinted please indicate Source Address: http://www.cnblogs.com/aNd1coder/archive/2012/06/17/2552037.html


After several months of efforts by the webmatrix team, we are excited to introduce the candidate versions of webmatrix 2. Webmatrix 2 contains a large number of new features, but today I want to outline what we have done to create an application with node. js under webmatrix 2.
If you want to skip this article and just want to get the download connection (free of charge), click here.

How far have we been

Less than a year ago, I worked at Carnegie Mellon University and tried to use node. js and ASP. NET to implement real-time components in our online learning environment. The data center of our customers running Linux does not work, and it is not ideal to run a production system in cygwin. It is more difficult to develop node on Windows
-If you want to run node, it is almost impossible for NPM to work. Using node in Windows is more difficult than hiking.

In the past 12 months after I joined Microsoft, we have seen various partnerships between joyent and Microsoft. The new versions of node and NPM are supported on Windows, and the commitment to support node on ipvs azure. We work together to build a better user experience for developers, IT administrators, and end users who use our systems.

One of the achievements of these work is that the Application Experience built with node. js on Windows azure has been greatly improved. In the SDK team's Glenn Block, Microsoft was highly praised for its incredible initiatives, making Azure A great environment for developers to develop node. js applications. As our favorite vice president Scott
Guthrie said on his blog that (these) meet the requirements of the new windows azure.

Enter webmatrix 2

Using node. JS is a relatively simple task. Install node and NPM (now packaged in the node installer). You can start with your favorite text editor. However, when you manage projects, compile coffeescript and less, configure product settings, and publish applications, there are various possibilities and configurations (tedious ). Webmatrix
2. provide another method for building node. js applications: you only need to build excellent applications in one environment.

Webmatrix 2 is designed to build Web applications first. On the initial screen, you can use premade templates or install Common Open Source applications from Web gallery to create your tenant applications. Currently, the template supports node. JS,
PHP, of course, also includes ASP. NET web pages to create applications. In addition, webmatrix 2 contains three templates for creating node. js applications:

    • Empty node. js site
    • Express site
    • Node starter site

The empty node. js website provides some basic examples of using HTTP server, which is consistent with the official website of nodejs.org.

Express website is a basic application generated by using node. js's express framework scaffolding tool.

Starter website starts a project based on the express MVC basic project template. The sample file is hosted on GitHub to demonstrate how to implement a site that contains the jade parent/child layout, less pre-compiled CSS, Twitter and Facebook logon, mobile layout, and verification code. When you use any of these templates to create a new application, webmatrix
2. Make sure that node, NPM, and iisnode are installed in your system. If they are not installed, webmatrix 2 will automatically install any missing dependencies. This feature is particularly useful if you are creating a PHP/MySQL application in windows.

The node starter website template will generate a chat that includes express, Jade, less, socket. Io, login using everyauth, and jquery
Mobile supports full-featured apps for mobile devices:

Node. js smart sensing

One goal of webmatrix 2 is to lower the threshold for developers to start using node. js. One way is to provide intelligent sensing of the core modules built by all applications. The document we used is actually built from the official node. js website.

In addition to providing intelligent awareness of node. js core modules, webmatrix 2 also provides Automatic Code Completion for your own JavaScript code and third-party modules installed through NPM. There are several ways to build your own applications. The NPM Gallery has more than 10000 entries recently. When developers start to build more complex applications, it will become very difficult (or even scary) to start. Webmatrix
2. Make it easier to use open-source packages:

Support for Jade and ejs

To provide more practical tools for creating node. js applications, we decided to provide a first-class editing experience for Jade and ejs. Webmatrix 2 provides syntax highlighting, HTML verification, and Code outline for Jade and ejs and is automatically completed.

If you type code containing angle brackets (ejs code block), The ejs experience will be better, because it is based on our advanced HTML editor:

Best less editor on the planet

So I admit-I have a little bit of CSS Preprocessor geeks. I don't write CSS because I love it, but because I need to do a good job, I have to write as little CSS code as possible. Tools such as less and sass provide missing features for CSS programmers, such as variables, INS, nesting, and common built-in methods.

The webmatrix less editor not only provides syntax highlighting, but also provides less specification verification, variable and mixed smart sensing, and less standard formatting. Many node developers use the NPM module on the server to process their less, but if you want to locally compile less, you can use orange during design.
Bits compiler to compile your CSS.

Coffeescript Editor

Similar to less and sass, coffeescript simplifies JavaScript writing. Webmatrix 2 provides syntax highlighting, Code outline, and automatic completion to simplify the editing experience. If you want to use coffeescript but do not need to compile it on the server, you can use orange during design.
Bits compiler to compile your coffeescript

Mobile Simulator

The design of mobile applications cannot lag, and webmatrix 2 tries to make these two methods easier. First-the visual template makes full use of the advantages of the responsive layout in the main style sheet (taking node starter template as an example:

Styles. Less

This seems awesome if you don't need to change the content of your website, but there is a lack of complicated scenarios. To bypass it, the node start module uses a connection middleware to detect whether users are from mobile devices and then sends them
Mobile's mobile layout (this article will introduce in detail). You can create a {viewname} _ mobile. Jade view based on a single view Convention and load it only on mobile devices.

What's more powerful is, if you need to view your website performance on a variety of browsers and mobile devices? Webmatrix 2 provides an extension model that allows you to add mobile and desktop browsers in the running menu.

Currently, we provide Windows Phone simulators and iPhone/iPad simulators. We are all looking for people to support other simulators * cough * Android * cough *, and even build a bridge to facilitate online testing applications.


Expansion and Open Source

A code editing tool is only critical to developers dedicated to the platform. We want to succeed and grow together with everyone. As part of our goal, we open up a scalable model that allows developers to build custom extensions and share them with other developers. The extension library is accessible through a http://extensions.webmatrix.com. We plan to transfer most of the extensions to GitHub, and nodepowertools expansion is the first open source plan:

    • Node Power Tools
    • Orangebits Compiler

In the next few months, you will be able to see more extensions and open source on the Microsoft official website.


I would like to ensure that I would like to thank all those who helped this version, including the webmatrix team, the Glenn Block, the cldio caldato, And the our node advisory.
Board, Isaac schlueter, and everyone in joyent.
For more information, visit:

    • Webmatrix on Microsoft.com
    • Webmatrix on Twitter
    • Webmatrix on GitHub
    • Webmatrix on uservoice
    • Webmatrix and node on Microsoft.com
    • Windows azure just got a lot friendlier to node. js developers
    • Vishal Joshi's blog post


Attachment (English-Chinese)

When node.js is uploaded to webmatrix2.rar


Note:Due to the limited level, some areas may not be properly translated, and errors may inevitably exist. Please comment and point out that you may find it useful -,-






Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.