Skip to content

Commit

Permalink
Merge pull request #169 from lightning-js/dev
Browse files Browse the repository at this point in the history
Release 1.4.3
  • Loading branch information
michielvandergeest authored Sep 26, 2024
2 parents 99e30b5 + 03c58d2 commit 02fca17
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 20 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## v1.4.3

_26 sept 2024_

- Fixed issues with sprites in minified production build
- Bumped renderer to v2.2.0 (with fixes for nested alpha / show issue)
- Fixed reactivity in plugins not using reactivity mode setting
- Fixed named slots functionality

## v1.4.2

_24 sept 2024_
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightningjs/blits",
"version": "1.4.2",
"version": "1.4.3",
"description": "Blits: The Lightning 3 App Development Framework",
"bin": "bin/index.js",
"exports": {
Expand Down Expand Up @@ -47,7 +47,7 @@
},
"dependencies": {
"@lightningjs/msdf-generator": "^1.0.2",
"@lightningjs/renderer": "^2.1.2",
"@lightningjs/renderer": "^2.2.0",
"execa": "^8.0.1",
"kolorist": "^1.8.0",
"ora": "^7.0.1",
Expand Down
4 changes: 2 additions & 2 deletions src/engines/L3/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ const Element = {

this.props.element = this

this.props['parent'] = this.config.parent
this.props['parent'] = props['parent'] || this.config.parent
delete props.parent

this.props.raw = data
Expand Down Expand Up @@ -305,7 +305,7 @@ const Element = {
})
}

// if (this.component && this.component.___layout) {
// if (this.component !== undefined && '___layout' in this.component) {
// this.node.on('loaded', () => {
// this.component.___layout()
// })
Expand Down
3 changes: 2 additions & 1 deletion src/lib/codegenerator/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const generateElementCode = function (
Object.keys(templateObject).forEach((key) => {
if (key === 'slot') {
renderCode.push(`
elementConfig${counter}['parent'] = component[Symbol.for('slots')].filter(slot => slot.ref === '${templateObject.slot}').shift() || component[Symbol.for('slots')][0] || parent
elementConfig${counter}['parent'] = component[Symbol.for('slots')].filter(slot => slot.ref === '${templateObject.slot}').shift() || parent
`)
}

Expand Down Expand Up @@ -258,6 +258,7 @@ const generateComponentCode = function (
}
// if (!options.forloop) {
// renderCode.push(`
// // console.log('here', component, rootComponent)
// component = rootComponent
// `)
// }
Expand Down
3 changes: 2 additions & 1 deletion src/lib/reactivity/reactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { ImageTexture } from '@lightningjs/renderer'
import { track, trigger, pauseTracking, resumeTracking } from './effect.js'
import symbols from '../symbols.js'

Expand All @@ -32,7 +33,7 @@ const reactiveProxy = (original, _parent = null, _key) => {
// is assigned to a state variable
if (typeof original === 'object') {
if (original[symbols.id] !== undefined) return original
if (original.constructor.name === '_ImageTexture') return original
if (original.constructor.name === ImageTexture.name) return original
}

// if original object is already a proxy, don't create a new one but return the existing one instead
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/appstate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
*/

import { reactive } from '../lib/reactivity/reactive'
import Settings from '../settings.js'

export default {
name: 'appState',
plugin(state = {}) {
return reactive(state)
return reactive(state, Settings.get('reactivityMode'))
},
}
13 changes: 9 additions & 4 deletions src/plugins/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,21 @@ import fetchJson from '../helpers/fetchJson'
import { Log } from '../lib/log'
import { reactive } from '../lib/reactivity/reactive'

import Settings from '../settings.js'

export default {
name: 'language',
plugin(options = {}) {
let translations = {}
let dictionary = {}

const state = reactive({
language: '',
loaded: 0,
})
const state = reactive(
{
language: '',
loaded: 0,
},
Settings.get('reactivityMode')
)

const setLanguage = (language) => {
// define the dictionary
Expand Down
11 changes: 8 additions & 3 deletions src/plugins/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import { Log } from '../lib/log'
import { reactive } from '../lib/reactivity/reactive.js'

import Settings from '../settings.js'

const getValueByDotNotation = (obj, base, path) => {
const keys = path.split('.')

Expand Down Expand Up @@ -46,9 +48,12 @@ export default {
plugin(config = {}) {
let themeMap = {}

const state = reactive({
current: 'default',
})
const state = reactive(
{
current: 'default',
},
Settings.get('reactivityMode')
)

let themes = {}
let base = null
Expand Down

0 comments on commit 02fca17

Please sign in to comment.