Skip to content

Commit

Permalink
updated: deprecate old babel support and new changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
GianlucaGuarini committed Nov 19, 2016
1 parent c138c5c commit 0768e2e
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 68 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ branches:
install:
- npm i jade
- npm i pug
- npm i babel@5.8
- npm i babel-core

# babel presets
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Compiler Changes

### v3.0.0
- Deprecate old `babel` support, now the `es6` parser will use Babel 6 by default
- Change css always scoped by default
- Fix all the `value` attributes using expressions will be output as `riot-value` to [riot#1957](https://github.com/riot/riot/issues/1957)

### v2.5.5
- Fix to erroneous version number in the package.json, v2.5.4 was released before.
- Removed unuseful files from the npm package.
Expand Down
2 changes: 1 addition & 1 deletion lib/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var _parsers = {
var _loaders = {
html: { jade: TRUE, pug: TRUE },
css: { sass: TRUE, scss: TRUE, less: TRUE, stylus: TRUE },
js: { es6: TRUE, babel: TRUE, buble: TRUE, coffee: TRUE, livescript: TRUE, typescript: TRUE }
js: { es6: TRUE, buble: TRUE, coffee: TRUE, livescript: TRUE, typescript: TRUE }
}

_loaders.js.coffeescript = TRUE // 4 the nostalgics
Expand Down
18 changes: 0 additions & 18 deletions lib/parsers/babel.js

This file was deleted.

17 changes: 4 additions & 13 deletions lib/parsers/es6.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Babel and babel-core 5.8.x JS plugin.
babel-core 6.x JS plugin.
Part of the riot-compiler, license MIT
History
Expand All @@ -8,20 +8,11 @@
*/
var
mixobj = require('./_utils').mixobj,
tryreq = require('./_utils').tryreq
parser = require('babel-core')

// istanbul ignore next: throws error if cannot load any
var parser = tryreq('babel') || require('babel-core')
module.exports = function _babel (js, opts, url) {

var defopts = {
blacklist: ['useStrict', 'strict', 'react'],
sourceMaps: false,
comments: false
}

module.exports = function _es6 (js, opts) {

opts = mixobj(defopts, opts)
opts = mixobj({ filename: url }, opts)

return parser.transform(js, opts).code
}
10 changes: 1 addition & 9 deletions src/parsers_br.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,7 @@ var parsers = (function (win) {
}
}
_p.js = {
es6: function (js, opts) {
opts = extend({
blacklist: ['useStrict', 'strict', 'react'],
sourceMaps: false,
comments: false
}, opts)
return _r('babel').transform(js, opts).code
},
babel: function (js, opts, url) {
es6: function (js, opts, url) {
return _r('babel').transform(js, extend({ filename: url }, opts)).code
},
buble: function (js, opts, url) {
Expand Down
7 changes: 0 additions & 7 deletions test/specs/parsers/_suite.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,6 @@ describe('JavaScript parsers', function () {
}
})

// test.babel.tag
it('babel', function () {
if (have('babel')) {
testParser('test', { type: 'babel' })
}
})

// test.buble.tag
it('bublé', function () {
if (have('buble')) {
Expand Down
8 changes: 0 additions & 8 deletions test/specs/parsers/js/test.babel.js

This file was deleted.

3 changes: 3 additions & 0 deletions test/specs/parsers/js/test.es6.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
riot.tag2('es6', '<h3>{test}</h3>', '', '', function(opts) {
'use strict';

var _foo = require('foo');

var type = 'JavaScript';
this.test = 'This is ' + type;
Expand Down
11 changes: 0 additions & 11 deletions test/specs/parsers/test.babel.tag

This file was deleted.

2 changes: 2 additions & 0 deletions test/specs/parsers/test.es6.tag
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

<h3>{ test }</h3>

import { bar } from 'foo'

const type = 'JavaScript'
this.test = `This is ${type}`

Expand Down

0 comments on commit 0768e2e

Please sign in to comment.