Skip to content

Commit

Permalink
Merge pull request #166 from lightning-js/dev
Browse files Browse the repository at this point in the history
Release 1.4.2
  • Loading branch information
michielvandergeest authored Sep 24, 2024
2 parents 241d085 + 2aa7701 commit 99e30b5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v1.4.2

_24 sept 2024_

- Fixed timing issue with calculation of percentages
- Improved check to see if object is a Blits component, so it's more robust in case of code minification

## v1.4.1

_18 sept 2024_
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightningjs/blits",
"version": "1.4.1",
"version": "1.4.2",
"description": "Blits: The Lightning 3 App Development Framework",
"bin": "bin/index.js",
"exports": {
Expand Down
3 changes: 3 additions & 0 deletions src/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ const Component = (name = required('name'), config = required('config')) => {
// during the code generation step
factory.config = config

// To determine whether dynamic component is actual Blits component or not
factory[symbols.isComponent] = true

return factory
}

Expand Down
6 changes: 3 additions & 3 deletions src/engines/L3/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ const parsePercentage = function (v, base) {
return v
} else if (v.indexOf('%') === v.length - 1) {
return (
this.element.parent &&
this.element.parent[base] &&
this.element.parent[base] * (parseFloat(v) / 100)
(this.element.config.parent &&
(this.element.config.parent.node[base] || 0) * (parseFloat(v) / 100)) ||
0
)
}
return v
Expand Down
2 changes: 1 addition & 1 deletion src/lib/codegenerator/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ const generateComponentCode = function (
if(!component${counter}) {
throw new Error('Component "${templateObject[Symbol.for('componentType')]}" not found')
}
} else if(typeof componentType === 'function' && componentType.name === 'factory') {
} else if(typeof componentType === 'function' && componentType[Symbol.for('isComponent')] === true) {
component${counter} = componentType
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib/symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ export default {
slots: Symbol.for('slots'),
// Symbol 'componentType' utilized within generated code
componentType: Symbol.for('componentType'),
// Symbol 'isComponent' utilized within generated code
isComponent: Symbol.for('isComponent'),
}

0 comments on commit 99e30b5

Please sign in to comment.