Socket
Socket
Sign inDemoInstall

riot-compiler

Package Overview
Dependencies
1
Maintainers
4
Versions
50
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.0-beta.6 to 2.3.0

test/specs/parsers/js/test-attr.babel.js

11

dist/compiler.js

@@ -1,2 +0,2 @@

/* riot-compiler 2.3.0-beta.6, @license MIT, (c) 2015 Muut Inc. + contributors */
/* riot-compiler 2.3.0, @license MIT, (c) 2015 Muut Inc. + contributors */
;(function (root, factory) {

@@ -38,2 +38,5 @@

case 'es6':
req = 'babel'
break
case 'babel':
req = 'babel-core'

@@ -90,8 +93,8 @@ break

return _req('es6').transform(js, {
presets: ['es2015'], ast: false, sourceMaps: false, comments: false
blacklist: ['useStrict', 'react'], sourceMaps: false, comments: false
}).code
},
babel: /* istanbul ignore next */ function (js) {
babel: function (js) {
return _req('babel').transform(js, {
blacklist: ['useStrict', 'react'], sourceMaps: false, comments: false
presets: ['es2015'], ast: false, sourceMaps: false, comments: false
}).code

@@ -98,0 +101,0 @@ },

/**
* Compiler for riot custom tags
* @version 2.3.0-beta.6
* @version 2.3.0
*/

@@ -61,8 +61,8 @@

return _req('es6').transform(js, {
presets: ['es2015'], ast: false, sourceMaps: false, comments: false
blacklist: ['useStrict', 'react'], sourceMaps: false, comments: false
}).code
},
babel: /* istanbul ignore next */ function (js) {
babel: function (js) {
return _req('babel').transform(js, {
blacklist: ['useStrict', 'react'], sourceMaps: false, comments: false
presets: ['es2015'], ast: false, sourceMaps: false, comments: false
}).code

@@ -69,0 +69,0 @@ },

# Backslashes and Whitespace
From the perspective of the riot compiler and `tmpl`, backslashes within the template are characters without special meaning, except when prefixed to riot brackets. `tmpl` removes the escape character from the riot brackets when compiling the template, the other backslashes are preserved. EOLs are converted to spaces and compacted. This happens in the quoted HTML text and element values, inclusive.
From the perspective of the riot compiler and `tmpl`, backslashes in the template are characters without special meaning, the compiler preserves this in the HTML, and remove inside the expressions.
EOLs are converted to spaces and compacted. This happens in the quoted HTML text and the element values.
In strings and regexes inside expressions, whitespace are preserved.
//#if NODE
//#undef RIOT
/* riot-compiler 2.3.0-beta.6, @license MIT, (c) 2015 Muut Inc. + contributors */
/* riot-compiler 2.3.0, @license MIT, (c) 2015 Muut Inc. + contributors */
;(function (root, factory) {

@@ -25,3 +25,3 @@

* Compiler for riot custom tags
* @version 2.3.0-beta.6
* @version 2.3.0
*/

@@ -28,0 +28,0 @@ //#endif

@@ -27,2 +27,5 @@ /**

case 'es6':
req = 'babel'
break
case 'babel':
req = 'babel-core'

@@ -100,8 +103,8 @@ break

return _req('es6').transform(js, {
presets: ['es2015'], ast: false, sourceMaps: false, comments: false
blacklist: ['useStrict', 'react'], sourceMaps: false, comments: false
}).code
},
babel: /* istanbul ignore next */ function (js) {
babel: function (js) {
return _req('babel').transform(js, {
blacklist: ['useStrict', 'react'], sourceMaps: false, comments: false
presets: ['es2015'], ast: false, sourceMaps: false, comments: false
}).code

@@ -108,0 +111,0 @@ },

{
"name": "riot-compiler",
"version": "2.3.0-beta.6",
"version": "2.3.0",
"description": "Compiler for riot .tag files",

@@ -31,3 +31,3 @@ "main": "dist/compiler.js",

"dependencies": {
"riot-tmpl": "^2.3.0-beta.8"
"riot-tmpl": "^2.3.0"
},

@@ -34,0 +34,0 @@ "devDependencies": {

@@ -22,2 +22,9 @@ [![Build Status][travis-image]][travis-url]

### For babel users
Due to recent changes in the babel API, from v2.3.0-beta.7 we are supporting `babel` versions previous to 6.0.2 through `parsers.css.es6` (`<script type="es6">`), new versions are not compatible with the node API.
For `babel-core`, please use the new `parsers.css.babel` (`<script type="babel">`). You must `npm install babel-preset-es2015` too, for this works.
[travis-image]:https://img.shields.io/travis/riot/compiler.svg?style=flat-square

@@ -24,0 +31,0 @@ [travis-url]:https://travis-ci.org/riot/compiler

@@ -95,3 +95,3 @@ //

this.timeout(20000) // first call to babel-core is slooooow!
this.timeout(25000) // first call to babel-core is slooooow!

@@ -145,3 +145,3 @@ // complex.tag

// testParser.es6.tag
it('es6 (babel-core 6.0.2+)', function () {
it('es6 (for babel 5.8.x)', function () {
if (have('es6')) {

@@ -152,6 +152,14 @@ testParser('test', { type: 'es6' })

// testParser.es6.tag
/*
it('new css.babel parser (babel-core 6.0.2+)', function () {
if (have('babel')) {
testParser('test', { type: 'babel' })
}
})*/
// testParser-attr.es6.tag
it('es6 with shorthands (fix #1090)', function () {
if (have('es6')) {
testParser('test-attr', { type: 'es6', expr: true })
it('babel with shorthands (fix #1090)', function () {
if (have('babel')) {
testParser('test-attr', { type: 'babel', expr: true })
}

@@ -158,0 +166,0 @@ })

@@ -27,3 +27,3 @@ describe('Scoped CSS', function() {

})
it('add my-tag to the selector with a backslash', function() {
it('add my-tag to the selector with a pseudo-class', function() {
expect(render('a:after { content: "*" }'))

@@ -44,3 +44,3 @@ .to.equal('my-tag a:after,[riot-tag="my-tag"] a:after { content: "*" }')

})
it('add my-tag to the root selector with attr', function() {
it('add my-tag to the root selector with attribute', function() {
expect(render(':scope[disabled] { color: gray }'))

@@ -65,3 +65,3 @@ .to.equal('my-tag[disabled],[riot-tag="my-tag"][disabled] { color: gray }')

})
it('not add my-tag to parsentage values in @keyframes', function() {
it('not add my-tag to parcentage values in @keyframes', function() {
expect(render('@keyframes fade { 10% { opacity: 1; } 85% { opacity: 0; } }'))

@@ -68,0 +68,0 @@ .to.equal('@keyframes fade { 10% { opacity: 1; } 85% { opacity: 0; } }')

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc