Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speedup 3 1 #1438

Merged
merged 355 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
355 commits
Select commit Hold shift + click to select a range
9492b27
Merge remote-tracking branch 'origin/v4' into dsl-speedup
kobezzza Sep 4, 2024
a5d5775
fix: fixed a bug with prop default values
kobezzza Sep 5, 2024
4059f2f
fix: fixed a bug with prop default values
kobezzza Sep 5, 2024
12aec58
Merge remote-tracking branch 'origin/v4' into dsl-speedup
kobezzza Sep 5, 2024
2c3ccdf
fix: fixed an issue with getters and their effect
kobezzza Sep 5, 2024
e77db4d
chore: improved doc
kobezzza Sep 5, 2024
e321f82
chore: updated log
kobezzza Sep 5, 2024
14fcdac
chore: improved doc
kobezzza Sep 5, 2024
2a4c38a
chore: improved doc
kobezzza Sep 5, 2024
d17a546
fix: fixed an issue with @fields
kobezzza Sep 6, 2024
5286a65
chore: use V4_COMPONENT to check whether an object is a component
kobezzza Sep 9, 2024
676ad22
chore: added missing API
kobezzza Sep 9, 2024
751e9fe
chore: removed redundant ts-ignore
kobezzza Sep 9, 2024
6f75125
chore: added doc
kobezzza Sep 9, 2024
a75d2db
chore: componentOriginName -> componentFullName
kobezzza Sep 9, 2024
82376ce
Merge remote-tracking branch 'origin/v4' into dsl-speedup
kobezzza Sep 9, 2024
66058fe
fix: fixed default prop logic
kobezzza Sep 9, 2024
73b5aff
chore: removed redundant logic
kobezzza Sep 9, 2024
b1bcce6
fix: fixed issues with non-objects
kobezzza Sep 10, 2024
4494dca
chore: removed redundant Async contexts
kobezzza Sep 10, 2024
e913e79
fix: fixed an issues with deactivation
kobezzza Sep 10, 2024
d56e992
fix: fixes issues with maps
kobezzza Sep 10, 2024
c0864f4
fix: fixed an issues with Map
kobezzza Sep 12, 2024
21e6c93
fix: props must be initialized after `beforeRuntime`
kobezzza Sep 12, 2024
7eb45d0
fix: fixed errors during synchronization
kobezzza Sep 12, 2024
7526632
Merge remote-tracking branch 'origin/v4' into dsl-speedup
kobezzza Sep 12, 2024
06676f4
chore: fixed eslint
kobezzza Sep 12, 2024
365849f
fix: reverted
kobezzza Sep 12, 2024
26c2bec
fix: reverted
kobezzza Sep 12, 2024
c442539
fix: reverted
kobezzza Sep 13, 2024
ba65d31
feat: added support for property descriptors
kobezzza Sep 13, 2024
873d434
fix: fixes bugs
kobezzza Sep 13, 2024
e65dfac
Merge remote-tracking branch 'origin/v4' into dsl-speedup
kobezzza Sep 13, 2024
29277c4
chore: speedup
kobezzza Sep 13, 2024
cb15e39
fix: fixed isComponent check
kobezzza Sep 13, 2024
d73dfac
refactor: use getters for friendly classes
kobezzza Sep 16, 2024
c106500
Merge branch 'v4' into dsl-speedup
kobezzza Sep 16, 2024
df6111a
refactor: better structure
kobezzza Sep 16, 2024
34f8f39
fix: fixed `once` modifier for hook handlers
kobezzza Sep 16, 2024
453381b
refactor: use Array.toArray
kobezzza Sep 16, 2024
b01a4b2
refactor: test -> shouldInit
kobezzza Sep 16, 2024
afceb80
fix: retrieving information about the observed field should be done i…
kobezzza Sep 17, 2024
dc03f6d
Merge remote-tracking branch 'origin/v4' into dsl-speedup
kobezzza Sep 17, 2024
8bc70ce
fix: don't create abstract smart components
kobezzza Sep 17, 2024
49eed5a
refactor: moved to composition API
kobezzza Sep 20, 2024
e797d77
feat: added a method to determine which specific props have been adde…
kobezzza Sep 24, 2024
90e7b05
chore: added an optimization that prevents watching a prop if it is n…
kobezzza Sep 24, 2024
d6e9a18
chore: stylish fixes
kobezzza Sep 24, 2024
6b08843
Merge branch 'v4' into speedup-2
kobezzza Sep 24, 2024
bcd8206
fix: fixed bugs
kobezzza Sep 24, 2024
5f60ec9
fix: fixed a typo
kobezzza Sep 24, 2024
6854d14
fix: fixed bugs
kobezzza Sep 24, 2024
8f23dd6
fix: fixed `getPassedProps` for functional components
kobezzza Sep 24, 2024
b2c0807
chore: refactoring
kobezzza Sep 24, 2024
eebbf5e
fix: fixed bugs
kobezzza Sep 24, 2024
6be75c6
fix: fixed bugs
kobezzza Sep 24, 2024
a6b6f44
fix: fixed using with a comment' node
kobezzza Sep 24, 2024
e38da6e
fix: fixed beforeCreate/created hooks
kobezzza Sep 24, 2024
9ab389a
fix: fixed bugs
kobezzza Sep 24, 2024
8bf7c33
feat: added support for `renderTracked` & fixed bugs
kobezzza Sep 25, 2024
c71780f
Merge branch 'v4' into dsl-speedup
kobezzza Sep 25, 2024
75f88ee
fix: fixed override
kobezzza Sep 25, 2024
efd3a46
Merge branch 'dsl-speedup' into speedup-2
kobezzza Sep 25, 2024
98be900
chore: optimization
kobezzza Sep 25, 2024
9bb1e2d
refactor: extract to the helper
kobezzza Sep 26, 2024
6772781
chore: fixed eslint
kobezzza Sep 26, 2024
4d0b31f
chore: respect `functional: false` & `functionalWatching: false`
kobezzza Sep 26, 2024
0148ad4
chore: better naming
kobezzza Sep 26, 2024
eedadf2
fix: fixed check
kobezzza Sep 26, 2024
10374ce
chore: optimization
kobezzza Sep 26, 2024
ae3b78f
fix: fixed `modsProp` optimization
kobezzza Sep 26, 2024
135e8f5
chore: stylish fixes
kobezzza Sep 27, 2024
86f3426
chore: refactoring & optimization
kobezzza Sep 27, 2024
a9df80a
chore: removed redundant code
kobezzza Sep 27, 2024
7ad9a73
chore: refactoring
kobezzza Sep 27, 2024
c43cdb7
chore: stylish fixes
kobezzza Sep 27, 2024
f7f2042
chore: removed redundant optimizations
kobezzza Sep 27, 2024
20e5500
chore: stylish fixes
kobezzza Sep 27, 2024
76d47bb
chore: stylish fixes
kobezzza Sep 27, 2024
d41d9b5
chore: stylish fixes
kobezzza Sep 27, 2024
ab3ac2d
chore: fixed eslint
kobezzza Sep 30, 2024
d0cf66d
chore: optimization
kobezzza Sep 30, 2024
ae186f7
chore: optimized accessors initializing
kobezzza Sep 30, 2024
157c40d
chore: refactoring
kobezzza Sep 30, 2024
e95d33c
fix: fixes after refactoring
kobezzza Sep 30, 2024
3d7bad0
chore: optimization
kobezzza Sep 30, 2024
4f5e483
chore: stylish fixes
kobezzza Sep 30, 2024
399bbaa
chore: optimization
kobezzza Sep 30, 2024
07c8381
feat: added the new prop `getPassedHandlers`
kobezzza Oct 1, 2024
ae8aa69
fix: fixed the `emit` optimization
kobezzza Oct 1, 2024
fd62143
chore: optimize event API
kobezzza Oct 2, 2024
aebabb5
chore: optimization
kobezzza Oct 2, 2024
f225aa2
chore: optimization
kobezzza Oct 2, 2024
3ff0c19
chore: optimization
kobezzza Oct 2, 2024
ee92a87
Merge remote-tracking branch 'origin/v4' into speedup-3-1
kobezzza Oct 2, 2024
6d18921
chore: updated tests
kobezzza Oct 2, 2024
b28f6e8
fix: fixes after refactoring
kobezzza Oct 3, 2024
53a9c55
fix: fixes after refactoring
kobezzza Oct 3, 2024
099f6b0
chore: updated tests
kobezzza Oct 3, 2024
7dcfd77
chore: removed only
kobezzza Oct 3, 2024
533f467
chore: updated tests
kobezzza Oct 3, 2024
52e9de6
Merge remote-tracking branch 'origin/v4' into speedup-3-1
kobezzza Oct 3, 2024
78b814c
chore: removed redundant normalization
kobezzza Oct 3, 2024
c8f8c65
chore: optimization
kobezzza Oct 3, 2024
d8660b0
fix: fixes after refactoring
kobezzza Oct 3, 2024
6a8322e
fix: reverted br
kobezzza Oct 3, 2024
7094997
fix: fixes after refactoring
kobezzza Oct 3, 2024
8b04aef
fix: updated tests
kobezzza Oct 3, 2024
fa8e7b2
fix: init dependencies on created
kobezzza Oct 3, 2024
64711bc
Merge remote-tracking branch 'origin/v4' into speedup-3-1
kobezzza Oct 3, 2024
13f1e01
chore: optimization
kobezzza Oct 4, 2024
2b968a6
refactor: extract @watch from factory
kobezzza Oct 8, 2024
540f298
chore: stylish fixes
kobezzza Oct 8, 2024
41b593c
chore: better typings
kobezzza Oct 8, 2024
43ff8c4
refactor: extract @field/@system from factory
kobezzza Oct 8, 2024
4ea39f6
refactor: extract @prop from factory
kobezzza Oct 8, 2024
3cbcd00
chore: stylish fixes
kobezzza Oct 8, 2024
4180a15
refactor: extract @hook from factory
kobezzza Oct 8, 2024
cee9cfd
refactor: extract @computed from factory
kobezzza Oct 8, 2024
6cc363f
fix: fixes after refactoring
kobezzza Oct 9, 2024
378fda6
refactor: optimized meta creation
kobezzza Oct 9, 2024
ee10fba
chore: better naming
kobezzza Oct 9, 2024
7f5bf30
fix: fixes after refactoring & optimization
kobezzza Oct 9, 2024
ae2e788
fix: better use init
kobezzza Oct 9, 2024
ffdf936
chore: optimization
kobezzza Oct 9, 2024
86636ee
chore: optimization
kobezzza Oct 9, 2024
621dba8
chore: optimization
kobezzza Oct 9, 2024
fee0eaf
chore: optimization
kobezzza Oct 9, 2024
57c287f
chore: refactoring & optimization
kobezzza Oct 10, 2024
739f8e8
fix: fixes after refactoring
kobezzza Oct 10, 2024
fccb862
fix: fixes after refactoring
kobezzza Oct 14, 2024
b916fb6
fix: fixes after refactoring
kobezzza Oct 14, 2024
391cf40
fix: fixes propName normalization
kobezzza Oct 15, 2024
b0ca336
fix: fixes after refactoring
kobezzza Oct 15, 2024
4e05cff
fix: fixes prop normalization
kobezzza Oct 15, 2024
b772ee9
fix: fixes after refactoring
kobezzza Oct 15, 2024
5c08c79
fix: fixes after refactoring
kobezzza Oct 15, 2024
a417b31
chore: stylish fixes
kobezzza Oct 15, 2024
ab0dd8f
feat: added the new @defaultValue decorator
kobezzza Oct 16, 2024
d146329
feat: added a transformer for registering default values on component…
kobezzza Oct 16, 2024
19e5de8
docs: added doc
kobezzza Oct 16, 2024
fb0f740
docs: improved doc
kobezzza Oct 16, 2024
854e5a7
chore: fixed a typo
kobezzza Oct 16, 2024
76e45c7
docs: improved doc
kobezzza Oct 16, 2024
8b4c325
refactor: prefer constructor
kobezzza Oct 16, 2024
d34170e
chore: optimized default values
kobezzza Oct 16, 2024
1fe0b82
fix: fixed issues with static properties
kobezzza Oct 16, 2024
be52946
refactor: improved DSL transformer
kobezzza Oct 17, 2024
1274c41
chore: improved doc
kobezzza Oct 17, 2024
1026cbe
chore: optimized dsl decorators
kobezzza Oct 17, 2024
f1176ca
feat: added a new decorator `method`
kobezzza Oct 17, 2024
ec1b559
feat: added a new decorator @derive for components
kobezzza Oct 17, 2024
49072bc
chore: use new @derive
kobezzza Oct 17, 2024
30db8c5
chore: removed `addMethodsToMeta`
kobezzza Oct 17, 2024
571a66e
chore: stylish fixes
kobezzza Oct 17, 2024
b75754e
chore: optimized meta inheritance
kobezzza Oct 17, 2024
1be8853
chore: review
kobezzza Oct 17, 2024
5be5ddd
feat: added support for `this` within default values
kobezzza Oct 17, 2024
9ae28af
chore: optimization
kobezzza Oct 17, 2024
9e5263c
fix: reg methods after properties
kobezzza Oct 17, 2024
bfcb971
fix: fix after refactoring
kobezzza Oct 17, 2024
62d56bf
fix: reverted after:bindConstructor
kobezzza Oct 17, 2024
15d7293
chore: stylish fixes
kobezzza Oct 17, 2024
246d4a8
chore: stylish fixes
kobezzza Oct 20, 2024
d4c009c
chore: stylish fixes
kobezzza Oct 20, 2024
a19c306
fix: fixed overriding
kobezzza Oct 21, 2024
5b93191
chore: optimization
kobezzza Oct 21, 2024
bdd54c1
chore: optimization
kobezzza Oct 21, 2024
05fb9ec
refactor: generate getters/setters using transformers
kobezzza Oct 21, 2024
8e26952
fix: fixed modifier initializing
kobezzza Oct 21, 2024
1236082
fix: fixes after refactoring
kobezzza Oct 22, 2024
827e092
fix: provide parameters to setter
kobezzza Oct 22, 2024
a53ceb4
chore: added FIXME & stylish fixes
kobezzza Oct 22, 2024
c9e41d0
Merge remote-tracking branch 'origin/v4' into speedup-3-1
kobezzza Oct 22, 2024
95ddc36
fix: fixes after refactoring
kobezzza Oct 22, 2024
4d3e763
fix: fixed prop normalization
kobezzza Oct 23, 2024
44d1329
fix: fixes after refactoring
kobezzza Oct 23, 2024
74565de
chore: reverted methods from prototype for functional components
kobezzza Oct 23, 2024
b750eb2
fix: don't provide internal props
kobezzza Oct 23, 2024
9e06bb9
fix: fixes after refactoring
kobezzza Oct 23, 2024
ea8ba1b
fix: fixes after refactoring
kobezzza Oct 24, 2024
3986851
chore: stylish fixes
kobezzza Oct 25, 2024
35ff0df
chore: stylish fixes
kobezzza Oct 25, 2024
8ebbe15
fix: theme initialization
kobezzza Oct 25, 2024
84fc757
fix: merging modifiers
kobezzza Oct 25, 2024
82394d3
fix: avoid Vue warnings
kobezzza Oct 25, 2024
45b6b27
fix: merging state
kobezzza Oct 25, 2024
a7bc3e8
chore: optimization
kobezzza Oct 25, 2024
03a519a
chore: stylish fixes
kobezzza Oct 25, 2024
184e46a
fix: node can be null
kobezzza Oct 25, 2024
c907994
fix: fixed the test
kobezzza Oct 25, 2024
c32cc59
fix: theme initializing
kobezzza Oct 25, 2024
79c66ec
fix: fixed functional default values
kobezzza Oct 25, 2024
59d6edb
fix: fixed functional default values
kobezzza Oct 25, 2024
535d980
fix: fixed initializing of getter dependencies
kobezzza Oct 25, 2024
2d05e67
fix: fixed initializing of getter dependencies
kobezzza Oct 29, 2024
981fcea
fix: initializing order
kobezzza Oct 29, 2024
c5aae9c
chore: stylish fixes
kobezzza Oct 29, 2024
a688818
fix: fixed computed overriding
kobezzza Nov 1, 2024
1677d0e
refactor: optimization from speedup-3-2
kobezzza Nov 6, 2024
b2ac699
chore: fixed test
kobezzza Nov 6, 2024
5cbcc9a
Merge remote-tracking branch 'origin/v4' into speedup-3-1
kobezzza Nov 6, 2024
7231e88
chore: updated example
kobezzza Nov 6, 2024
3fef7cf
refactor: removed `forceDefault` & `defaultProps`; now `getPassedProp…
kobezzza Nov 7, 2024
bfdc475
chore: provide `isPros` for vue sfc
kobezzza Nov 7, 2024
6d9ddf4
refactor: removed idle initializing
kobezzza Nov 7, 2024
245f349
chore: stylish fixes
kobezzza Nov 7, 2024
d7f14aa
refactor: use instance
kobezzza Nov 7, 2024
94d0baa
chore: fixed linters
kobezzza Nov 7, 2024
bae7f06
chore: improved TS type inferring
kobezzza Nov 7, 2024
66221b4
chore: fixed linters
kobezzza Nov 7, 2024
c3e93dd
chore: fixed linters
kobezzza Nov 7, 2024
7a12767
refactor: simplify types
kobezzza Nov 7, 2024
174a1fc
chore: optimization
kobezzza Nov 8, 2024
11cb6b8
chore: added log
kobezzza Nov 8, 2024
1802747
chore: doc fixes
kobezzza Nov 8, 2024
d60ef21
refactor: use only native idle
kobezzza Nov 8, 2024
28ffe28
chore: added memoization
kobezzza Nov 8, 2024
40ecc92
chore: removed idle
kobezzza Nov 8, 2024
1e848cf
feat: added a static property graph for use in synchronous code
kobezzza Nov 8, 2024
f30c0f9
BREAKING_CHANGE: the passing of the component graph to the runtime ha…
kobezzza Nov 8, 2024
6971afb
chore: added support for the hint in dontWaitRemoteProviders
kobezzza Nov 8, 2024
081128a
refactor: don't use config.componentes
kobezzza Nov 8, 2024
ef6b949
chore: removed dead code
kobezzza Nov 8, 2024
ae1af2f
fix: fixed s typo
kobezzza Nov 8, 2024
ad20b16
chore: fixed linters
kobezzza Nov 8, 2024
506b417
chore: updated log
kobezzza Nov 8, 2024
3913e56
chore: better name
kobezzza Nov 8, 2024
9052b6e
chore: don't store initializers
kobezzza Nov 8, 2024
a956271
chore: added ExclamationToken
kobezzza Nov 8, 2024
3c819c0
chore: generate getters/setters dynamically
kobezzza Nov 8, 2024
d35c161
fix: fixes after refactoring
kobezzza Nov 9, 2024
5002600
Update CHANGELOG.md
kobezzza Nov 12, 2024
fabf43b
Speedup 3 1 shared mods (#1486)
kobezzza Nov 13, 2024
2c0edeb
chore: methods for accessors, such as fooGetter/fooSetter, are used o…
kobezzza Nov 13, 2024
59d4e71
refactor: simplify code
kobezzza Nov 13, 2024
5da52b4
chore: improved doc
kobezzza Nov 13, 2024
20c3889
refactor: better structure
kobezzza Nov 13, 2024
a97f04c
fix: fixed a typo
kobezzza Nov 13, 2024
20abffd
Merge remote-tracking branch 'origin/v4' into speedup-3-1
kobezzza Nov 13, 2024
6461471
fix: fixed linters & optimization
kobezzza Nov 13, 2024
1590d2b
fix: mods initialization
kobezzza Nov 13, 2024
8e65033
fix: mods merging
kobezzza Nov 14, 2024
f444dfb
fix: fixed typos
kobezzza Nov 14, 2024
d629459
chore: better doc
kobezzza Nov 14, 2024
caa43a1
chore: better doc
kobezzza Nov 14, 2024
b3c3c9f
chore: removed log
kobezzza Nov 14, 2024
77a572f
Merge remote-tracking branch 'origin/v4' into speedup-3-1
kobezzza Nov 14, 2024
0996620
fix: modifiers merging
kobezzza Nov 15, 2024
37bf050
Merge remote-tracking branch 'origin/v4' into speedup-3-1
kobezzza Nov 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,58 @@ Changelog

_Note: Gaps between patch versions are faulty, broken or test releases._

## v4.0.0-beta.?? (2024-??-??)

#### :boom: Breaking Change

* The `getPassedProps` method now returns a dictionary instead of a set `core/component`

* `iBlock`:
* The API for `InferComponentEvents` has been changed so that you no longer need to pass `this` as the first argument
* Component events without an `error` or `warning` status are logged only if the `verbose` prop is set
* The `strictEmit` method no longer performs normalization of the event name

* To automatically implement traits or characteristics for components,
the `derive` decorator from the `components/traits` module should now be used.

* Removed the constants `COMPONENTS` and `BLOCK_NAMES` `build/globals.webpack`
* Removed the `components` property `config`

#### :bug: Bug Fix

* Fixed an error in normalizing attribute and prop values in Snakeskin `build`

#### :rocket: New Feature

* `core/component/decorators`:
* Added new decorators, defaultValue and method, for the class-based DSL.
These decorators are used during code generation by the TS transformer DSL.

* The prop, field, and system decorators can now accept a default value for the field as a second argument.
This argument is used during code generation by the TS transformer DSL.

#### :house: Internal

* Various micro-optimizations

* `build`:
* Added a new TypeScript transformer to automatically apply decorators to parts of a component:
methods, accessors, field overrides, etc.
* Now, only the value from the decorator is used to get the default field value.
Default values specified in the class property will automatically be passed to the decorator by the transformer.

* The observation of accessor dependencies is now initialized only if the accessor has been used at least once `core/component/accessor`

* The decorators from `core/component/decorators` no longer use a single factory module.
Now, each decorator is implemented independently.

* `core/component/meta`:
* When inheriting metaobjects, prototype chains are now used instead of full copying.
This optimizes the process of creating metaobjects.
* Methods and accessors are now added to the metaobject via the `method` decorator instead of runtime reflection.
This decorator is automatically added during the build process.
* Optimized creation of metaobjects.

## v4.0.0-beta.152 (2024-11-11)

#### :rocket: New Feature
Expand Down
17 changes: 17 additions & 0 deletions build/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ Changelog
> - :house: [Internal]
> - :nail_care: [Polish]

## v4.0.0-beta.?? (2024-??-??)

#### :boom: Breaking Change

* Removed the constants `COMPONENTS` and `BLOCK_NAMES` `globals.webpack`

#### :bug: Bug Fix

* Fixed an error in normalizing attribute and prop values in Snakeskin

#### :house: Internal

* Added a new TypeScript transformer to automatically apply decorators to parts of a component:
methods, accessors, field overrides, etc.
* Now, only the value from the decorator is used to get the default field value.
Default values specified in the class property will automatically be passed to the decorator by the transformer.

## v4.0.0-beta.138.dsl-speedup (2024-10-01)

#### :house: Internal
Expand Down
33 changes: 2 additions & 31 deletions build/globals.webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@

'use strict';

const
$C = require('collection.js'),
config = require('@config/config');
const config = require('@config/config');

const
{csp, build, webpack, i18n} = config,
{config: pzlr} = require('@pzlr/build-core'),
{collectI18NKeysets} = include('build/helpers'),
{getDSComponentMods, getThemes, getDS} = include('build/ds');

const
projectGraph = include('build/graph'),
s = JSON.stringify;
const s = JSON.stringify;

const
locales = i18n.supportedLocales(),
Expand Down Expand Up @@ -53,31 +49,6 @@ module.exports = {
LANG_KEYSETS: s(collectI18NKeysets(locales)),
LANG_PACKS: s(config.i18n.langPacksStore),

COMPONENTS: projectGraph.then(({components}) => {
if (Object.isMap(components)) {
return $C(components).to({}).reduce((res, el, key) => {
res[key] = {
parent: JSON.stringify(el.parent),
dependencies: JSON.stringify(el.dependencies)
};

return res;
});
}

return {};
}),

BLOCK_NAMES: runtime.blockNames ?
projectGraph.then(({components}) => {
if (Object.isMap(components)) {
const blockNames = Array.from(components.keys()).filter((el) => /^b-/.test(el));
return s(blockNames);
}
}) :

null,

THEME: s(config.theme.default()),
THEME_ATTRIBUTE: s(config.theme.attribute),
AVAILABLE_THEMES: pzlr.designSystem ?
Expand Down
9 changes: 3 additions & 6 deletions build/graph/component-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const
$C = require('collection.js'),
escaper = require('escaper');

const
fs = require('node:fs');
const fs = require('node:fs');

const {
componentRgxp,
Expand Down Expand Up @@ -67,8 +66,7 @@ Object.assign(componentParams, {
* Load component runtime parameters to a map
*/
componentFiles.forEach((el) => {
const
escapedFragments = [];
const escapedFragments = [];

const
file = escaper.replace(fs.readFileSync(el).toString(), escapedFragments),
Expand All @@ -94,8 +92,7 @@ componentFiles.forEach((el) => {
parent
};

const
obj = componentParams[component];
const obj = componentParams[component];

obj.deprecatedProps = p.deprecatedProps ?? {};

Expand Down
2 changes: 2 additions & 0 deletions build/graph/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ async function buildProjectGraph() {
if (build.buildGraphFromCache && fs.existsSync(graphCacheFile)) {
const cache = loadFromCache();
buildFinished();
module.exports.graph = await cache;
return cache;
}

Expand Down Expand Up @@ -168,6 +169,7 @@ async function buildProjectGraph() {
console.log('The project graph is initialized');
buildFinished();

module.exports.graph = res;
return res;

/**
Expand Down
63 changes: 45 additions & 18 deletions build/snakeskin/default-filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,20 @@ Snakeskin.importFilters({
});

function tagFilter({name: tag, attrs = {}}, _, rootTag, forceRenderAsVNode, tplName, cursor) {
Object.entries(attrs).forEach(([key, attr]) => {
if (isStaticV4Prop.test(key)) {
// Since HTML is not case-sensitive, the name can be written differently.
// We will explicitly normalize the name to the most popular format for HTML notation.
const tmp = key.dasherize(key.startsWith(':'));

if (tmp !== key) {
delete attrs[key];
attrs[tmp] = attr;
}
}
});

let componentName;

if (attrs[':instance-of']) {
attrs[':instanceOf'] = attrs[':instance-of'];
delete attrs[':instance-of'];
}

if (attrs[TYPE_OF]) {
componentName = attrs[TYPE_OF];

} else if (tag === 'component') {
if (attrs[':instance-of']) {
componentName = attrs[':instance-of'][0].camelize(false);
delete attrs[':instance-of'];
if (attrs[':instanceOf']) {
componentName = attrs[':instanceOf'][0].camelize(false);
delete attrs[':instanceOf'];

} else {
componentName = 'iBlock';
Expand All @@ -92,6 +84,41 @@ function tagFilter({name: tag, attrs = {}}, _, rootTag, forceRenderAsVNode, tplN

const component = componentParams[componentName];

Object.entries(attrs).forEach(([key, attr]) => {
if (isStaticV4Prop.test(key)) {
// Since HTML is not case-sensitive, the name can be written differently.
// We will explicitly normalize the name to the most popular format for HTML notation.
// For Vue component attributes such as `:` and `@`, we convert the prop to camelCase format.
let normalizedKey;

if (component) {
if (key.startsWith('@')) {
normalizedKey = key.camelize(false);

} else if (key.startsWith('v-on:')) {
normalizedKey = key.replace(/^v-on:([^.[]+)(.*)/, (_, event, rest) =>
`v-on:${event.camelize(false)}${rest}`);

} else if (key.startsWith(':') && !key.startsWith(':-') && !key.startsWith(':v-')) {
const camelizedKey = key.camelize(false);

if (component.props[camelizedKey.slice(1)]) {
normalizedKey = camelizedKey;
}
}
}

if (!normalizedKey) {
normalizedKey = key.dasherize();
}

if (normalizedKey !== key) {
delete attrs[key];
attrs[normalizedKey] = attr;
}
}
});

if (isSmartComponent(component)) {
attrs[SMART_PROPS] = component.functional;
}
Expand Down Expand Up @@ -177,8 +204,8 @@ function tagFilter({name: tag, attrs = {}}, _, rootTag, forceRenderAsVNode, tplN
attrs[':componentIdProp'] = [`componentId + ${JSON.stringify(id)}`];
}

if (component.inheritMods !== false && !attrs[':mods'] && !attrs[':modsProp']) {
attrs[':mods'] = ['provide.mods()'];
if (component.inheritMods !== false) {
attrs[':inheritMods'] = ['sharedMods != null'];
}

Object.entries(attrs).forEach(([name, val]) => {
Expand Down
6 changes: 6 additions & 0 deletions build/ts-transformers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Changelog
> - :house: [Internal]
> - :nail_care: [Polish]

## v4.0.0-beta.?? (2024-??-??)

#### :rocket: New Feature

* Added a new transformer `register-component-default-values`

## v3.23.5 (2022-07-12)

#### :rocket: New Feature
Expand Down
9 changes: 8 additions & 1 deletion build/ts-transformers/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# build/ts-transformers

This module provides a bunch of custom transformers for TypeScript.
This module provides a bunch of custom transformers for TypeScript/TSC.

## Default Transformers

* `set-component-layer` - this module provides a transformer that adds information to each component declaration about
the application layer in which the component is declared.

* `register-component-parts` - this module provides a transformer for registering parts of a class as parts of the associated component.
11 changes: 5 additions & 6 deletions build/ts-transformers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
'use strict';

const
setComponentLayer = include('build/ts-transformers/set-component-layer');
setComponentLayer = include('build/ts-transformers/set-component-layer'),
resisterComponentParts = include('build/ts-transformers/register-component-parts');

/**
* Returns a settings object for setting up TypeScript transformers
*
* @param {import('typescript').Program} program
* Returns a settings object for configuring TypeScript transformers
* @returns {object}
*/
module.exports = (program) => ({
before: [setComponentLayer(program)],
module.exports = () => ({
before: [setComponentLayer, resisterComponentParts],
after: {},
afterDeclarations: {}
});
16 changes: 16 additions & 0 deletions build/ts-transformers/register-component-parts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Changelog
=========

> **Tags:**
> - :boom: [Breaking Change]
> - :rocket: [New Feature]
> - :bug: [Bug Fix]
> - :memo: [Documentation]
> - :house: [Internal]
> - :nail_care: [Polish]

## v4.0.0-beta.?? (2024-??-??)

#### :rocket: New Feature

* Initial release
Loading