SlideShare a Scribd company logo
1 of 29
Download to read offline
Apache FlexJS Web Application
Development with Visual Studio Code
ApacheCon North America
May 18, 2017 • Miami, Florida
Code Intelligence
• Syntax highlighting
• Completion / IntelliSense
• Function signature help
• Realtime errors/warnings
• Symbol information on hover
• Goto definition with Ctrl+click
• List symbols in document
• Search symbols in workspace
• Find all references
• Rename symbol
• Automatically import classes
Debugging
• Add breakpoints
• Automatically stop at uncaught exceptions
• Pause, step in/out/over, restart, and stop
• See function call stack
• Inspect an object’s variables/properties
• Print to debug console with trace()
• Run JS in web browsers, but see original
ActionScript and MXML in debugger
• Also supports Adobe AIR/Flash debugging
Installation
Apache FlexJS web application development with Visual Studio Code
Available for Windows, macOS and Linux
https://code.visualstudio.com
Open Extensions view and search for “actionscript”
How to install the NextGen ActionScript extension
Choose between NPM or the Flex SDK Installer
How to download Apache FlexJS
• Set the FLEX_HOME environment variable
• Add executables in js/bin to PATH environment
variable
• Set nextgenas.sdk.editor in Visual Studio Code
Open Settings, switch to Workspace Settings:


{

"nextgenas.sdk.editor": "/path/to/flexjs"

}
How to add FlexJS to Visual Studio Code
Create a new project
Apache FlexJS web application development with Visual Studio Code
• Launch Visual Studio Code
• Click Open folder…
• Create a new empty folder for your project and open it
• Go to the Explorer view on the left
• Create a new file named asconfig.json
• Create a new folder named src
• Inside src, create a new file named MyFirstProject.mxml
How to create a project
asconfig.json
{

"compilerOptions": {

"targets": [

"JSFlex"

]

},

"files": [

"src/MyFirstProject.mxml"

]

}
MyFirstProject.mxml
<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/flexjs/express">
<js:initialView>
<js:View>
<js:TextButton text="Click Me"/>
</js:View>
</js:initialView>
<fx:Script>
<![CDATA[
]]>
</fx:Script>
</js:Application>
Code Intelligence
<js:TextButton text="Click Me"

click="onButtonClick(event)"/>

<fx:Script>

<![CDATA[

import org.apache.flex.events.MouseEvent; //automatic imports

import org.apache.flex.html.Alert;



private function onButtonClick(event:MouseEvent):void

{

var a:Number = 2; //completion/intellisense

var b:Number = 5; //try right-click, then rename symbol

var sum:Number = a + b; //try ctrl+click to goto definition

Alert.show("The sum is: " + sum, this); //signature help

}
]]>

</fx:Script>
Build a project with tasks.json
Apache FlexJS web application development with Visual Studio Code
Compiles a project configured with asconfig.json
Download asconfigc from NPM
• Open the Command Palette from the View menu
• Choose Tasks: Configure Task Runner (ActionScript - asconfig.json)
tasks.json
{

"version": "0.1.0",

"command": "asconfigc",

"isShellCommand": true,

"args": [

"--debug=true",

//"--flexHome=/path/to/sdk"

],

"showOutput": "always",

}
Press Ctrl+Shift+B to build with
command from tasks.json
Debugging with launch.json
Apache FlexJS web application development with Visual Studio Code
Where can I debug FlexJS applications?
• VSCode extensions for major browsers, including…
• Google Chrome
• Mozilla Firefox
• Microsoft Edge
• Apple Safari on connected iOS device
• Built-in debuggers:
• Node.js
• Adobe AIR and Flash Player
Open Extensions view and search for "chrome debug"
How to install the Debugger for Chrome
Debugging with source maps
• Associates the generated JavaScript with its original ActionScript or MXML.
• Even displays ActionScript or MXML in web browser’s own native JavaScript
debugging tools.
• Use the -source-map=true compiler option.
{

"compilerOptions": {
"targets": [

"JSFlex"

]

"source-map": true 

},

"files": [

"src/MyFirstProject.mxml"

]

}
launch.json
{

"version": "0.2.0",

"configurations": [

{

"type": "chrome",

"name": "Debug FlexJS Project",

"request": "launch",

"file": "${workspaceRoot}/bin/js-debug/index.html",

"sourceMaps": true,

"preLaunchTask": "asconfigc"

}

],



}
Press F5 key to debug with selected
configuration in launch.json
Links
• Visual Studio Code

https://code.visualstudio.com/
• Apache Flex SDK Installer

https://flex.apache.org/installer.html
• ActionScript and MXML extension for VSCode

https://nextgenactionscript.com/vscode/
• Extension documentation

https://github.com/BowlerHatLLC/vscode-nextgenas/wiki
• asconfigc

https://www.npmjs.com/package/asconfigc

More Related Content

Recently uploaded

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
panagenda
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Recently uploaded (20)

Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 

