-
Notifications
You must be signed in to change notification settings - Fork 14
[issues/1420] Ленивая инициализация модулей без FAT_HTML #1423
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
Open
DmitryYegorov
wants to merge
57
commits into
v4
Choose a base branch
from
issues/1420
base: v4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
6699da2
connect require fn to registerComponent fn
7b0838e
experiment: set event emitter to dynamic-import loader
704ece4
optimize amount of invokations __webpack_require__ function
cc5dfb8
fixing syntax errors after build
66f1e04
fixed breaked imports and syntax errors
1d28cc1
return empty string if component doesn't have deps
16d3e36
fixed build errors issued by updated loaders
f489153
fixed syntax errors
f05a361
removed ununsed handler
676b81f
applied layer of the components for emitting registration events
6361a3f
set layer for registerComponent as arg
9d13e83
removed debug logs
5a0e33a
fixed optional chaining if obj is undefined
c82d4ea
updated set-layer ts-transformer
60592eb
fixed incorrect reference to variable
5238f72
fix: pass real filePath as arg
302fbee
Merge branch 'v4' of github.com:V4Fire/Client into issues/1420
63f0dcb
removed unused handlers
d25d62e
updated loader dynamic-component-import
9f2db30
applied refactor fixes
d1a0df1
used getLayerName instead getOriginLayerFromPath
4cd14f1
fixed syntax error
ac8ee23
removed import by event from dynamic-component-import
c2fbe0e
limit imports only for page components
659159a
Merge branch 'v4' of github.com:V4Fire/Client into issues/1420
113411a
applied fixes of build and undefined layers
e3d9a39
Merge branch 'v4' of github.com:V4Fire/Client into issues/1420
597d129
fixed layer=undefined problem
d01c6a6
fixed regexp for isComponent
c132014
added async-render to i-static-page
9cbb09e
remove lazy invocations for interfaces
64fa0dc
use literal reg exp
140963f
polish code, fixed tabs and empty lines
56cfc08
removed unused \n
b9d919f
jsdoc for get-origin-layer helper
396622c
removed unused semicolon
bfd818b
removed empty lines
b9bba72
fixed lint issues
aa0fe4f
debug playwright tests
565d932
removed debug for tests
c264144
Merge branch 'v4' of github.com:V4Fire/Client into issues/1420
a0a9c20
debug: try to run tests without waiting for template
fbeb68e
debug: removed comments
f51207e
fixed a typo in variable name
dc86f4f
added comments to ts-transformer updates
5ba983b
refactor code; debug using config.projectName instead of getLayerName fn
1532035
removed unused helpers and apply code review suggestions
087705f
refactor: use @pzlr for getting layerName of component
107e50f
fixed dynamic loading of components
c4cde01
fixed incorrect layer calculation and regexp for name of component
7fbb509
Update src/core/component/functional/test/unit/getters.ts
DmitryYegorov 52d4983
Merge branch 'v4' of https://github.com/V4Fire/Client into issues/1420
150b947
added registration of DataProvider and Daemons methods
7228c24
Удалил ненужное
bonkalol cbf5686
:art: eslint
bonkalol 5a17c1f
Поправил тесты
bonkalol 91b5f10
:wrench: appendChild to DOM proto
bonkalol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /*! | ||
| * V4Fire Client Core | ||
| * https://github.com/V4Fire/Client | ||
| * | ||
| * Released under the MIT license | ||
| * https://github.com/V4Fire/Client/blob/master/LICENSE | ||
| */ | ||
|
|
||
| 'use strict'; | ||
|
|
||
| /** | ||
| * Function incapsulates script to event handler that is being triggered when component with | ||
| * name `componentName` from `layerName` renders on the page. | ||
| * | ||
| * @param {string} script | ||
| * @param {string} layerName | ||
| * @param {string} componentName | ||
| * @returns {string} | ||
| */ | ||
| function invokeByRegisterEvent(script, layerName, componentName) { | ||
| if (script?.trim()?.length === 0) { | ||
| return script; | ||
| } | ||
|
|
||
| return `\n | ||
| (function () { | ||
| const {initEmitter} = require('core/component/event'); | ||
|
|
||
| initEmitter.once('registerComponent.${layerName}.${componentName}', () => { | ||
| ${script} | ||
| }); | ||
| })(); | ||
| \n | ||
| `; | ||
| } | ||
|
|
||
| exports.invokeByRegisterEvent = invokeByRegisterEvent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /*! | ||
| * V4Fire Client Core | ||
| * https://github.com/V4Fire/Client | ||
| * | ||
| * Released under the MIT license | ||
| * https://github.com/V4Fire/Client/blob/master/LICENSE | ||
| */ | ||
|
|
||
| 'use strict'; | ||
|
|
||
| const { | ||
| config, | ||
| resolve: {rootDependencies} | ||
| } = require('@pzlr/build-core'); | ||
|
|
||
| const | ||
| isPathInside = require('is-path-inside'), | ||
| fs = require('fs'), | ||
| path = require('path'); | ||
|
|
||
| /** | ||
| * The function determines the package in which the module is defined and | ||
| * returns the name of this package from the `package.json` file | ||
| * | ||
| * @param {string} filePath | ||
| * @returns {string} | ||
| */ | ||
| function getLayerName(filePath) { | ||
| let layer = config.projectName; | ||
|
|
||
| for (let i = 0; i < rootDependencies.length; i++) { | ||
| if (isPathInside(fs.realpathSync(filePath), fs.realpathSync(rootDependencies[i]))) { | ||
| const pathPackageJson = path.resolve(fs.realpathSync(rootDependencies[i]), '..', 'package.json'); | ||
| layer = require(pathPackageJson).name; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| return layer; | ||
| } | ||
|
|
||
| exports.getLayerName = getLayerName; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.