VueJS Development

Third Rock Techkno is a highly-valued VueJS development company. We are a leading IT services company with a strong focus on client success. We develop robust and real-time apps using VueJS framework. Third Rock Techkno is duly committed to integrating the latest technology into all our client-based solutions.

Vue js is a popular js framework used in developing frontend technology for web apps. It is a progressive open source js framework aimed at creating user interfaces. It is a highly adaptable framework which can be easily integrated with other js libraries. These features make it a popular choice in web app development.

Our VueJS Services

  • 1. Custom Applications Development
  • 2. Single Page Application Development
  • 3. Third-Party Integration with Vue.JS
  • 4. Vue.JS Consulting
  • 5. Support and Maintenance

Our Existing Clients

We cater to a diverse clientele spanning across various industries.

Why Choose Us As Your VueJS Development Company

Experienced Developers

Our highly-qualified VueJS development experts specialize in building customized, creative and highly-interactive web and mobile applications. Whether you are a startup or an SME, our experts will get the job done.

Trusted Delivery Methods

We employ agile methodology to keep you in the loop. We focus on delivering solutions that meet your business goals, timeline and budget.

Competitive Rates

We offer the most competitive rates on the market. Our personalized services meet different budget needs of our clients from across the globe.

Transparent Work Approach

We ensure complete project visibility right from the time you approach us with your needs. We use email, phone, Skype, Slack, and other mediums for regular communication with our clients.

Customer Satisfaction

Our designers, developers, quality analysts, and a project manager – all strive for customer satisfaction. We deliver VueJS development services that align with our clients’ needs.

Client Testimonials

Our WORK speaks louder than our WORD. Find out how we helped clients overcome challenges and succeed.

Smoovr

Very good communication at all stages. Always prompt to reply. Excellent quality of work. The team at Third Rock Techkno was communicative, responsive, and accommodating as they produced high-quality work.

Jonathan Wood, Smoovr

Ontime

It was a pleasure working with the TRT team. Prior to contracting this group, I had a system created that was absolutely terrible and poorly developed. I also worked with a few freelancers that couldnt cut it either. TRT was actually able to execute on our concept and have built a truly solid system for our company.

Karl Pierre, Ontime

Benefits Of VueJS Development

Compact and Lightweight

VueJS is a more compact and lightweight version in comparison to other js frameworks. Since the size is a marker for a js framework’s success, VueJS scores full marks in this aspect.

Simplified App Development

Both large and small web templates can be developed with VueJS. The simple structure lets developers work on different projects and assure completion in a timely fashion.

Comprehensive Documentation

Any framework with detailed documentation makes the developer’s job easy. In enables them to develop applications by simply referring to the documentation. Developers with knowledge about HTML and JS can work very well with VueJS.

Flexibility in Integration

VueJS has components that enable developers to integrate it with existing applications within the js framework. With VueJS, developers can develop new apps as well as modify older ones.

Cross Component Communication

The MVVM architecture of VueJS simplifies the management of HTML blocks. MVVM also enables faster communication between components regardless of their relationship.

Recent VueJS Development Blogs

31 Jul 2020 | 8 Min Read
Vuejs vs React in 2020: Who Will Win The Battle?

