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

feat: export common entities from 'common' folder #28297

Open
wants to merge 25 commits into
base: 24_2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
98795f5
move shared files to common
VasilyStrelyaev Nov 1, 2024
9562527
update exports and re-exports
VasilyStrelyaev Nov 1, 2024
68c54b2
update imports in tests
VasilyStrelyaev Nov 13, 2024
0f26575
fight ciruclar references in data
VasilyStrelyaev Nov 14, 2024
3933429
e2e compilation cases
VasilyStrelyaev Nov 14, 2024
6bf4ab2
events utils
VasilyStrelyaev Nov 14, 2024
54a0e40
modules metadata
VasilyStrelyaev Nov 14, 2024
b7d483c
imports in tests: fix autoreplace traces - events
VasilyStrelyaev Nov 14, 2024
9a48778
modules metadata - more fixes
VasilyStrelyaev Nov 14, 2024
616de25
fix odatastore inheritance
VasilyStrelyaev Nov 14, 2024
548c729
more fixes
VasilyStrelyaev Nov 14, 2024
4ee7675
try bag js files in module metadata
VasilyStrelyaev Nov 15, 2024
6ec4536
regenerate all + bump tools
VasilyStrelyaev Nov 18, 2024
ac038c5
lint
VasilyStrelyaev Nov 18, 2024
4530d45
Demos: update data imports
VasilyStrelyaev Nov 19, 2024
f5341eb
Demos: update some more imports
VasilyStrelyaev Nov 19, 2024
a2b4dae
fix bug with wrong Store linked in FSP and missing custom store methods
VasilyStrelyaev Nov 21, 2024
aa226af
fix e2e compilation tests + linter
VasilyStrelyaev Nov 21, 2024
f67d86c
experiment: turn old FSP custom store exports into local re-exports
VasilyStrelyaev Nov 21, 2024
24b9dab
regenerate after rebase
VasilyStrelyaev Nov 21, 2024
1164c8f
experimental: better React System.js configs for Demos
VasilyStrelyaev Nov 21, 2024
8e7502c
return old data path to systemjs config
VasilyStrelyaev Nov 22, 2024
879858a
Revert "Demos: update some more imports"
VasilyStrelyaev Nov 25, 2024
aa636a7
Revert "Demos: update data imports"
VasilyStrelyaev Nov 25, 2024
4d5201f
purely experimental: propagate new paths to system.js
VasilyStrelyaev Nov 22, 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
17 changes: 16 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,22 @@ 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/file_management/*',
'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
19 changes: 17 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,22 @@ 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/file_management/*',
'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 +48,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 @@ -158,7 +158,7 @@ window.config = {
'devextreme/events/utils': {
main: 'index',
},
'devextreme/localization/messages': {
'devextreme/common/core/localization/messages': {
format: 'json',
defaultExtension: 'json',
},
Expand Down
19 changes: 18 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,22 @@ 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/file_management/*',
'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 +43,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 @@ -159,7 +159,7 @@ window.config = {
'devextreme/events/utils': {
main: 'index',
},
'devextreme/localization/messages': {
'devextreme/common/core/localization/messages': {
format: 'json',
defaultExtension: '',
},
Expand Down
17 changes: 16 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,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/file_management/*',
'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
21 changes: 11 additions & 10 deletions e2e/compilation-cases/data/data_source.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
/* 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,
DataSourceOptionsStub,
DataSourceLike,
} from 'devextreme/common/data';

import {
AnotherType,
ANY,
Expand All @@ -11,16 +22,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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"axe-core": "4.10.2",
"cheerio": "1.0.0-rc.10",
"codelyzer": "6.0.2",
"devextreme-internal-tools": "16.0.0-beta.13.1",
"devextreme-internal-tools": "16.0.0-beta.14",
"http-server": "14.1.1",
"husky": "8.0.3",
"jest": "29.7.0",
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';
Loading
Loading