@riotjs/compiler
Advanced tools
Comparing version 4.0.0-alpha.17 to 4.0.0-alpha.18
# Compiler Changes | ||
### v4.0.0-alpha.18 | ||
- Add the `name` key to the tag exports | ||
- Fix self-closed tag bindings | ||
### v4.0.0-alpha.17 | ||
@@ -4,0 +8,0 @@ - Remove unused dev dependencies |
@@ -12,2 +12,3 @@ /* Riot Compiler WIP, @license MIT */ | ||
const TAG_TEMPLATE_PROPERTY = 'template'; | ||
const TAG_NAME_PROPERTY = 'name'; | ||
@@ -1153,3 +1154,3 @@ const types = recast.types; | ||
function groupSlots(sourceNode) { | ||
return sourceNode.nodes.reduce((acc, node) => { | ||
return getChildrenNodes(sourceNode).reduce((acc, node) => { | ||
const slotAttribute = findSlotAttribute(node); | ||
@@ -1756,2 +1757,3 @@ | ||
* Create the initial AST | ||
* @param {string} tagName - the name of the component we have compiled | ||
* @returns { AST } the initial AST | ||
@@ -1762,3 +1764,3 @@ * | ||
*/ | ||
function createInitialInput() { | ||
function createInitialInput({tagName}) { | ||
/* | ||
@@ -1777,3 +1779,4 @@ generates | ||
simplePropertyNode(TAG_LOGIC_PROPERTY, nullNode()), | ||
simplePropertyNode(TAG_TEMPLATE_PROPERTY, nullNode()) | ||
simplePropertyNode(TAG_TEMPLATE_PROPERTY, nullNode()), | ||
simplePropertyNode(TAG_NAME_PROPERTY, builders.literal(tagName)) | ||
]) | ||
@@ -1864,3 +1867,3 @@ )] | ||
hookGenerator(css, css$$1, code, meta), | ||
)(createInitialInput()) | ||
)(createInitialInput(meta)) | ||
} | ||
@@ -1867,0 +1870,0 @@ |
@@ -19,2 +19,3 @@ /* Riot Compiler WIP, @license MIT */ | ||
const TAG_TEMPLATE_PROPERTY = 'template'; | ||
const TAG_NAME_PROPERTY = 'name'; | ||
@@ -1160,3 +1161,3 @@ const types = recast.types; | ||
function groupSlots(sourceNode) { | ||
return sourceNode.nodes.reduce((acc, node) => { | ||
return getChildrenNodes(sourceNode).reduce((acc, node) => { | ||
const slotAttribute = findSlotAttribute(node); | ||
@@ -1763,2 +1764,3 @@ | ||
* Create the initial AST | ||
* @param {string} tagName - the name of the component we have compiled | ||
* @returns { AST } the initial AST | ||
@@ -1769,3 +1771,3 @@ * | ||
*/ | ||
function createInitialInput() { | ||
function createInitialInput({tagName}) { | ||
/* | ||
@@ -1784,3 +1786,4 @@ generates | ||
simplePropertyNode(TAG_LOGIC_PROPERTY, nullNode()), | ||
simplePropertyNode(TAG_TEMPLATE_PROPERTY, nullNode()) | ||
simplePropertyNode(TAG_TEMPLATE_PROPERTY, nullNode()), | ||
simplePropertyNode(TAG_NAME_PROPERTY, builders.literal(tagName)) | ||
]) | ||
@@ -1871,3 +1874,3 @@ )] | ||
hookGenerator(css, css$$1, code, meta), | ||
)(createInitialInput()) | ||
)(createInitialInput(meta)) | ||
} | ||
@@ -1874,0 +1877,0 @@ |
{ | ||
"name": "@riotjs/compiler", | ||
"version": "4.0.0-alpha.17", | ||
"version": "4.0.0-alpha.18", | ||
"description": "Compiler for riot .tag files", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import {builders, types} from '../../utils/build-types' | ||
import {TAG_CSS_PROPERTY} from '../constants' | ||
import {TAG_CSS_PROPERTY} from '../../constants' | ||
import getPreprocessorTypeByAttribute from '../../utils/get-preprocessor-type-by-attribute' | ||
@@ -4,0 +4,0 @@ import preprocess from '../../utils/preprocess-node' |
@@ -1,2 +0,2 @@ | ||
import {TAG_LOGIC_PROPERTY} from '../constants' | ||
import {TAG_LOGIC_PROPERTY} from '../../constants' | ||
import addLinesOffset from '../../utils/add-lines-offset' | ||
@@ -3,0 +3,0 @@ import generateAST from '../../utils/generate-ast' |
@@ -35,3 +35,3 @@ import { | ||
function groupSlots(sourceNode) { | ||
return sourceNode.nodes.reduce((acc, node) => { | ||
return getChildrenNodes(sourceNode).reduce((acc, node) => { | ||
const slotAttribute = findSlotAttribute(node) | ||
@@ -38,0 +38,0 @@ |
import {BINDING_TYPES, EXPRESSION_TYPES, GET_COMPONENT_FN, TEMPLATE_FN} from './constants' | ||
import {builders, types} from '../../utils/build-types' | ||
import {callTemplateFunction, createRootNode} from './utils' | ||
import {TAG_TEMPLATE_PROPERTY} from '../constants' | ||
import {TAG_TEMPLATE_PROPERTY} from '../../constants' | ||
import build from './builder' | ||
@@ -6,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { TAG_CSS_PROPERTY, TAG_LOGIC_PROPERTY, TAG_TEMPLATE_PROPERTY} from './generators/constants' | ||
import { TAG_CSS_PROPERTY, TAG_LOGIC_PROPERTY, TAG_NAME_PROPERTY, TAG_TEMPLATE_PROPERTY } from './constants' | ||
import { nullNode, simplePropertyNode } from './utils/custom-ast-nodes' | ||
@@ -24,2 +24,3 @@ import { register as registerPostproc, execute as runPostprocessors } from './postprocessors' | ||
* Create the initial AST | ||
* @param {string} tagName - the name of the component we have compiled | ||
* @returns { AST } the initial AST | ||
@@ -30,3 +31,3 @@ * | ||
*/ | ||
export function createInitialInput() { | ||
export function createInitialInput({tagName}) { | ||
/* | ||
@@ -45,3 +46,4 @@ generates | ||
simplePropertyNode(TAG_LOGIC_PROPERTY, nullNode()), | ||
simplePropertyNode(TAG_TEMPLATE_PROPERTY, nullNode()) | ||
simplePropertyNode(TAG_TEMPLATE_PROPERTY, nullNode()), | ||
simplePropertyNode(TAG_NAME_PROPERTY, builders.literal(tagName)) | ||
]) | ||
@@ -132,3 +134,3 @@ )] | ||
hookGenerator(cssGenerator, css, code, meta), | ||
)(createInitialInput()) | ||
)(createInitialInput(meta)) | ||
} | ||
@@ -135,0 +137,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1233175
31675