Fortunately, the front end development ecosystem is very versatile today. There are plenty of front end web development tools [https://simpleprogrammer.com/12-front-end-tools-web-development/] for quick and efficient web application development. Most of these are top front end frameworks [https://www.thirdrocktechkno.com/blog/top-front-end-javascript-frameworks-to-use-in-2020/] that provide a comprehensive scaffolding to base your web application on. Vuejs and React have emerged as two leading technologies for web application development. However, choosing the wrong one for your app can cost you a lot especially when you want to scale it. So, to help you select the right framework, here is a complete guide on Vuejs vs React in 2020. Vuejs VS React in 2020: Background When choosing the tech stack for web development [https://www.thirdrocktechkno.com/blog/how-to-choose-a-technology-stack-for-web-application-development/] , developers often trust the tools that are mature and have stood the test of time. Vuejs Background Released in 2014, Vuejs [https://vuejs.org/] is an open-source JavaScript framework. It is widely used for developing excellent single-page applications. The framework is quite popular among developers as it simplifies the process of web development. Moreover, its progressive functionalities allow them to create attractive UIs for the web. Vuejs boasts an amazing ability to re-render without any action. It is a highly composable framework that lets one create small, reusable, and sturdy components. Companies using Vuejs include Adobe [https://www.adobe.com/], Grammarly [https://www.grammarly.com/], Alibaba [https://www.alibaba.com/], Gitlab [https://about.gitlab.com/], etc. React Background React [https://reactjs.org/] is a Facebook-owned JavaScript library. React has become one of the most popular front end frameworks because of its distinguishing features. [https://www.thirdrocktechkno.com/blog/why-choose-reactjs-for-your-next-project-features-and-benefits/] The key feature of this open-source library is its ability to build reusable and captivating UI components. There is a plethora of React libraries [https://www.thirdrocktechkno.com/blog/top-14-react-libraries-you-must-try-in-2020/] that you can use to build efficient web applications very quickly. React works best with the components that require frequent data changes. Moreover, React has a component-based architecture. This means that one can create reusable interfaces by splitting them into smaller components instead of using templates and HTML. Currently, React is one of the leading technologies in the market. Several big businesses such as Facebook [https://www.facebook.com/], Netflix [https://www.netflix.com/], Dropbox [https://www.dropbox.com/], Microsoft [https://www.microsoft.com/], etc. rely on React for their technological needs. Vuejs VS React in 2020: Popularity It is important to review both the technologies from the popularity angle. This is because it has a direct impact on the number of developers available as well as the quality of third-party libraries. Source: Stack Overflow [https://insights.stackoverflow.com/trends?tags=reactjs%2Cvue.js] React popularity in 2020 React leads the race in terms of popularity. Corporate backing from Facebook ensures long-term support. As a result, the library has attracted a lot of community support from independent developers. A larger community translates into a huge ecosystem of third-party libraries, packages, tools, and support from all the major IDEs. Also, it paves way for more tutorials, online courses, and questions on Stackoverflow Vuejs popularity in 2020 Vuejs is maintained by Evan You (founder) and his team of developers. This results in comparatively fewer resources, packages, and third-party libraries. Also, the support that the library receives from all major IDEs is not as extensive as React. Vuejs VS React in 2020: Ease of Use The ease of use factor is particularly useful for the new developers looking to get started with web development. React allows developers to create components instead of templates since the components are reusable and unit-test friendly. The library relies on JSX which allows integration of UI templates with JavaScript. Working with JSX results in a development boost because it enables the library to display more useful errors and warnings. However, a huge ecosystem of tools and libraries makes it complex for the developers to make the right choice for a project. Moreover, an absence of defined rules or regulations increases the chances of major errors in the projects. In contrast, Vuejs is much easier to use. The framework consists of various features that affect the size of the project, making it a “progressive framework”. It also provides a CLI and packages that are highly compatible with build tools. The environment mostly uses the single-file component, a script, or a style tag to write components. Vuejs has proved to be highly compatible for team projects and gets the work done with fewer bugs & in a shorter time frame. Vuejs VS React in 2020: Modularity The principle of Modularity states that an application must be broken down into separate modules, each assigned with a specific purpose or functionality. Modularity makes it easier to add/remove features from large, complex applications without affecting them entirely. Each and every part of a React application is split into components. To keep things simple and effective, developers must ensure that every component of the app represents only a single function. The act of segregating the code base into small, independent components makes the app development process very intuitive. It also allows for the development and testing of the modules individually which facilitates adding new features and identifying bugs. Instead of components, Vuejs takes the advantage of “single-file components” concept. This implies that the scripts, templates, and styles of the app will be stored in one file but in three separate components. Vuejs VS React in 2020: Scalability An important consideration while choosing a front end framework is how easy it will be to scale the application later. The scalability of a framework is greatly influenced by how apps are built using that framework. A template-based syntax is used to build Vuejs applications. On the other hand, React uses JavaScript with JSX extension to write DOM. When it’s time to scale a Vuejs application, it can become extremely tedious to reuse its templates and components. However, you can easily reuse React components because they are written using JSX extension. In terms of scalability, React is much more reliable than Vuejs. Vuejs VS React in 2020: Testing and Debugging A good testing and debugging system enhances the effectiveness of the framework and helps in building flexible applications. Testing and debugging in React The team at Facebook recommends the developers to use Jest for testing the React code. It focuses on simplicity and has the ability to run parallel tests for quick and safe results. Moreover, it works out of the box and configuration free on almost all the JS projects. Testing and debugging in Vuejs Currently, the Vuejs team doesn’t have any particular guidance on testing, but they recommend using Karma. For debugging, Vuejs utilizes breakpoints, debugger statements, etc. Additionally, developers can debug their apps using Vue.js devtools [https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd?hl=en] . Vuejs VS React in 2020: Server-Side Rendering Server-side rendering is an important requirement for web applications that aim for higher search engine optimization. It also makes the web page more accessible for the user. Server-side rendering in Vuejs Vuejs has released an official guide for SSR which is located on a different domain, separate from Vuejs official documentation. The guide is very detailed; one requires a proper understanding of Node.js and Webpack to comprehend it. The guide mentions Nuxt.js [https://nuxtjs.org/], a framework released by the community as a solution for SSR in Vuejs. Although the framework consists of certain additional features, it restricts the developers to have complete control over the application structure. Server-side rendering in React React does not have any official documentation on server-side rendering. Therefore, when the developers need to view the components in the form of HTML code, they use ReactDOMServer. Moreover, a developer needs to be efficient in libraries such as React Router and Redux to perform server-side rendering. In addition to that, one can use Next.js [https://nextjs.org/], a framework that can create a React SSR application. In this way, React uses the help of third-party packages to enable SSR. Vuejs VS React in 2020: Flexibility and Learning Curve Flexibility and learning curve are essential aspects that help new developers in choosing a framework to get started with. Vuejs flexibility and learning curve Vuejs is a fairly flexible framework; the developers face no restrictions in developing applications their own way. It provides official support for a number of build systems. Moreover, Vuejs facilitates a quick learning process since developers need only need basic knowledge of HTML and ES5 to get started. React flexibility and learning curve React has a great advantage in the form of flexibility. On top of that, it’s easy to learn since it is not a full-fledged framework but a JS library. Instead of limiting them to work in a set pattern, React lets the developers add libraries of their preferences. The library also supports state management tasks by easily integrating with MobX and Redux. Vuejs VS React in 2020: Framework Size The size of the framework has a direct influence on the productivity of projects. Essentially, frameworks that are smaller in size are preferred more by developers. Talking about the size, React is around 100 Kb whereas Vuejs is even smaller, around 80 Kb. Their small size makes both of them best suited for the development of small and lightweight applications. Vuejs VS React in 2020: Application Size Before choosing a framework, a developer should first determine the size of the application. Light-weight and heavy-weight applications have their own special requirements. Vuejs is ideal for developing light-weight applications since it is smaller than most other frameworks. React library is also great for light-weight applications. However, it requires support from other libraries for specific tasks such as routing. Vuejs VS React in 2020: Performance Measuring the performance of any framework is very subjective. Both React and Vuejs can prove to be very performant and not so performant depending on the type of application you are using them for. Generally speaking, both React and Vuejs are quite lightweight with very little framework size. React has a bit of advantage with its virtual DOM but Vuejs too is a progressive framework that beats React with its speed. Lastly, Vuejs and React both have in-built support for tree shaking and bundling. This results in a lower end-user resource burden. In terms of performance, it’s really about choosing the right framework for the right kind of web application. Vuejs VS React in 2020: Which is The Right Tool for You? React and Vuejs are both excellent technologies for building dynamic and interactive user interfaces. To solve the dilemma of making a choice for your next project, you have to keep in mind your business needs, environment, developer availability, budget, and the timeframe of your proposed project. Vuejs is perfectly lightweight and an easy-to-learn framework. You can easily integrate your existing projects to Vuejs because of its familiar templating syntax and use of components. This is exactly what makes the library quite suitable for startups as well as large-scale projects. In addition to that, it offers official packages for state management, routing, or server-side rendering with regular updates. On the other hand, React is a renowned and very efficient JS library. Since it’s launched by Facebook, it enjoys a corporate and community support and has a colossal ecosystem. React has earned quite a reputation for building complex enterprise-grade applications. Furthermore, the market is booming with the number of React developers available for hire. In terms of performance, Vuejs is on the same level as React. However, it ultimately boils down to the optimization efforts and application size. [https://www.thirdrocktechkno.com/hire-us/?utm_medium=banner&utm_source=blog&utm_campaign=website]

14 Jul 2020 | 8 Min Read
Top 14 React Libraries You Must Try in 2020

Application development is all about choosing the right tools and frameworks that help you save development time and costs. When it comes to web app development, you must first understand how to choose the right technology stack for your application [https://www.thirdrocktechkno.com/blog/how-to-choose-a-technology-stack-for-web-application-development/] . Taking this decision requires you to have knowledge of how major frameworks like Angular, React, and Vue are different from each other [https://www.thirdrocktechkno.com/blog/angular-vs-react-vs-vue-which-framework-to-use-in-2020/] . We recently wrote a blog on when and why you should choose Reactjs for web development [https://www.thirdrocktechkno.com/blog/why-choose-reactjs-for-your-next-project-features-and-benefits/] . In this blog, we dig deeper and present to you top React libraries in 2020 that can be very beneficial while developing a Reactjs based application. The libraries/components are classified on the basis of their functionalities. Top React Library in 2020 For Routing and Navigation One of the key features of a web app is its ability to seamlessly navigate users from one page to another. However, this task becomes a bit complicated for the Single Page Apps (SPAs). An SPA must be able to directly render that part of UI where the user interacts with the app while navigating through various sections. Therefore, SPAs use routers as guiding tools. The function of a router is to translate the browser address into related pages, thus helping the users to navigate through the web application. The SPAs resort to a very industrious approach of routing in which whenever a user takes an action on the web app, it collects new data. 1. React Router React Router [https://reacttraining.com/react-router/web/guides/quick-start] is a collection of navigational components that keep the UI of an application in sync with its URL. Thus, it ensures effortless navigation. Its API is simple yet effective with robust in-built features like lazy code loading, dynamic route matching, and location transition handling. Furthermore, it provides strong nesting support and server-side rendering. Top React Libraries in 2020 For CLIs and Boilerplates In simple terms, Boilerplates refer to the reusable blocks of code using which the developers can set up multiple libraries at once. It also allows them to generate identical copies for other projects that can be reused later. 2. Create React App Create React App [https://reactjs.org/docs/create-a-new-react-app.html] is a CLI tool that doesn’t require any building configuration. So it gives Reactjs developers a great head start when working on React projects as it enables the developers to generate their own boilerplates. The tool assembles the components and files needed to build, test, and launch an application. In this way, it drastically reduces the time and effort invested in the development process. One can initiate the app building process by simply running a single command and no more complexities are involved. Top React UI Component Libraries in 2020 An interactive and enticing user interface is a major factor in improving the retention rate of a web application. React has a good deal of UI component libraries for building captivating and feature-rich interfaces smoothly. 3. Ant-design Ant-design [https://ant.design/] is a UI library consisting of a set of tools for building elegant user interfaces. It has an extensive customer base and consolidates resources from NPM, Webpack, Babel and DVA. This React library offers a smooth user experience by allowing the developers to nest their UI components. It works better with internal desktop applications and is based on several unitary specifications. 4. React Bootstrap React Bootstrap [https://react-bootstrap.github.io/] is a Bootstrap library-based UI toolkit. It gives Reactjs developers more control over reusing and integrating UI components. Moreover, it has a lot of themes and resources readily available for use. The library is instinctive to use because of the Bootstrap themes and stylesheet. As a result, developers can code quickly and more productively with the help of reusable coding methods. 5. Material UI Material UI [https://material-ui.com/] is a set of components created by Google and is based on Material Design guidelines. It contains many accessible and editable UI widgets to create captivating, consistent, and light user interfaces. The components of Material UI are self-sustaining in nature and only implement the styles they need to display. This leads to performance enhancements in the applications. In addition to that, it has very strong community support. 6. Semantic UI for React Semantic UI React [https://react.semantic-ui.com/] is a jQuery-based component library that provides additional functionality to the pipelines used by the developers.  The library contains a bundle of prebuilt components that are designed particularly to generate Semantic-friendly code. It is a declarative API and strongly adheres to the flexible React ecosystem. Additionally, its shorthand props reduce the burden of hasty coding. Top React Libraries in 2020 For Animation The traditional way of implementing animations in a web app is through CSS. However, at times, many developers are limited by the use of CSS and look for additional tools for animation. Reactjs saved the day by offering an easy-to-use declarative UI that goes by the name React Transition Group. It permits the developers to execute the animations while creating a web app. Other examples of prominent React animation libraries are: 7. React-motion React-motion [https://github.com/chenglou/react-motion] is a well-known React animation library that employs spring configuration for defining animations. Thus, it relieves the developers of their concerns regarding controlled duration and complexities. The library streamlines the development flow within React components with the help of damping, stiffness, and precision methods. Moreover, its spring API bridges the gap between imperative and declarative approaches and guarantees a secured & shared transition. 8. React Native Reanimated React Native Reanimated [https://www.npmjs.com/package/react-native-reanimated] was created by re-writing the native animated API from scratch to make way for gesture-based interactions in the applications. The earlier React Native API faced problems in implementing gesture-based interactions. Therefore, this library was created as a better substitute. What’s better is that this library performs animations directly on the native thread instead of JS thread. Furthermore, it is backward compatible. This implies that the developers don’t have to recreate the animations for a specific component if and when they migrate to this library from the Animated API. Top React Library in 2020 For Building Forms It is always easier to use a form element with a library instead of building it from scratch. Reactjs has several form libraries that can be used for better and faster creation of customized components including inputs, buttons, and even new components. 9. React Hook Form React Hook [https://react-hook-form.com/] Form is minimalistic and independent form library, mostly used with React hooks API. It is the most popular form library for Reactjs and is built with TypeScript. React Hook Form aligns the UI to the existing HTML standards which simplify form validation. Moreover, it unites the uncontrolled components with native HTML inputs. The library easily integrates with external React UI component libraries and Reactjs state management libraries. Top React Libraries in 2020 For Code Formatting Out of many code formatting libraries for React, the following two are our absolute favorites: 10. ES-Lint ES-Lint [https://www.npmjs.com/package/eslint-plugin-react] is a pluggable and configurable code analysis tool for JavaScript. In the React ecosystem, this library identifies the creases in JS codes that do not follow the standard guidelines. It improves the code by making it more consistent and bug-free. In addition to that, ES-Lint enhances the code quality by assessing the patterns in code and resolving the errors by auto-fixing the code. 11. Prettier Prettier [https://prettier.io/] is a code formatting tool that strictly abides by the current formatting rules. It supports multiple coding languages and integrates with most editors. It examines the files for issues and auto-reformates to make it consistent with the rules for indentation, quotes, etc. Termed as an opinionated code formatter, Prettier provides support for JavaScript, JSX, Angular, TypeScript, CSS, HTML, JSON, and many more. Top React Libraries in 2020 For State Management The purpose of state management libraries is to keep the state of all users uniform across different web forms. Meaning, a user can continue from the exact same location or page on a mobile device as he/she left it on desktop. 12. Redux Redux [https://redux.js.org/] is a state management solution for JavaScript applications. It’s a predictable state container and an autonomous library. Although it is primarily deployed with React UI components, it can also be used with Angular, Vue, Ember, and other frameworks. Redux is useful for both the front-end and the back-end libraries. The library makes it possible to connect the pieces of state to React components. Thus, it removes the need for callback or props. Reactjs developers love to work with Redux [https://redux.js.org/basics/usage-with-react] as it facilitates writing coherent codes, operates well in different environments, and supports easy testing. It also allows developers to edit the code live while working on a project. React Native, a mobile app development framework, has its official Redux library named React-Redux. 13. MobX MobX [https://mobx.js.org/] is a robust library created to simplify state management. Moreover, it makes state management more scalable by transparently applying functional reactive programming. The principle behind MobX is simple enough: anything which is derivable from the application state should be derived automatically and efficiently. The library acts as an easier and simpler substitute for Redux.  It is mainly used for quick-to-build and plain apps with lesser boilerplate code. Top React Library in 2020 For Payment Options With ever-increasing trends of remote shopping and simplicity of online payments, the numbers of online transactions have comfortably overtaken the cash transactions. The payment SDKs of Reactjs ecosystem offer a trustworthy solution for online payment to the end-users. 14. Stripe Elements Stripe elements [https://stripe.com/payments/elements] or API is primarily a feature of Stripe.js. It is a contemporary and adaptable UI components library for payment solutions in the Reactjs ecosystem. Stripe API boasts the features of data privacy and fast response with appropriate authentication. It runs on a single interface approach for Apple Pay, Google Pay, and payment request API. Stripe API proves its qualitative worth by offering a powerful performance of payment form and ease of making a custom form. It quickly responds to the payment acceptance and confirmation tasks with the help of dynamic card elements such as CVC, expiry, etc. Furthermore, it supports responsive design and language translation to suit the needs of the customer. Which is the best React library in 2020? We wish we knew the answer but the truth is there isn’t any one library that we can consider the best. That’s why we chose to write about top React libraries in 2020 on the basis of different categories. To reiterate what we said at the beginning of this blog, you must possess an in-depth knowledge of a lot of factors when it comes to building a web application in the right way. If you would like to get a free consultation from our expert software development consultants, drop your project details here [https://www.thirdrocktechkno.com/contact-us] and we will help you find the most efficient solution for web app development. Let’s work together to build smarter, more performant apps in 2020! [https://www.thirdrocktechkno.com/hire-us]

12 Jun 2020 | 5 Min Read
Pre-rendering in Angular 9

What is Pre-rendering in angular? Pre-rendering creates a static page when we build an angular application. As a result, the website will load faster and will be SEO friendly without the need for server-side rendering. The pre-rendering is helpful if we want to serve static pages in the application. Why should we pre-render Angular applications? Most of the obstacles that one faces with an Angular application are fixed by following the optimization techniques. Although there are a still a few problems which optimizations won’t fix: 1. SEO (search engine optimization): SPAs (single-page applications) are harder to index by search engines because the content isn’t available on load time. Therefore, the application is likely to fail on several SEO requirements. 2. Slow initial page load: Since the application still needs to be bootstrapped after the page is loaded, there is an initial waiting time until the user can use the application. This results in a bad user experience. Now, we have two way to solve this problem. 1. Server Side Rendering (SSR): SSR executes the Angular application on the server. The server will serve the compiled content in a way that search engine crawlers can read it. SSR is the best of both worlds. The server will render the application, but when the JavaScript bundle is loaded, it will turn into a SPA. The result is an application with rich UI/UX that loads quickly at the same time! 2. Pre-Rendering: Pre-rendering would run generated static HTML files when we create build,  and that is insanely fast. And when the JavaScript bundles are loaded, the browser would take over. What we get after this is Ultra fast loading time + No compromise in the rich SPA experience. Both the technique solves the issue we have above, but if you see the rendering time that we have observed, it will make sense to choose the later. How to implement pre-render Angular applications? First, you need to add angular universal to your project using this command from server-side rendering guide [https://angular.io/guide/universal] Must use Node 12 or above Version ng add @nguniversal/express-engine --clientProject project-example The command will generate all the scripts to run server-side rendering in our application. You need i itt to generate static pages. The next step is to transfer the code fragments responsible for creating the express server from server.ts to a new express-app.ts file. Below is the code that you should paste into the new file. // express-app.ts import 'zone.js/dist/zone-node'; import * as express from 'express'; import { join } from 'path'; // Express server export const app = express(); const DIST_FOLDER = join(process.cwd(), 'dist/browser'); // * NOTE :: leave this as require() since this file is built Dynamically from webpack const {AppServerModuleNgFactory, LAZY_MODULE_MAP, ngExpressEngine, provideModuleMap} = require('./dist/server/main'); // Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine) app.engine('html', ngExpressEngine({ bootstrap: AppServerModuleNgFactory, providers: [ provideModuleMap(LAZY_MODULE_MAP) ] })); app.set('view engine', 'html'); app.set('views', DIST_FOLDER); // Example Express Rest API endpoints // app.get('/api/**', (req, res) => { }); // Serve static files from /browser app.get('*.*', express.static(DIST_FOLDER, { maxAge: '1y' })); // All regular routes use the Universal engine app.get('*', (req, res) => { res.render('index', { req }); }); Once you copy the code remove the express server code from the server.ts and instead import it from the express-app.ts leaving only the code listening to the port. // server.ts import { app } from './express-app'; const PORT = process.env.PORT || 4000; // Start up the Node server app.listen(PORT, async () => { console.log(`Node Express server listening on http://localhost:${PORT}`); }); Further, now add the main code that performs pre-render of our sub-pages. (you also need to install an additional library to create sub-folders using the command npm install mkdirp @types/mkdirp) // Prerender.ts import * as request from 'request-promise'; import * as mkdirp from 'mkdirp'; import { promisify } from 'util'; import { writeFileSync } from 'fs'; import { Express } from 'express'; import { app } from './express-app'; export const ROUTES = [ '/', '/auth', '/privacy-policy' ]; const mkdirpAsync = promisify(mkdirp); function prerender(expressApp: Express, routes: string[]) { const PORT = process.env.PRERENDER_PORT || 4000; // Start up the Node server const server = expressApp.listen(PORT, async () => { try { for (const route of routes) { const result = await request.get(`http://localhost:${PORT}${route}`); await mkdirpAsync(`dist/browser${route}`); writeFileSync(`dist/browser${route}/index.html`, result); } console.log('Prerender complete.'); server.close(); } catch (error) { server.close(() => process.exit(1)); } }); } prerender(app, ROUTES); // Work around Solution for https://github.com/angular/angular-cli/issues/7200 (This is just for reference) const path = require('path'); const webpack = require('webpack'); module.exports = { mode: 'none', entry: { // This is our Express server for Dynamic universal server: './server.ts', prerender: './prerender.ts' // <--------------- HERE!!! }, externals: { './dist/server/main': 'require("./server/main")' }, target: 'node', resolve: { extensions: ['.ts', '.js'] }, optimization: { minimize: false }, output: { // Puts the output at the root of the dist folder path: path.join(__dirname, 'dist'), filename: '[name].js' }, module: { noParse: /polyfills-.*\.js/, rules: [ { test: /\.ts$/, loader: 'ts-loader' }, { // Mark files inside `@angular/core` as using SystemJS style dynamic imports. // Removing this will cause deprecation warnings to appear. test: /(\\|\/)@angular(\\|\/)core(\\|\/).+\.js$/, parser: { system: true } } ] }, plugins: [ new webpack.ContextReplacementPlugin( // fixes WARNING Critical dependency: the request of a dependency is an expression /(.+)?angular(\\|\/)core(.+)?/, path.join(__dirname, 'src'), // location of your src {} // a map of your routes ), new webpack.ContextReplacementPlugin( // fixes WARNING Critical dependency: the request of a dependency is an expression /(.+)?express(\\|\/)(.+)?/, path.join(__dirname, 'src'), {} ) ] }; You will need to add a new script to package.json for ease of use. "scripts": { ... "prerender": "node dist/prerender", ... } And that’s all, now you just need to build an application in SSR mode and run the command "prerender". npm run build:ssr && npm run prerender In the dist/browser directory, you will find sub-folders with index.html files containing SEO-friendly generated HTML content of the application. If you are using @angular/service-worker then you will need to reconfigure right after the prerender because the checksum value in the index.html file has changed after the html modification. Use the command below to do so. ngsw-config dist/browser ngsw-config.json Conclusion Pre-render allows us to generate html files for every route so that we can serve content faster. To ensure that clients can only download the files that they are permitted to see, put all client-facing asset files in the /dist folder and only honor requests for files from the /dist folder. -------------------------------------------------------------------------------- Third Rock Techkno [https://www.thirdrocktechkno.com/] is a leading IT services company. We are a top-ranked web, voice and mobile app development company with over 10 years of experience. Client success forms the core of our value system. We have expertise in the latest technologies including angular, react native, iOs, Android and more. Third Rock Techkno has developed smart, scalable and innovative solutions for clients across a host of industries. Our team of dedicated developers combine their knowledge and skills to develop and deliver web and mobile apps that boost business and increase output for our clients.

Get in Touch

Is your mind buzzing with ideas?
Let us know about them!

Contact Us