Julia 0.5.0 发布了,本次更新包括了很多新的语言特性。




澳门新葡亰8455下载app 1


Babel plugin for Vue 2.0 JSX



  • Assumes you are using Babel with a module bundler e.g. Webpack,
    because the spread merge helper is imported as a module to avoid

  • This is mutually exclusive with babel-plugin-transform-react-jsx.

  • Generator expressions: `f(i) for i in 1:n` ([#4470]). This
    returns an iterator that computes the specified values on demand.
    This is useful for computing, e.g.

  • `sum(f(i) for i in 1:n)` without creating an intermediate array of

  • Generators and comprehensions support filtering using `if`
    ([#550]) and nested iteration using multiple `for` keywords

  • Fused broadcasting syntax: “f.(args…)“ is equivalent to
    “broadcast(f, args…)“ ([#15032]), and nested
    `f.(g.(args…))` calls are fused into a single `broadcast` loop

  • Similarly, the syntax `x .= …` is equivalent to a
    `broadcast!(identity, x, …)`call and fuses with nested “dot”
    calls; also, `x .+= y` and similar is now equivalent to `x .= x
    .+ y`, rather than `x = x .+ y` ([#17510]).

  • Macro expander functions are now generic, so macros can have
    multiple definitions(e.g. for different numbers of arguments, or
    optional arguments) ([#8846], [#9627]).

  • However note that the argument types refer to the syntax tree
    representation, and not to the types of run time values.

  • Varargs functions like `foo{T}(x::T…)` may now restrict the
    number of such arguments using `foo{T,N}(x::Vararg{T,N})`

  • `x ∈ X` is now a synonym for `x in X` in `for` loops and
    comprehensions, as it already was in comparisons ([#13824]).

  • The `PROGRAM_FILE` global is now available for determining the
    name of the running script ([#14114]).

  • The syntax `x.:sym` (e.g. `Base.:+`) is now supported, while
    using `x.(:sym)` or `x.(i)` for field access are deprecated in
    favor of `getfield` ([#15032]).

  • Function return type syntax `function f()::T` has been added
    ([#1090]). Values returned from a function with such a
    declaration will be converted to the specified type `T`.

  • Many more operators now support `.` prefixes (e.g. `.≤`)
    ([#17393]).  However, users are discouraged from overloading
    these, since they are mainly parsed in order to implement backwards
    compatibility with planned automatic broadcasting of dot operators
    in Julia 0.6 ([#16285]).  Explicitly qualified operator names
    like `Base.≤` should now use `Base.:≤` (prefixed by
    `@compat` if you need 0.4 compatibility via the `Compat`

  • User-extensible bounds check elimination is now possible with the
    new `@boundscheck` macro ([#14474]). This macro marks bounds
    checking code blocks, which the compiler may remove when encountered
    inside an `澳门新葡亰8455下载app,@inbounds` call.


npm install

In your .babelrc:

  "presets": ["es2015"],
  "plugins": ["transform-vue-jsx"]

The plugin transpiles the following JSX:

<div id="foo">{this.text}</div>

To the following JavaScript:

h('div', {
  attrs: {
    id: 'foo'
}, [this.text])

Note the h function, which is a shorthand for a Vue instance’s
$createElement method, must be in the scope where the JSX is. Since
this method is passed to component render functions as the first
argument, in most cases you’d do this:

Vue.component('jsx-example', {
  render (h) { // <-- h must be in scope
    return <div id="foo">bar</div>


h auto-injection

Starting with version 3.4.0 we automatically inject
const h = this.$createElement in any method and getter (not functions
or arrow functions) declared in ES2015 syntax that has JSX so you can
drop the (h) parameter.

Vue.component('jsx-example', {
  render () { // h will be injected
    return <div id="foo">bar</div>
  myMethod: function () { // h will not be injected
    return <div id="foo">bar</div>
  someOtherMethod: () => { // h will not be injected
    return <div id="foo">bar</div>

class App extends Vue {
  get computed () { // h will be injected
    return <div id="foo">bar</div>