Client-side JSX transpiling - babeljs

I want to create React applications with JSX and not have to use a terminal or any server-side/dev environment commands. The environment we are using doesn't allow for commands to be run in the dev environment and these applications will be purely statically hosted on a CDN.
So I know I can simply include Babel's browser.js to do the JSX transpiling in the browser. Perfect. My concern is that Babel apparently stopped supporting this and modern versions of Babel have it removed. Is there another solution? Is babel-standalone what I should be using?
I fully understand the performance penalties in using this in production, but our use case (which I can't imagine is that unusual of a use case with so many great and simple online HTML/JS IDEs) allows for this.

Yes if you don't want to bundle your own files, babel-standalone is what you should use.
See prototyping on the official documentation:
I'm using the CDN from the links above in a "codepen like" demo-project, and it works fine.

Related

Aurelia + JSPM + Typescript browser-side debugging

I has been experimenting with Aurelia build options vis-a-vis development/build workflow. We have concluded that we prefer that developers test the web site while it is bundled, versus serving up all the individual files to the browser. Additionally, we are using TypeScript. And we want have the browser-side debugging experience provided by source maps. I am working with what will be a large application with many Aurelia components, so the few seconds for the page to refresh during the active development change/refresh or watch cycle seems like it will add up. And it seems that if developers are working in the bundles that bundling issues will be discovered immediately.
Using the Aurelia-cli (v23), and creating a new project using TypeScript, then building creates RequireJS bundles and source maps work for browser debugging. That is, after running au run.
Using the skeleton-typescript-webpack starter project (downloaded two weeks ago), then running npm start also provides browser side debugging of typescript of webpacked bundles.
Using skeleton-typescript which uses jspm and systemjs, running gulp serve-bundle does not provide client side typescript debugging. However, gulp serve does provides client side debugging, but the site is not bundled. The only difference between those gulp tasks is that the site is bundled, versus unbundled.
So it seems that typescript source map client side debugging of bundled sites will work with Aurelia-cli and webpack, but not with jspm.
Our project was started based on the skeleton-typescript. Before we refactor the build workflow, I have attempted to figure out how to get jspm to support typescript debugging on the browser.
I've hunted the web, but did not find any clear direction, and did much experimentation with configuration settings with a trial and error approach, but cannot seem to get a bundled jspm site to allow the client side typescript debugging experience.
Is this a limitation of jspm or systemJS or the Aurelia-Bundler? Or is there some configuration setting, in config.js or bundles.js, I need to add to the skeleton-typescript starter project to get this to work?
Maybe your are not getting access to source maps. I'm not sure, I remenber something about the way how source map are generated, (inline, file in a specific folder) and add mapping path in the server to make them acessible.
https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-typescript-aspnetcore/src/skeleton/Startup.cs#L69-L74

Upgrade CometD from 2.4/2.5 to 2.9.1?

Can I expect that I replace the Java .jar files and client-side .js files of version 2.4 or 2.5 of CometD in an existing software that is running fine, with the same files in 2.9.1 and it all runs the same?
1- Are the API of CometD exactly the same on all 2.x versions?
2- Is there an upgrade guide that I can use?
Also, I noticed that on the client side, CometD 2.4/2.5 is not AMD and is a single file, but on 2.9.1 it is AMD-based. Is there a single .js file that contains all client-side CometD code?
You can expect upgrades from 2.4/2.5 to 2.9.x to be either without problems, or requiring very little changes, so yes, it should be typically be a drop-in replacement.
While you're upgrading, I suggest to move to CometD 3. You can find here the migration guide from CometD 2.x.
CometD 2.9.x is AMD compliant, and the single file you should include in your HTML is typically org/cometd.js along with a binding for a toolkit (either jquery or dojo).
If you use extensions, you should add also those, see for example http://docs.cometd.org/3/reference/#_primer, or if you don't want to use Maven, this other section.
Follow also the tutorials, that should get you going.
Full documentation link.

Features and Configuration of the Typescript Eclipse Plugin

I'm interested in developing with typescript on linux. So I found the above mentioned plugin. I installed eclipse and also the eclipse-typescript plugin as described here. Now I can edit typescript files and see the highlighting. But it is not possible to debug a script. When I try to debug it, there is no debug configuration available.
Is the plugin able to debug a typescript?
I also read in this wiki, but this single page doesn't help me. I googled around and did not found any howto or help...
Thanks
Is the plugin able to debug a typescript?
It isn't supported. Based on my empirical (but certain) observation of : https://github.com/palantir/eclipse-typescript/tree/master/Bridge/src
You could debug the generated JavaScript though (and I highly recommend you do that anyways). And in fact learn to use google chrome debug tools (you'll thank me someday) since they have a live edit and continue, repl, profiler etc.
Alternatively you can try WebStorm which fully supports debugging TypeScript on linux.
At the same time, TypEcs (another TypeScript plugin for Eclipse) features debugging - http://typecsdev.com/. The plugin supports two modes of TypeScript debug:
Standalone: this mode is suitable for debugging server-side NodeJS applications written on TypeScript,
Web Remote: this mode is connected to Google Chrome web browser and allows you to debug TypeScript web application.
So you can try this one.

Can a qunit Tests case be written in ecplise?

Recently i have given a task of Qunit with Eclipse plugin.I could find the information regarding the tests cases written in Qunit and the conversion and building the solution for it in JS-test runner using Quint-Adaptaer. But My Question is do i have any Environment in ecplise where i can write tests cases in Qunit and run with JS-Test Runner?
I think you are asking about a development tools for JavaScript. I would recommend installing VJet. This provides tools like a JS editor, content assist, navigation, hovers, validation, etc.
See the page here for more information:
http://www.eclipse.org/vjet/
Here is the update site to use to install:
http://download.eclipse.org/vjet/updates-0.9
If you need advanced content assist for QUnit (or other JavaScript frameworks like Angular, dojo, jQuery, node, etc), I suggest you that you install tern.java 0.10.0-SNAPSHOT (not released today). The 0.10.0 tern.java version provides a support for QUnit:

How can I automate Node.js deployments?

I'm looking for something analogous to Capistrano for Rails - https://github.com/capistrano/capistrano/wiki/
I'd like to be able to run a single command from my workstation that will update the code on my server(s) from a GitHub project and handle all necessary process restarting for the application. I need to be able to control specifically when this happens, not use a hook in GitHub's checkin event.
Are Node.js developers also using Capistrano, or is there a tool that works better for Node.js?
You could use fabric, it's a python lib. Nodejs already uses python for some build operations for extensions, no reason you couldn't also use python to do what you're asking.
http://docs.fabfile.org/en/1.2.2/index.html
I don't know of a javascript lib that does this, not to say there isn't one though. Fabric sounds very much like what capistrano is, but maybe a tiny bit different in some aspects.
Capistrano seems to be the most popular choice.