What are Monorepos, who uses it, why and a usage example with Lerna
Created for the 3rd React Hannover Meetup on the 5th September 2018
Even more useful links:
- https://github.com/korfuri/awesome-monorepo
- https://medium.com/@Jakeherringbone/you-too-can-love-the-monorepo-d95d1d6fcebe
Managing JavaScript projects in a MonoRepo
(Zacky Pickholz)
Managing a large front end project with multiple npm packages can be overwhelming sometimes. During this session we cover popular tools that help us maintain this project much more easily.
- Archeology: before and without Kubernetes
- Deployment: kube-up, DCOS, GKE
- Core Architecture: the apiserver, the kubelet and the scheduler
- Compute Model: the pod, the service and the controller
[Trung Hoang] Creating a compelling product visionTrung Hoang Nhac
How well are you communicating your product strategy?
How to create a product vision that motivates and aligns people, acts as the product's true north, and facilities collaboration?
What are Monorepos, who uses it, why and a usage example with Lerna
Created for the 3rd React Hannover Meetup on the 5th September 2018
Even more useful links:
- https://github.com/korfuri/awesome-monorepo
- https://medium.com/@Jakeherringbone/you-too-can-love-the-monorepo-d95d1d6fcebe
Managing JavaScript projects in a MonoRepo
(Zacky Pickholz)
Managing a large front end project with multiple npm packages can be overwhelming sometimes. During this session we cover popular tools that help us maintain this project much more easily.
- Archeology: before and without Kubernetes
- Deployment: kube-up, DCOS, GKE
- Core Architecture: the apiserver, the kubelet and the scheduler
- Compute Model: the pod, the service and the controller
[Trung Hoang] Creating a compelling product visionTrung Hoang Nhac
How well are you communicating your product strategy?
How to create a product vision that motivates and aligns people, acts as the product's true north, and facilities collaboration?
Design Thinking and Business Model Innovation at SAP - From Efficiency to Inn...Tobias Schimmer
How Design Thinking and Business Model Innovation approaches changed the way new business models around new products and services are designed, tested and implemented at SAP including the roots in the company's DNA, Lean and Agile.
How to build Micro Frontends with @angular/elementsMarcellKiss7
How to build Micro Frontends with @angular/elements, using Web Components (aka. Custom Elements)
Was presented on Angular Meetup Hungary [EN] and Angular Meetup Graz [DE] in 2022
La Duck Conf : "Event driven : est-ce que je suis prêt ?"OCTO Technology
Présentation de Wassel Alazhar - OCTO Technology
Les architectures orientées événement, ou comment exploiter
les moments-clés d'un business. La promesse est alléchante,
mais pourquoi ces architectures sont-elles si complexes à
maîtriser ?
Comment bien identifier les événements métier autour
desquels articuler nos services ? Quel découpage fait sens pour
mieux les exploiter ?
Benchmarking teams is tricky - it is too easy to amplify dysfunctional behaviour. It is also not easy to find a meaningful metric. This presentation describes an proven approach to concentrate on self assessment of capabilities.
Jakiś czas temu mikroserwisy zawładnęły umysłami i duszami backend developerów. Teraz nadszedł czas, by i ci na froncie odeszli od wiecznie żywych monolitów. Za sprawą Webpacka 5 i Module Federation pojawiła się nowa i ciekawa opcja realizacji idei mikrofrontendów. W trakcie prezentacji opowiem o tym, jak zacząć i zbudować solidny komponent z module federation, ile różnych frameworków użyć i czy w ogóle wykorzystanie mikrofrontendów jest dla wszystkich.
ITKonekt 2023: The Busy Platform Engineers Guide to API GatewaysDaniel Bryant
API Gateways are certainly not a new technology, but the way in which they are being deployed, configured, and operated within modern platforms is forcing many of us to rethink our approach. Can we simply lift and shift our existing gateway into the cloud? Is our API gateway GitOps friendly (and does it need to be)? And what about service meshes, CNI, eBPF, and...
Join this talk for a whistle stop tour of modern API gateways, which a focus on deploying and managing this technology within Kubernetes (on which many modern platforms are built):
- Understand why platform engineers should care about API Gateways today
- Learn about API gateways, options, and requirements for modern platforms
- Identify key considerations for migrating to the cloud or building a new platform on Kubernetes
- Understand how cloud native workflows impact the user/developer experience (UX/DX) of an API gateway
- Explore the components of a complete "edge stack" that supports end-to-end development flows
Easy enterprise application integration with RabbitMQ and AMQPRabbit MQ
VMware vFabric RabbitMQ Technical Webinar December 2010 by VMware engineer Emile Joubert. Covers common integration patterns, and how RabbitMQ makes these easily implemented, using AMQP as a communications mechanism.
You can view a recording of this presentation on YouTube: http://www.youtube.com/user/SpringSourceDev#p/c/5956C6D9EC319817/0/ABGMjX4K0D8
This document contains top 50 MuleSoft Interview questions for the MuleSoft software development job aspirants. Also, this helps, who are taking MCD API Design Associate exam.
Micro Frontends: Rompiendo el monolito en las aplicaciones WebBelatrix Software
Los microservicios son el estilo arquitectural de moda, pues nacieron para facilitar el mantenimiento y crecimiento de grandes aplicaciones monolíticas en el backend. Ahora nos hemos dado cuenta de que es posible aplicar algunos de sus principios a frontend, con resultados muy interesantes.
A continuación, te presentamos algunos de los temas específicos que se exponen:
¿Cómo nacen los microservicios?
¿Por qué nos olvidamos de dividir el frontend? ¿Qué es y cómo nace el concepto de Micro Frontends?
Técnicas para implementar Micro Frontends.
Mi experiencia con Micro Frontends.
Conclusiones y recomendaciones.
Developer Experience (DX) as a Fitness Function for Platform TeamsAndy Marks
Co-delivered with Fendy Liauw on Wednesday May 9. See https://www.eventbrite.com.au/e/developer-experience-as-a-fitness-function-for-platform-teams-tickets-44697308854?aff=TWNetwork for details
Implementing Exactly-once Delivery and Escaping Kafka Rebalance Storms with Y...HostedbyConfluent
"Even though stream processing has come a long way in the last few years, ensuring exactly-once delivery remains a difficult problem to solve.
This becomes an even bigger challenge when your consumers are distributed applications, and their Kubernetes pods can be scaled-out, scaled-in or simply restarted at any given moment, causing Apache Kafka to go into a “rebalance storm”.
In this talk, we’ll walk you through how we implemented exactly-once delivery with Kafka by managing Kafka transactions the right way, and how we escaped endless rebalance storms when running hundreds of consumers on the same Kafka topic.
We will discuss the issues we faced building Akamai’s data ingestion infrastructure on Azure, processing malicious traffic at internet scale.
The session covers:
- Kafka delivery semantics
- Kafka transactional API
- Kafka “anti-rebalance” tips and tricks"
Micro Frontends Architecture is micro service approach for Frontend development. Micro Frontends thinks web-app as a composition of features which are owned by independent teams. Each team has a distinct area of business or mission it cares about and specialises in it. A team is cross functional and develops its features end-to-end, from database to user interface and take care of CI/CD. Micro service architechure is well know concept for backend point of view but In frontend we need to follow diffrent type of design pattern to achieve this.
Key Take away:
1. Learn about Micro Frontend
2. How to practically use them
3. Key challenges
Design Thinking and Business Model Innovation at SAP - From Efficiency to Inn...Tobias Schimmer
How Design Thinking and Business Model Innovation approaches changed the way new business models around new products and services are designed, tested and implemented at SAP including the roots in the company's DNA, Lean and Agile.
How to build Micro Frontends with @angular/elementsMarcellKiss7
How to build Micro Frontends with @angular/elements, using Web Components (aka. Custom Elements)
Was presented on Angular Meetup Hungary [EN] and Angular Meetup Graz [DE] in 2022
La Duck Conf : "Event driven : est-ce que je suis prêt ?"OCTO Technology
Présentation de Wassel Alazhar - OCTO Technology
Les architectures orientées événement, ou comment exploiter
les moments-clés d'un business. La promesse est alléchante,
mais pourquoi ces architectures sont-elles si complexes à
maîtriser ?
Comment bien identifier les événements métier autour
desquels articuler nos services ? Quel découpage fait sens pour
mieux les exploiter ?
Benchmarking teams is tricky - it is too easy to amplify dysfunctional behaviour. It is also not easy to find a meaningful metric. This presentation describes an proven approach to concentrate on self assessment of capabilities.
Jakiś czas temu mikroserwisy zawładnęły umysłami i duszami backend developerów. Teraz nadszedł czas, by i ci na froncie odeszli od wiecznie żywych monolitów. Za sprawą Webpacka 5 i Module Federation pojawiła się nowa i ciekawa opcja realizacji idei mikrofrontendów. W trakcie prezentacji opowiem o tym, jak zacząć i zbudować solidny komponent z module federation, ile różnych frameworków użyć i czy w ogóle wykorzystanie mikrofrontendów jest dla wszystkich.
ITKonekt 2023: The Busy Platform Engineers Guide to API GatewaysDaniel Bryant
API Gateways are certainly not a new technology, but the way in which they are being deployed, configured, and operated within modern platforms is forcing many of us to rethink our approach. Can we simply lift and shift our existing gateway into the cloud? Is our API gateway GitOps friendly (and does it need to be)? And what about service meshes, CNI, eBPF, and...
Join this talk for a whistle stop tour of modern API gateways, which a focus on deploying and managing this technology within Kubernetes (on which many modern platforms are built):
- Understand why platform engineers should care about API Gateways today
- Learn about API gateways, options, and requirements for modern platforms
- Identify key considerations for migrating to the cloud or building a new platform on Kubernetes
- Understand how cloud native workflows impact the user/developer experience (UX/DX) of an API gateway
- Explore the components of a complete "edge stack" that supports end-to-end development flows
Easy enterprise application integration with RabbitMQ and AMQPRabbit MQ
VMware vFabric RabbitMQ Technical Webinar December 2010 by VMware engineer Emile Joubert. Covers common integration patterns, and how RabbitMQ makes these easily implemented, using AMQP as a communications mechanism.
You can view a recording of this presentation on YouTube: http://www.youtube.com/user/SpringSourceDev#p/c/5956C6D9EC319817/0/ABGMjX4K0D8
This document contains top 50 MuleSoft Interview questions for the MuleSoft software development job aspirants. Also, this helps, who are taking MCD API Design Associate exam.
Micro Frontends: Rompiendo el monolito en las aplicaciones WebBelatrix Software
Los microservicios son el estilo arquitectural de moda, pues nacieron para facilitar el mantenimiento y crecimiento de grandes aplicaciones monolíticas en el backend. Ahora nos hemos dado cuenta de que es posible aplicar algunos de sus principios a frontend, con resultados muy interesantes.
A continuación, te presentamos algunos de los temas específicos que se exponen:
¿Cómo nacen los microservicios?
¿Por qué nos olvidamos de dividir el frontend? ¿Qué es y cómo nace el concepto de Micro Frontends?
Técnicas para implementar Micro Frontends.
Mi experiencia con Micro Frontends.
Conclusiones y recomendaciones.
Developer Experience (DX) as a Fitness Function for Platform TeamsAndy Marks
Co-delivered with Fendy Liauw on Wednesday May 9. See https://www.eventbrite.com.au/e/developer-experience-as-a-fitness-function-for-platform-teams-tickets-44697308854?aff=TWNetwork for details
Implementing Exactly-once Delivery and Escaping Kafka Rebalance Storms with Y...HostedbyConfluent
"Even though stream processing has come a long way in the last few years, ensuring exactly-once delivery remains a difficult problem to solve.
This becomes an even bigger challenge when your consumers are distributed applications, and their Kubernetes pods can be scaled-out, scaled-in or simply restarted at any given moment, causing Apache Kafka to go into a “rebalance storm”.
In this talk, we’ll walk you through how we implemented exactly-once delivery with Kafka by managing Kafka transactions the right way, and how we escaped endless rebalance storms when running hundreds of consumers on the same Kafka topic.
We will discuss the issues we faced building Akamai’s data ingestion infrastructure on Azure, processing malicious traffic at internet scale.
The session covers:
- Kafka delivery semantics
- Kafka transactional API
- Kafka “anti-rebalance” tips and tricks"
Micro Frontends Architecture is micro service approach for Frontend development. Micro Frontends thinks web-app as a composition of features which are owned by independent teams. Each team has a distinct area of business or mission it cares about and specialises in it. A team is cross functional and develops its features end-to-end, from database to user interface and take care of CI/CD. Micro service architechure is well know concept for backend point of view but In frontend we need to follow diffrent type of design pattern to achieve this.
Key Take away:
1. Learn about Micro Frontend
2. How to practically use them
3. Key challenges
Learn the core fundamentals of JavaScript and how to use JavaScript creating web applications.
GET the Course - https://www.udemy.com/javascript-code-course/?couponCode=SLIDESHARE
Learn JavaScript Language Fundamentals and start coding JavaScript Today.
Source Code is included so you can try the code.
Resources and tips are provided throughout the course when appropriate.
Modern JavaScript focused means that we do cover current syntax as well as foundational code. No frameworks or JavaScript libraries you can do it all with regular vanilla JavaScript.
All you need is a browser to see JavaScript in action and with a few lines of code you can do a whole lot. It’s easy let us show you.
Course covers
Setup you working development environment and get ready to write some code.
What JavaScript is and how code works. Tools and resources used to write JavaScript
How to create JavaScript Code and run it in your browser
Comments and debugging with the console
Variables and how to create and store values in code
Declaring variables assigning values
Using let and const as variables
Strings Numbers and Boolean data types
Other data types null, undefined
Best practices and rules to name variables
Using JavaScript windows methods alert and prompt
Creating template literals
Challenge #1 Using Template literals in code
JavaScript type conversion and how it works
JavaScript Operators
Comparison and Assignment operators
Challenge #2 to create a Miles to Kilometers Converter
Truthy or Falsy
JavaScript Conditions if else statements
JavaScript Conditions else if statements
Using Short ternary operator
Conditions with Multiple conditions and logical operators
Challenge #3 - Hello Greeter
JavaScript Switch statement
JavaScript Functions
JavaScript Functions arguments and default values
JavaScript Functions return values
JavaScript click events on elements
Function declaration vs expression
Function scope global vs local
Function recursion
IIFE (Immediately Invoked Function Expression)
ES6 Arrow format
JavaScript Objects
Object Method and const
Functions to create Objects
JavaScript Arrays
Array methods to do more with arrays
Array filter
JavaScript Loops and iteration
forEach, object and array data
Challenge #4 - Loops Array builder
JavaScript Map
No libraries, no shortcuts just learning JavaScript making it DYNAMIC and INTERACTIVE web application.
Step by step learning with all steps included.
Beginner JavaScript knowledge is required as the course covers only JavaScript relevant to the building of the game. Also HTML and CSS knowledge is essential as scope of this course is all JavaScript focused.
Along with friendly support in the Q&A to help you learn and answer any questions you may have.
Using galen framework for automated cross browser layout testingSarah Elson
Galen Framework is a test automation framework which was originally introduced to perform cross browser layout testing of a web application in a browser. Nowadays, it has become a fully functional testing framework with rich reporting and test management system. This framework supports both Java and Javascript.
Agenda
Setting up an angular app.
Introduction to tools - Babel, Webpack
Alternative to Gulp, Grunt & Bower.
Writing Controllers, Services, Directives etc..
Testing Javascript with Jasmine.
Setting up Karma with Webpack.
Let’s understand code coverage.
An alternative: JEST
A full weekend of hands-on instruction from a senior software engineer. Over 6 past classes instructed!
AngularJS is a modern Javascript MVC application framework which provides features such as dependency injection, unit-testable components, templates, view routing, easy access to REST-based resources, and much more. This weekend workshop focuses on teaching you the fundamentals and the advanced application of AngularJS. All weekend you will dig into AngularJS hands-on and work through labs and exercises designed to give you a full understanding of AngularJS.
Unveiled at WWDC 2015, Swift 2.0 is an enhanced update with integrated functionalities of its previous version Swift 1.2, thereby providing broader platform for programmers for generating the code. The upgraded version of programming language has been designed more powerful and interfacing for the users.
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
In the ever-evolving landscape of technology, enterprise software development is undergoing a significant transformation. Traditional coding methods are being challenged by innovative no-code solutions, which promise to streamline and democratize the software development process.
This shift is particularly impactful for enterprises, which require robust, scalable, and efficient software to manage their operations. In this article, we will explore the various facets of enterprise software development with no-code solutions, examining their benefits, challenges, and the future potential they hold.
Launch Your Streaming Platforms in MinutesRoshan Dwivedi
The claim of launching a streaming platform in minutes might be a bit of an exaggeration, but there are services that can significantly streamline the process. Here's a breakdown:
Pros of Speedy Streaming Platform Launch Services:
No coding required: These services often use drag-and-drop interfaces or pre-built templates, eliminating the need for programming knowledge.
Faster setup: Compared to building from scratch, these platforms can get you up and running much quicker.
All-in-one solutions: Many services offer features like content management systems (CMS), video players, and monetization tools, reducing the need for multiple integrations.
Things to Consider:
Limited customization: These platforms may offer less flexibility in design and functionality compared to custom-built solutions.
Scalability: As your audience grows, you might need to upgrade to a more robust platform or encounter limitations with the "quick launch" option.
Features: Carefully evaluate which features are included and if they meet your specific needs (e.g., live streaming, subscription options).
Examples of Services for Launching Streaming Platforms:
Muvi [muvi com]
Uscreen [usencreen tv]
Alternatives to Consider:
Existing Streaming platforms: Platforms like YouTube or Twitch might be suitable for basic streaming needs, though monetization options might be limited.
Custom Development: While more time-consuming, custom development offers the most control and flexibility for your platform.
Overall, launching a streaming platform in minutes might not be entirely realistic, but these services can significantly speed up the process compared to building from scratch. Carefully consider your needs and budget when choosing the best option for you.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaYara Milbes
Discover the transformative power of the WhatsApp API in our latest SlideShare presentation, "Top 7 Unique WhatsApp API Benefits." In today's fast-paced digital era, effective communication is crucial for both personal and professional success. Whether you're a small business looking to enhance customer interactions or an individual seeking seamless communication with loved ones, the WhatsApp API offers robust capabilities that can significantly elevate your experience.
In this presentation, we delve into the top 7 distinctive benefits of the WhatsApp API, provided by the leading WhatsApp API service provider in Saudi Arabia. Learn how to streamline customer support, automate notifications, leverage rich media messaging, run scalable marketing campaigns, integrate secure payments, synchronize with CRM systems, and ensure enhanced security and privacy.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
2. Introduction
Closure Compiler is an open source tool developed by Google engineers to
compile javascript code to better javascript code. It makes Javascript compact
and efficient.
It parses your javascript, removes dead code, rewrites everything and minimizes
what is left so that it downloads and runs quickly, and also reduces your
bandwidth needs.
It also checks syntax, variable references, and types, and warns about common
javascript pitfalls.
3. How to use?
We can make use of this tool in different ways as per our
convenience.
Closure Compiler comes as a
1. Web Interface
2. Restful API
3. Java Application
4. Easiest way to try out this compiler service is by using their UI
http://closure-compiler.appspot.com/home
Lets try optimizing a small snippet of code to get familiar with it.
Open the above link in browser, and enter the following code and click Compile button with default options chosen.
function helloWorld(message) {
alert(message);
}
helloWorld("Hello, Google Closure Compiler! Thank you so much!");
You will see the compiled code as
function helloWorld(a){alert(a)}helloWorld("Hello, Google Closure Compiler! Thank you so
much!");
The default optimization used here was Simple Optimization. In this example, local variables names are modified to short
names to reduce the size of your code and whitespaces have been removed. I will explain you more about these
optimization techniques in the next section.
Web Interface
5. You can also optimize one or more javascript files using this UI by adding urls in the form.
1. Copy and Paste your javascript file link in Add a URL box and click Add button.
2. You can add multiple js files in the same way and click Compile button.
3. You will see the compiled code (compiled using Simple Optimization technique) on the right hand side.
You can copy this code and paste in a single file to use it in your project.
6. Closure compiler UI is easy to start with and good for few files. But if you want to use it for a large
project and automate this compilation process for js files in your project, you will have to use their API.
They have a simple web-based API which takes a few parameters to customize this compilation
process.
Request URL
http://closure-compiler.appspot.com/compile
Request Parameters
js_code or code_url
The js_code parameter must be a string that contains JavaScript, such as alert('hello'). The code_url parameter must
contain the URL of a JavaScript .js file. You must include at least one of these parameters, and you can include both.
And you can send multiple
compilation_level
The value of this parameter indicates the degree of compression and optimization to apply to your JavaScript. There are
three possible compilation levels:
WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, and ADVANCED_OPTIMIZATIONS.
The compilation_level parameter defaults to SIMPLE_OPTIMIZATIONS.
Restful API
7. output_info
The value of this parameter indicates the kind of information that you want from the compiler. There are four possible kinds of
output: compiled_code, warnings, errors, and statistics.
output_format
The format for the Closure Compiler service's output.
There are three possible output formats: text, json, or xml. The output_format parameter defaults to text.
You can send a post request to the API url by sending the above specified request parameters and the response of the request will
be the compiled code which you can save into a file and use in your project.
8. Closure Compiler comes as a java application which you can download and use it from command line.
1. Download the latest zip file from
http://closure-compiler.googlecode.com/files/compiler-latest.zip
And save it in a directory.
2. Extract compiler.jar file from it and save it in the same folder.
3. Create a js file and compile it by using the following command
java -jar compiler.jar --js hello.js --js_output_file hello-compiled.js
This command will compile hello.js and store the compiled code in hello-compiled.js file.
So, these are the different ways we can use closure compiler. Using Rest api
among the three will be the better option to smoothen our development process.
Java Application
9. Closure compiler provides three levels of compilation. You
should choose one of them while compiling your code.
1. WHITESPACE_ONLY
2. SIMPLE_OPTIMIZATIONS
3. ADVACNED_OPTIMIZATIONS
Compilation Levels
10. This compilation level removes comments from your code and also removes line
breaks, unnecessary spaces, and other whitespace.
Optimizing the following snippet of code:
function helloWorld(message) {
alert(message);
}
helloWorld("Hello, Google Closure Compiler! Thank you so much!");
with whitespace_only gives the following code
function helloWorld(message){alert(message)}helloWorld("Hello, Google Closure Compiler!
Thank you so much!");
The output JavaScript is functionally identical to the source JavaScript.
It provides the least compression of the three levels.
1. WHITESPACE_ONLY
11. This compilation level performs the same operations of WHITESPACE_ONLY,
but it also does more optimization by renaming local variables in functions and
modifying expressions.
Optimizing the following snippet of code:
function helloWorld(message) {
alert(message);
}
helloWorld("Hello, Google Closure Compiler! Thank you so much!");
with SIMPLE_OPTIMZATIONS gives the following code
function helloWorld(a){alert(a)}helloWorld("Hello, Google Closure Compiler! Thank you so
much!");
As this level renames only symbols that are local to functions, it does not
interfere with the interaction between the compiled JavaScript and other
JavaScript.
2. SIMPLE_OPTIMIZATIONS
12. Compilation with simple_optimzations always preserves the functionality of
syntactically valid JavaScript, provided that the code does not access local
variables using string names (by using eval() statements, for example).
SIMPLE_OPTIMIZATIONS is the default compilation level.
13. This compilation level performs the same transformations as
SIMPLE_OPTIMZATIONS, but adds a variety of more aggressive global
transformations to achieve the highest compression of all three levels.
This level compresses JavaScript well beyond what is possible with other tools.
Optimizing the following snippet of code:
function helloWorld(message) {
alert(message);
}
helloWorld("Hello, Google Closure Compiler! Thank you so much!");
with ADVANCED_OPTIMZATIONS gives the following code
alert("Hello, Google Closure Compiler! Thank you so much!");
Here the function call is replaced with the body of the function and removed the
function definition.
3. ADVANCED_OPTIMIZATIONS
14. To enable this extreme compression, ADVANCED_OPTIMIZATIONS makes
strong assumptions about the compiled code. If your code does not conform to
those assumptions, ADVANCED_OPTIMIZATIONS will produce code that does
not run.
The ADVANCED_OPTIMIZATIONS transformations include:
1. more aggressive renaming:
Renames global variables, function names and properties along with local
variables and parameters.
2. dead code removal:
Removes any unused functions or code.
3. global inlining:
Replaces some function calls with the body of the function.
15. Thank You
Prasad Kancharla,
Lead Software Developer
Riktam Technology Consulting Pvt. Ltd.,
Tel.+91 9848558696 (India)
http://www.riktamtech.com
http://prasadkancharla.blogspot.in/
http://labs.riktamtech.com