@@ -26242,7 +26242,8 @@ Component.prototype = {
2624226242
2624326243 // Parse the new value into attrValue (re-using objects where possible)
2624426244 var newAttrValue = key ? this.attrValue[key] : this.attrValue;
26245- newAttrValue = parseProperty(newValue, propertySchema, newAttrValue);
26245+ // Some property types (like selectors) depend on external state (e.g. DOM) during parsing and can't be cached.
26246+ newAttrValue = propertySchema.isCacheable ? parseProperty(newValue, propertySchema, newAttrValue) : newValue;
2624626247 // In case the output is a string, store the unparsed value (no double parsing and helps inspector)
2624726248 if (typeof newAttrValue === 'string') {
2624826249 // Quirk: empty strings aren't considered values for single-property schemas
@@ -26654,7 +26655,6 @@ module.exports.registerGeometry = function (name, definition) {
2665426655
2665526656var coordinates = __webpack_require__(/*! ../utils/coordinates */ "./src/utils/coordinates.js");
2665626657var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js");
26657- var error = debug('core:propertyTypes:warn');
2665826658var warn = debug('core:propertyTypes:warn');
2665926659var propertyTypes = module.exports.propertyTypes = {};
2666026660var nonCharRegex = /[,> .[\]:]/;
@@ -26665,15 +26665,15 @@ registerPropertyType('audio', '', assetParse);
2666526665registerPropertyType('array', [], arrayParse, arrayStringify, arrayEquals);
2666626666registerPropertyType('asset', '', assetParse);
2666726667registerPropertyType('boolean', false, boolParse);
26668- registerPropertyType('color', '#FFF', defaultParse, defaultStringify );
26668+ registerPropertyType('color', '#FFF');
2666926669registerPropertyType('int', 0, intParse);
2667026670registerPropertyType('number', 0, numberParse);
2667126671registerPropertyType('map', '', assetParse);
2667226672registerPropertyType('model', '', assetParse);
26673- registerPropertyType('selector', null, selectorParse, selectorStringify);
26674- registerPropertyType('selectorAll', null, selectorAllParse, selectorAllStringify);
26673+ registerPropertyType('selector', null, selectorParse, selectorStringify, defaultEquals, false );
26674+ registerPropertyType('selectorAll', null, selectorAllParse, selectorAllStringify, arrayEquals, false );
2667526675registerPropertyType('src', '', srcParse);
26676- registerPropertyType('string', '', defaultParse, defaultStringify );
26676+ registerPropertyType('string', '');
2667726677registerPropertyType('time', 0, intParse);
2667826678registerPropertyType('vec2', {
2667926679 x: 0,
@@ -26701,16 +26701,18 @@ registerPropertyType('vec4', {
2670126701 * @param {function} [parse=defaultParse] - Parse string function.
2670226702 * @param {function} [stringify=defaultStringify] - Stringify to DOM function.
2670326703 * @param {function} [equals=defaultEquals] - Equality comparator.
26704+ * @param {boolean} [cachable=false] - Whether or not the parsed value of a property can be cached.
2670426705 */
26705- function registerPropertyType(type, defaultValue, parse, stringify, equals) {
26706+ function registerPropertyType(type, defaultValue, parse, stringify, equals, cacheable ) {
2670626707 if (type in propertyTypes) {
2670726708 throw new Error('Property type ' + type + ' is already registered.');
2670826709 }
2670926710 propertyTypes[type] = {
2671026711 default: defaultValue,
2671126712 parse: parse || defaultParse,
2671226713 stringify: stringify || defaultStringify,
26713- equals: equals || defaultEquals
26714+ equals: equals || defaultEquals,
26715+ isCacheable: cacheable !== false
2671426716 };
2671526717}
2671626718module.exports.registerPropertyType = registerPropertyType;
@@ -28420,6 +28422,7 @@ function processPropertyDefinition(propDefinition, componentName) {
2842028422 propDefinition.parse = propDefinition.parse || propType.parse;
2842128423 propDefinition.stringify = propDefinition.stringify || propType.stringify;
2842228424 propDefinition.equals = propDefinition.equals || propType.equals;
28425+ propDefinition.isCacheable = propDefinition.isCacheable === true || propType.isCacheable;
2842328426
2842428427 // Fill in type name.
2842528428 propDefinition.type = typeName;
@@ -30340,7 +30343,7 @@ __webpack_require__(/*! ./core/a-mixin */ "./src/core/a-mixin.js");
3034030343// Extras.
3034130344__webpack_require__(/*! ./extras/components/ */ "./src/extras/components/index.js");
3034230345__webpack_require__(/*! ./extras/primitives/ */ "./src/extras/primitives/index.js");
30343- console.log('A-Frame Version: 1.5.0 (Date 2024-04-25 , Commit #c4f491bb )');
30346+ console.log('A-Frame Version: 1.5.0 (Date 2024-05-03 , Commit #9fe641ce )');
3034430347console.log('THREE Version (https://github.com/supermedium/three.js):', pkg.dependencies['super-three']);
3034530348console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);
3034630349
0 commit comments