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

WIP, experimental: export common entities from 'common' folder #28451

Draft
wants to merge 38 commits into
base: 24_2
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c403128
move shared files to common
VasilyStrelyaev Nov 1, 2024
14e14e0
update exports and re-exports
VasilyStrelyaev Nov 1, 2024
8e56e76
update imports in tests
VasilyStrelyaev Nov 13, 2024
eb3e1f8
fight ciruclar references in data
VasilyStrelyaev Nov 14, 2024
833330a
e2e compilation cases
VasilyStrelyaev Nov 14, 2024
09fe499
events utils
VasilyStrelyaev Nov 14, 2024
e3c2c00
modules metadata
VasilyStrelyaev Nov 14, 2024
05dd44e
imports in tests: fix autoreplace traces - events
VasilyStrelyaev Nov 14, 2024
c1e7c11
modules metadata - more fixes
VasilyStrelyaev Nov 14, 2024
b795827
fix odatastore inheritance
VasilyStrelyaev Nov 14, 2024
a976760
more fixes
VasilyStrelyaev Nov 14, 2024
4344625
try bag js files in module metadata
VasilyStrelyaev Nov 15, 2024
a3c6c94
regenerate all + bump tools
VasilyStrelyaev Nov 18, 2024
e3f06c3
lint
VasilyStrelyaev Nov 18, 2024
056c45a
Demos: update data imports
VasilyStrelyaev Nov 19, 2024
16cfbb4
Demos: update some more imports
VasilyStrelyaev Nov 19, 2024
83df5f1
fix bug with wrong Store linked in FSP and missing custom store methods
VasilyStrelyaev Nov 21, 2024
2195b16
fix e2e compilation tests + linter
VasilyStrelyaev Nov 21, 2024
b6b0637
experiment: turn old FSP custom store exports into local re-exports
VasilyStrelyaev Nov 21, 2024
2e7c72b
regenerate after rebase
VasilyStrelyaev Nov 21, 2024
d011ced
experimental: better React System.js configs for Demos
VasilyStrelyaev Nov 21, 2024
60d42e1
return old data path to systemjs config
VasilyStrelyaev Nov 22, 2024
78d23f4
Revert "Demos: update some more imports"
VasilyStrelyaev Nov 25, 2024
1c0ed7a
Revert "Demos: update data imports"
VasilyStrelyaev Nov 25, 2024
067c561
purely experimental: propagate new paths to system.js
VasilyStrelyaev Nov 22, 2024
4dc6202
Ilya's remarks - part 1 - file_management
VasilyStrelyaev Nov 26, 2024
2dbe48d
add deprecation to FSP custom-store re-export
VasilyStrelyaev Nov 27, 2024
b8d7218
get rid of both events.ts and events/index.ts
VasilyStrelyaev Nov 27, 2024
d9637be
rename dxSchedulerTimeZones
VasilyStrelyaev Nov 27, 2024
976ac01
remove store_base from common
VasilyStrelyaev Nov 27, 2024
192b5b0
experiment with moving doctags to public re-exports
VasilyStrelyaev Nov 28, 2024
250e4e6
streamline js re-export chain
VasilyStrelyaev Nov 29, 2024
ff11e72
return data declarations to common while keeping discoverability
VasilyStrelyaev Nov 29, 2024
a874cdb
split export and events files to public-private
VasilyStrelyaev Dec 2, 2024
dfaf6e3
split export and events files to public-private, part 2
VasilyStrelyaev Dec 3, 2024
219c84c
fix e2e tests and abstract_store.js circular ref
VasilyStrelyaev Dec 3, 2024
00418a9
linter
VasilyStrelyaev Dec 3, 2024
72309a4
.d.ts linter
VasilyStrelyaev Dec 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import 'devextreme/localization/globalize/date';
import 'devextreme/localization/globalize/currency';
import 'devextreme/localization/globalize/message';

