Can I develop atom package with ES6?
I don't want to write CoffeeScript.
Atom reportedly using Chrome and V8, so I think it can use to develop package.
Yes, Atom can compile CoffeeScript, TypeScript, or ES6 (via Babel). To use Babel, just put
'use babel'
at the top of your file. If you only use the subset of ES6 that the version of Chrome that Atom uses implements, you don't even need Babel.
Related
When setting option compile to never in command polymer serve (polymer serve --compile never) I expect that it doesn't transpile my ES6 code to ES5 but it compiles for Firefox and not for Chrome so I believe polymer serve is still using auto as compile option.
Firefox: imports rewritten as define([])
Chrome: imports kept untouched (import {} from)
polymer-cli v1.9.8
EDIT:
All imports are static
Are you talking about static ou dynamic imports?
Because since Firefox does not currently support dynamic import(), polymer serve has to convert them because otherwise the application wouldn't run at all. Even worse than not supporting them, Firefox throws a SyntaxError when they parse JavaScript files and see the aforementioned imports.
In the default polymer.json file I see:
"extraDependencies": [
"bower_components/webcomponentsjs/*.js",
"!bower_components/webcomponentsjs/gulpfile.js",
"manifest.json"
],
The documentation is a little vague about it:
Dependencies that the analyzer component of the Polymer build toolchain can’t discover, possibly because they're not statically imported, and that do not need to be bundled.
Why can't the toolchain discover it?
IF they cannot be discovered, why would we need to include them?
If they "don't need to be bundled", what's actually done with them?
As the documentation says, the toolchain can't discover these files because they are not statically imported. The analyzer only knows about static imports like this:
<link rel="import" href="../bower_components/my-component.html">
Most likely your bower_components/webcomponentsjs/*.js library is being imported dynamically by checking if the browser supports web components natively, and loading in the web components polyfill if not. As for manifest.json, it's not imported as an HTML import, but as a manifest as follows:
<link rel="manifest" href="/manifest.json">
The extraDependencies need to be included if you are using polymer build to make a production build of your app, so the polymer-cli knows to include these files in your build.
The web components js files don't need to be bundled (note that they still need to be added to the build) because you don't want every app coming with the full web components polyfill, when browsers like Chrome already support it natively. The manifest.json should not be bundled because it is a standalone file needed to get metadata for your application.
How to set a Aurelia minimal project for work inside Browser
(no http server) how to set a bare minimum aurelia system/boilerplate
to work just inside browser (no NodeJS)
mainly for understanding/learning purpouses
no NodeJS (using just Javascript from latest browsers, advise Firefox Developper)
no npm (just download latest version and copy minimum files)
no folders (all in root flat folder for clarification and learn purpouses)
just ES6/7 (no Typescript, no Babel, etc)
just CSS use (no SASS, no LESS, etc.)
You should read the Quick Start in the docs and download the Basic Project Setup
However, there's no way to use ES6/7 without Babel (or other js compiler) today.
Take a look at this github repo: aurelia/aurelia which has a simple starter kit with a concatenated script-tag ready build.
Dragging a local folder of files into the devtools adds them to the workspace so that you can persistently edit them. I just discovered the feature. However my files are all Babel transpiled and then I edit a file and hit cmd-s to save the changes Chrome checks the source and trips over es6 import statements with the error: Unexpected token import
Is there a way to make chrome not check the syntax? If it just edited the file without trying to compile it, Babel could pick it up and inject the changes via hot module replacement probably.
I recently watched this presentation named "Debugging the Web" on the new Chrome devtools. At around 15mins he talks about this subject.
Before you could make it work with proper configuration. With this update it should work out of the box!
I want to use slidify with a locally modified version of the revealjs framework instead of the version that's included in the slidifyLibraries package.
I'm working in selfcontained mode, so slidify copies the framework to the local libraries/frameworks folder.
Is there an easy way to tell slidify() to copy files to libraries from a different source than the slidifyLibraries package (similarly to the way I can tell author() to use a custom scaffold?
I can accomplish this by manually copying my local version of the framework into libraries/frameworks, but it would be nice to have slidify do this for me when I run slidify().