Apache FlexJS Web Application Development with Visual Studio Code

  • 1. Apache FlexJS Web Application Development with Visual Studio Code ApacheCon North America May 18, 2017 • Miami, Florida
  • 2.
  • 3.
  • 4.
  • 5. Code Intelligence • Syntax highlighting • Completion / IntelliSense • Function signature help • Realtime errors/warnings • Symbol information on hover • Goto definition with Ctrl+click • List symbols in document • Search symbols in workspace • Find all references • Rename symbol • Automatically import classes
  • 6. Debugging • Add breakpoints • Automatically stop at uncaught exceptions • Pause, step in/out/over, restart, and stop • See function call stack • Inspect an object’s variables/properties • Print to debug console with trace() • Run JS in web browsers, but see original ActionScript and MXML in debugger • Also supports Adobe AIR/Flash debugging
  • 7. Installation Apache FlexJS web application development with Visual Studio Code
  • 8. Available for Windows, macOS and Linux https://code.visualstudio.com
  • 9. Open Extensions view and search for “actionscript” How to install the NextGen ActionScript extension
  • 10. Choose between NPM or the Flex SDK Installer How to download Apache FlexJS
  • 11. • Set the FLEX_HOME environment variable • Add executables in js/bin to PATH environment variable • Set nextgenas.sdk.editor in Visual Studio Code Open Settings, switch to Workspace Settings: 
 {
 "nextgenas.sdk.editor": "/path/to/flexjs"
 } How to add FlexJS to Visual Studio Code
  • 12. Create a new project Apache FlexJS web application development with Visual Studio Code
  • 13. • Launch Visual Studio Code • Click Open folder… • Create a new empty folder for your project and open it • Go to the Explorer view on the left • Create a new file named asconfig.json • Create a new folder named src • Inside src, create a new file named MyFirstProject.mxml How to create a project
  • 14.
  • 16. MyFirstProject.mxml <?xml version="1.0" encoding="utf-8"?> <js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:js="library://ns.apache.org/flexjs/express"> <js:initialView> <js:View> <js:TextButton text="Click Me"/> </js:View> </js:initialView> <fx:Script> <![CDATA[ ]]> </fx:Script> </js:Application>
  • 17. Code Intelligence <js:TextButton text="Click Me"
 click="onButtonClick(event)"/>
 <fx:Script>
 <![CDATA[
 import org.apache.flex.events.MouseEvent; //automatic imports
 import org.apache.flex.html.Alert;
 
 private function onButtonClick(event:MouseEvent):void
 {
 var a:Number = 2; //completion/intellisense
 var b:Number = 5; //try right-click, then rename symbol
 var sum:Number = a + b; //try ctrl+click to goto definition
 Alert.show("The sum is: " + sum, this); //signature help
 } ]]>
 </fx:Script>
  • 18. Build a project with tasks.json Apache FlexJS web application development with Visual Studio Code
  • 19. Compiles a project configured with asconfig.json Download asconfigc from NPM
  • 20. • Open the Command Palette from the View menu • Choose Tasks: Configure Task Runner (ActionScript - asconfig.json)
  • 21. tasks.json {
 "version": "0.1.0",
 "command": "asconfigc",
 "isShellCommand": true,
 "args": [
 "--debug=true",
 //"--flexHome=/path/to/sdk"
 ],
 "showOutput": "always",
 }
  • 22. Press Ctrl+Shift+B to build with command from tasks.json
  • 23. Debugging with launch.json Apache FlexJS web application development with Visual Studio Code
  • 24. Where can I debug FlexJS applications? • VSCode extensions for major browsers, including… • Google Chrome • Mozilla Firefox • Microsoft Edge • Apple Safari on connected iOS device • Built-in debuggers: • Node.js • Adobe AIR and Flash Player
  • 25. Open Extensions view and search for "chrome debug" How to install the Debugger for Chrome
  • 26. Debugging with source maps • Associates the generated JavaScript with its original ActionScript or MXML. • Even displays ActionScript or MXML in web browser’s own native JavaScript debugging tools. • Use the -source-map=true compiler option. {
 "compilerOptions": { "targets": [
 "JSFlex"
 ]
 "source-map": true 
 },
 "files": [
 "src/MyFirstProject.mxml"
 ]
 }
  • 27. launch.json {
 "version": "0.2.0",
 "configurations": [
 {
 "type": "chrome",
 "name": "Debug FlexJS Project",
 "request": "launch",
 "file": "${workspaceRoot}/bin/js-debug/index.html",
 "sourceMaps": true,
 "preLaunchTask": "asconfigc"
 }
 ],
 
 }
  • 28. Press F5 key to debug with selected configuration in launch.json
  • 29. Links • Visual Studio Code
 https://code.visualstudio.com/ • Apache Flex SDK Installer
 https://flex.apache.org/installer.html • ActionScript and MXML extension for VSCode
 https://nextgenactionscript.com/vscode/ • Extension documentation
 https://github.com/BowlerHatLLC/vscode-nextgenas/wiki • asconfigc
 https://www.npmjs.com/package/asconfigc