import deMessages from 'npm:devextreme/localization/messages/de.json!json';
import ruMessages from 'npm:devextreme/localization/messages/ru.json!json';
import deMessages from 'npm:devextreme/common/core/localization/messages/de.json!json';
import ruMessages from 'npm:devextreme/common/core/localization/messages/ru.json!json';

import deCldrData from 'npm:devextreme-cldr-data/de.json!json';
import ruCldrData from 'npm:devextreme-cldr-data/ru.json!json';
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingGlobalize/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import 'devextreme/localization/globalize/date';
import 'devextreme/localization/globalize/currency';
import 'devextreme/localization/globalize/message';

import deMessages from 'devextreme/localization/messages/de.json';
import ruMessages from 'devextreme/localization/messages/ru.json';
import deMessages from 'devextreme/common/core/localization/messages/de.json';
import ruMessages from 'devextreme/common/core/localization/messages/ru.json';

import deCldrData from 'devextreme-cldr-data/de.json';
import ruCldrData from 'devextreme-cldr-data/ru.json';
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingGlobalize/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import 'devextreme/localization/globalize/number';
import 'devextreme/localization/globalize/date';
import 'devextreme/localization/globalize/currency';
import 'devextreme/localization/globalize/message';
import deMessages from 'devextreme/localization/messages/de.json';
import ruMessages from 'devextreme/localization/messages/ru.json';
import deMessages from 'devextreme/common/core/localization/messages/de.json';
import ruMessages from 'devextreme/common/core/localization/messages/ru.json';
import deCldrData from 'devextreme-cldr-data/de.json';
import ruCldrData from 'devextreme-cldr-data/ru.json';
import supplementalCldrData from 'devextreme-cldr-data/supplemental.json';
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingGlobalize/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ import 'devextreme/localization/globalize/currency';
import 'devextreme/localization/globalize/message';
/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-webpack-loader-syntax */
import * as deMessages from 'npm:devextreme/localization/messages/de.json!json';
import * as ruMessages from 'npm:devextreme/localization/messages/ru.json!json';
import * as deMessages from 'npm:devextreme/common/core/localization/messages/de.json!json';
import * as ruMessages from 'npm:devextreme/common/core/localization/messages/ru.json!json';
import * as deCldrData from 'npm:devextreme-cldr-data/de.json!json';
import * as ruCldrData from 'npm:devextreme-cldr-data/ru.json!json';
import * as supplementalCldrData from 'npm:devextreme-cldr-data/supplemental.json!json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { DxSelectBoxModule, DxDataGridModule } from 'devextreme-angular';

import { locale, loadMessages, formatMessage } from 'devextreme/localization';

import deMessages from 'npm:devextreme/localization/messages/de.json!json';
import ruMessages from 'npm:devextreme/localization/messages/ru.json!json';
import deMessages from 'npm:devextreme/common/core/localization/messages/de.json!json';
import ruMessages from 'npm:devextreme/common/core/localization/messages/ru.json!json';
import { Locale, Payment, Service } from './app.service';

if (!/localhost/.test(document.location.host)) {
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingIntl/React/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import React, { useState } from 'react';
import DataGrid, { Column, Editing, FilterRow } from 'devextreme-react/data-grid';
import SelectBox, { SelectBoxTypes } from 'devextreme-react/select-box';

import deMessages from 'devextreme/localization/messages/de.json';
import ruMessages from 'devextreme/localization/messages/ru.json';
import deMessages from 'devextreme/common/core/localization/messages/de.json';
import ruMessages from 'devextreme/common/core/localization/messages/ru.json';
import { locale, loadMessages, formatMessage } from 'devextreme/localization';

import service from './data.ts';
Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingIntl/ReactJs/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import React, { useState } from 'react';
import DataGrid, { Column, Editing, FilterRow } from 'devextreme-react/data-grid';
import SelectBox from 'devextreme-react/select-box';
import deMessages from 'devextreme/localization/messages/de.json';
import ruMessages from 'devextreme/localization/messages/ru.json';
import deMessages from 'devextreme/common/core/localization/messages/de.json';
import ruMessages from 'devextreme/common/core/localization/messages/ru.json';
import { locale, loadMessages, formatMessage } from 'devextreme/localization';
import service from './data.js';

Expand Down
4 changes: 2 additions & 2 deletions apps/demos/Demos/Localization/UsingIntl/Vue/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ import {
import DxSelectBox, { DxSelectBoxTypes } from 'devextreme-vue/select-box';
/* eslint-disable import/no-unresolved */
/* eslint-disable import/no-webpack-loader-syntax */
import * as deMessages from 'npm:devextreme/localization/messages/de.json!json';
import * as ruMessages from 'npm:devextreme/localization/messages/ru.json!json';
import * as deMessages from 'npm:devextreme/common/core/localization/messages/de.json!json';
import * as ruMessages from 'npm:devextreme/common/core/localization/messages/ru.json!json';
import { locale as dxLocale, loadMessages, formatMessage as dxFormatMessage } from 'devextreme/localization';
import service from './data.ts';

Expand Down
16 changes: 15 additions & 1 deletion apps/demos/configs/Angular/config.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ const bundleConfig = {
bundles: {
'devextreme.angular.systemjs.js': [
'devextreme/*',
'devextreme/data/*',
'devextreme/data/odata/*',
'devextreme/animation/*',
'devextreme/common/*',
'devextreme/core/*',
'devextreme/core/utils/*',
'devextreme/data/*',
Expand All @@ -23,8 +24,21 @@ const bundleConfig = {
'devextreme/ui/toast/*',
'devextreme/viz/*',
'devextreme/viz/vector_map/*',
'devextreme/common/*',
'devextreme/common/data/*',
'devextreme/common/data/odata/*',
'devextreme/common/export/*',
'devextreme/common/core/*',
'devextreme/common/core/animation/*',
'devextreme/common/core/environment/*',
'devextreme/common/core/events/*',
'devextreme/common/core/localization/*',
'devextreme-angular',
'devextreme-angular/*',
'devextreme-angular/core/*',
'devextreme-angular/common/*',
'devextreme-angular/common/core/*',
'devextreme-angular/common/export/*',
'devexpress-gantt',
'devexpress-diagram',
'rxjs/*',
Expand Down
18 changes: 16 additions & 2 deletions apps/demos/configs/React/config.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ const bundleConfig = {
bundles: {
'devextreme.react.systemjs.js': [
'devextreme/*',
'devextreme/data/*',
'devextreme/data/odata/*',
'devextreme/animation/*',
'devextreme/common/*',
'devextreme/core/*',
'devextreme/core/utils/*',
'devextreme/data/*',
Expand All @@ -23,8 +24,21 @@ const bundleConfig = {
'devextreme/ui/toast/*',
'devextreme/viz/*',
'devextreme/viz/vector_map/*',
'devextreme/common/*',
'devextreme/common/data/*',
'devextreme/common/data/odata/*',
'devextreme/common/export/*',
'devextreme/common/core/*',
'devextreme/common/core/animation/*',
'devextreme/common/core/environment/*',
'devextreme/common/core/events/*',
'devextreme/common/core/localization/*',
'devextreme/common/core/localization/globalize/*',
'devextreme-react/*',
'devextreme-react/core/*',
'devextreme-react/common/*',
'devextreme-react/common/core/*',
'devextreme-react/common/export/*',
'devexpress-gantt',
'devexpress-diagram',
'react/*',
Expand All @@ -33,7 +47,7 @@ const bundleConfig = {
},
map: {
'devextreme.react.systemjs.js': '../../../../bundles/devextreme.react.systemjs.js',
'devextreme/localization/messages': 'npm:devextreme/localization/messages',
'devextreme/common/core/localization/messages': 'npm:devextreme/common/core/localization/messages',
},
packages: {
'react': {
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/configs/React/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ window.config = {
'devextreme/events/utils': {
main: 'index',
},
'devextreme/localization/messages': {
'devextreme/common/core/localization/messages': {
format: 'json',
defaultExtension: 'json',
},
Expand Down
18 changes: 17 additions & 1 deletion apps/demos/configs/ReactJs/config.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const bundleConfig = {
bundles: {
'devextreme.react.systemjs.js': [
'devextreme/*',
'devextreme/data/*',
'devextreme/data/odata/*',
'devextreme/animation/*',
'devextreme/core/*',
'devextreme/core/utils/*',
Expand All @@ -17,7 +19,21 @@ const bundleConfig = {
'devextreme/ui/pivot_grid/*',
'devextreme/viz/*',
'devextreme/viz/vector_map/*',
'devextreme/common/*',
'devextreme/common/data/*',
'devextreme/common/data/odata/*',
'devextreme/common/export/*',
'devextreme/common/core/*',
'devextreme/common/core/animation/*',
'devextreme/common/core/environment/*',
'devextreme/common/core/events/*',
'devextreme/common/core/localization/*',
'devextreme/common/core/localization/globalize/*',
'devextreme-react/*',
'devextreme-react/core/*',
'devextreme-react/common/*',
'devextreme-react/common/core/*',
'devextreme-react/common/export/*',
'devexpress-gantt',
'devexpress-diagram',
'react/*',
Expand All @@ -26,7 +42,7 @@ const bundleConfig = {
},
map: {
'devextreme.react.systemjs.js': '../../../../../bundles/devextreme.react.systemjs.js',
'devextreme/localization/messages': 'npm:devextreme/localization/messages',
'devextreme/common/core/localization/messages': 'npm:devextreme/common/core/localization/messages',
},
packages: {
'react': {
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/configs/ReactJs/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ window.config = {
'devextreme/events/utils': {
main: 'index',
},
'devextreme/localization/messages': {
'devextreme/common/core/localization/messages': {
format: 'json',
defaultExtension: '',
},
Expand Down
16 changes: 15 additions & 1 deletion apps/demos/configs/Vue/config.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ const bundleConfig = {
bundles: {
'devextreme.vue.systemjs.js': [
'devextreme/*',
'devextreme/data/*',
'devextreme/data/odata/*',
'devextreme/animation/*',
'devextreme/common/*',
'devextreme/core/*',
'devextreme/core/utils/*',
'devextreme/data/*',
Expand All @@ -23,7 +24,20 @@ const bundleConfig = {
'devextreme/ui/toast/*',
'devextreme/viz/*',
'devextreme/viz/vector_map/*',
'devextreme/common/*',
'devextreme/common/data/*',
'devextreme/common/data/odata/*',
'devextreme/common/export/*',
'devextreme/common/core/*',
'devextreme/common/core/animation/*',
'devextreme/common/core/environment/*',
'devextreme/common/core/events/*',
'devextreme/common/core/localization/*',
'devextreme-vue/*',
'devextreme-vue/core/*',
'devextreme-vue/common/*',
'devextreme-vue/common/core/*',
'devextreme-vue/common/export/*',
'devexpress-gantt',
'devexpress-diagram',
],
Expand Down
9 changes: 6 additions & 3 deletions apps/demos/rollup.devextreme-angular.umd.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ import babel from '@rollup/plugin-babel';
import fs from 'fs-extra';

const baseDir = './node_modules/devextreme-angular/fesm2022/';
const componentNames = fs.readdirSync(baseDir)
const fileNames = fs.readdirSync(baseDir)
.filter((fileName) => fileName.indexOf('mjs.map') !== -1)
.filter((fileName) => fileName.indexOf('devextreme-angular-ui') === 0)
.filter((fileName) =>
fileName.indexOf('devextreme-angular-ui') === 0
|| fileName.indexOf('devextreme-angular-common') === 0
)
.map((fileName) => fileName.replace('.mjs.map', ''));

const inputs = {
'devextreme-angular': `${baseDir}devextreme-angular.mjs`,
'devextreme-angular-core': `${baseDir}devextreme-angular-core.mjs`,
'devextreme-angular-http': `${baseDir}devextreme-angular-http.mjs`,
...componentNames.reduce((acc, name) => {
...fileNames.reduce((acc, name) => {
acc[name] = `${baseDir}${name}.mjs`;

return acc;
Expand Down
10 changes: 9 additions & 1 deletion apps/demos/utils/bundle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const prepareConfigs = (framework)=> {
let modulesMap = {};

let main = `devextreme-${framework}/index.js`;
let common = `devextreme-${framework}/common/bag`;
let minify = true;

if (framework === 'angular') {
Expand All @@ -133,6 +134,9 @@ const prepareConfigs = (framework)=> {
prepareDevextremexAngularFiles();

const bundlesRoot = 'node_modules/devextreme-angular/bundles';

common = `${bundlesRoot}/devextreme-angular-common.umd.js`;

const componentNames = fs.readdirSync(bundlesRoot)
.filter((fileName) => fileName.indexOf('umd.js') !== -1)
.filter((fileName) => fileName.indexOf('devextreme-angular-ui') === 0)
Expand Down Expand Up @@ -175,7 +179,7 @@ const prepareConfigs = (framework)=> {
}];

additionPaths = {
'devextreme/localization/messages/*': 'node_modules/devextreme/localization/messages/*',
'devextreme/common/core/localization/messages/*': 'node_modules/devextreme/common/core/localization/messages/*',
};

packages = [
Expand All @@ -196,6 +200,10 @@ const prepareConfigs = (framework)=> {
main,
);

if (common) {
packages.push(common);
}

return {
builderConfig,
packages: packages.join(' + '),
Expand Down
24 changes: 14 additions & 10 deletions e2e/compilation-cases/data/data_source.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
/* eslint-disable import/named */
/* eslint-disable @typescript-eslint/no-type-alias */
/* eslint-disable @typescript-eslint/no-unsafe-return */
import {
Store,
DataSource,
CustomStore,
ArrayStore,
ODataStore,
LocalStore,
} from 'devextreme/common/data';

import {
DataSourceOptionsStub,
DataSourceLike,
} from 'devextreme/data/data_source';

import {
AnotherType,
ANY,
Expand All @@ -11,16 +25,6 @@ import {
SomeType,
} from '../consts';

import DataSource, {
DataSourceLike,
DataSourceOptionsStub,
} from 'devextreme/data/data_source';
import CustomStore from 'devextreme/data/custom_store';
import ArrayStore from 'devextreme/data/array_store';
import ODataStore from 'devextreme/data/odata/store';
import LocalStore from 'devextreme/data/local_store';
import { Store } from 'devextreme/data/index';

export function promiseResolveAcceptsMultipleArguments() {
const callback: (a: any, b: any) => void = ANY;
const dataSource: DataSource = ANY;
Expand Down
10 changes: 7 additions & 3 deletions e2e/compilation-cases/data/stores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import $ from 'jquery';
import { HttpClient } from '@angular/common/http';
import CustomStore from 'devextreme/data/custom_store';
import { Store, StoreOptions } from 'devextreme/data';
import {
Store,
StoreOptions,
CustomStore,
LoadResult,
} from 'devextreme/common/data';

import {
ANY,
assertType,
notAny,
notNever,
toAssertion,
} from '../consts';
import type { LoadResult } from 'devextreme/common/data/custom-store';

export async function infersTItemFromComplexLoadResult() {
const store = new CustomStore({
Expand Down
12 changes: 12 additions & 0 deletions packages/devextreme-angular/src/common/core/animation/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export {
AnimationConfig,
animationPresets,
AnimationState,
cancelAnimationFrame,
CollisionResolution,
CollisionResolutionCombination,
fx,
PositionConfig,
requestAnimationFrame,
TransitionExecutor,
} from 'devextreme/common/core/animation';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"lib": {
"entryFile": "index.ts"
}
}
Loading
Loading