-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add bundle size validations + cleanup main entry points #3327
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
cf202d4
Add bundle size validations + cleanup community entry points
iMoses cd87c18
ignore .size-limit.js on lint and npm publish
iMoses 99574e4
cleanup ag-charts-enterprise main.ts
iMoses 075702f
fix astro config to import esm
iMoses b7448ef
remove unused Marker imports
iMoses 8ce78f3
fix test import
iMoses 570a62b
fix test import
iMoses a408563
fix test import
iMoses 83bd726
fix test import
iMoses a4c9235
add size-limit config file to ag-charts-enterprise
iMoses 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 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 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 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 |
---|---|---|
|
@@ -5,6 +5,7 @@ tools | |
.prettierignore | ||
.swcrc | ||
.dependency-cruiser.js | ||
.size-limit.js | ||
jest.* | ||
tsconfig.* | ||
project.json | ||
|
This file contains 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,19 @@ | ||
const defaultConfig = { | ||
path: './src/main-modules.ts', | ||
brotli: false, | ||
}; | ||
|
||
module.exports = [ | ||
{ | ||
name: 'Full package', | ||
import: '*', | ||
limit: '200 kB', | ||
...defaultConfig, | ||
}, | ||
// { | ||
// name: 'Testing EventEmitter', | ||
// import: '{ EventEmitter }', | ||
// limit: '20 kB', | ||
// ...defaultConfig, | ||
// }, | ||
]; |
This file contains 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 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 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 |
---|---|---|
@@ -1,23 +1 @@ | ||
import type { IntegratedModule } from 'ag-charts-types'; | ||
|
||
import { AgCharts } from './api/agCharts'; | ||
import { registerInbuiltModules } from './chart/factory/registerInbuiltModules'; | ||
import * as _Scene from './integrated-charts-scene'; | ||
import * as _Theme from './integrated-charts-theme'; | ||
import * as _Util from './integrated-charts-util'; | ||
import { VERSION } from './version'; | ||
|
||
export { AgCharts } from './api/agCharts'; | ||
export { VERSION } from './version'; | ||
export { registerInbuiltModules as setupCommunityModules } from './chart/factory/registerInbuiltModules'; | ||
|
||
export const AgChartsCommunityModule = { | ||
VERSION, | ||
_Scene, | ||
_Theme, | ||
_Util, | ||
create: AgCharts.create.bind(AgCharts), | ||
createSparkline: AgCharts.__createSparkline.bind(AgCharts), | ||
setup: registerInbuiltModules, | ||
isEnterprise: false, | ||
} satisfies IntegratedModule; | ||
// Entry point to implement and test our tree-shaking abilities |
This file contains 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 |
---|---|---|
@@ -1,16 +1,33 @@ | ||
import type { IntegratedModule } from 'ag-charts-types'; | ||
|
||
import { AgCharts } from './api/agCharts'; | ||
import { registerInbuiltModules } from './chart/factory/registerInbuiltModules'; | ||
import * as _Scene from './integrated-charts-scene'; | ||
import * as _Theme from './integrated-charts-theme'; | ||
import * as _Util from './integrated-charts-util'; | ||
import { VERSION } from './version'; | ||
|
||
// Documented APIs. | ||
export { AG_CHARTS_LOCALE_EN_US } from 'ag-charts-locale'; | ||
export * from 'ag-charts-types'; | ||
export * from './main-modules'; | ||
export * as time from './util/time/index'; | ||
export { Marker } from './chart/marker/marker'; | ||
|
||
// Undocumented APIs used by Integrated Charts. | ||
// TODO remove after ag-grid refactored to look at main-module.ts | ||
export * as _Scene from './integrated-charts-scene'; | ||
export * as _Theme from './integrated-charts-theme'; | ||
export * as _Util from './integrated-charts-util'; | ||
export * as time from './util/time'; | ||
export { AgCharts, VERSION }; | ||
|
||
// Undocumented APIs used by Enterprise Modules. | ||
export * as _ModuleSupport from './module-support'; | ||
export * as _Widget from './widget/exports'; | ||
export { registerInbuiltModules as setupCommunityModules }; | ||
|
||
// Undocumented APIs used by Integrated Charts. | ||
export { _Scene, _Theme, _Util }; | ||
|
||
export const AgChartsCommunityModule = { | ||
VERSION, | ||
_Scene, | ||
_Theme, | ||
_Util, | ||
create: AgCharts.create.bind(AgCharts), | ||
createSparkline: AgCharts.__createSparkline.bind(AgCharts), | ||
setup: registerInbuiltModules, | ||
isEnterprise: false, | ||
} satisfies IntegratedModule; |
This file contains 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 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 |
---|---|---|
@@ -1,30 +1 @@ | ||
import { AgCharts, VERSION, _Scene, _Theme, _Util, setupCommunityModules } from 'ag-charts-community'; | ||
import type { IntegratedModule } from 'ag-charts-types'; | ||
|
||
import { LicenseManager as RealLicenseManager } from './license/licenseManager'; | ||
import { setupEnterpriseModules as internalSetup } from './setup'; | ||
|
||
const LicenseManager = { | ||
setLicenseKey(key: string) { | ||
RealLicenseManager.setLicenseKey(key); | ||
}, | ||
}; | ||
export { AgCharts, VERSION, LicenseManager }; | ||
|
||
export function setupEnterpriseModules() { | ||
internalSetup(); | ||
setupCommunityModules(); | ||
} | ||
|
||
export const AgChartsEnterpriseModule: IntegratedModule = { | ||
VERSION, | ||
_Scene, | ||
_Theme, | ||
_Util, | ||
create: AgCharts.create.bind(AgCharts), | ||
createSparkline: AgCharts.__createSparkline.bind(AgCharts), | ||
setup: setupEnterpriseModules, | ||
setGridContext: RealLicenseManager.setGridContext.bind(RealLicenseManager), | ||
setLicenseKey: RealLicenseManager.setLicenseKey.bind(RealLicenseManager), | ||
isEnterprise: true, | ||
}; | ||
// Entry point to implement and test our tree-shaking abilities |
This file contains 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 |
---|---|---|
@@ -1,8 +1,33 @@ | ||
import { setupEnterpriseModules } from './setup'; | ||
import { AgCharts, VERSION, _Scene, _Theme, _Util, setupCommunityModules } from 'ag-charts-community'; | ||
import type { IntegratedModule } from 'ag-charts-types'; | ||
|
||
import { LicenseManager as RealLicenseManager } from './license/licenseManager'; | ||
import { setupEnterpriseModules as internalSetup } from './setup'; | ||
|
||
internalSetup(); | ||
|
||
// Export types. | ||
export * from 'ag-charts-community'; | ||
export * from './main-modules'; | ||
// Needed for UMD global exports to work correctly. | ||
|
||
setupEnterpriseModules(); | ||
export const LicenseManager = { | ||
setLicenseKey(key: string) { | ||
RealLicenseManager.setLicenseKey(key); | ||
}, | ||
}; | ||
|
||
export function setupEnterpriseModules() { | ||
internalSetup(); | ||
setupCommunityModules(); | ||
} | ||
|
||
export const AgChartsEnterpriseModule: IntegratedModule = { | ||
VERSION, | ||
_Scene, | ||
_Theme, | ||
_Util, | ||
create: AgCharts.create.bind(AgCharts), | ||
createSparkline: AgCharts.__createSparkline.bind(AgCharts), | ||
setup: setupEnterpriseModules, | ||
setGridContext: RealLicenseManager.setGridContext.bind(RealLicenseManager), | ||
setLicenseKey: RealLicenseManager.setLicenseKey.bind(RealLicenseManager), | ||
isEnterprise: true, | ||
}; |
This file contains 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 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
2 changes: 1 addition & 1 deletion
2
packages/ag-charts-website/src/content/gallery/_examples/custom-marker-shapes/main.ts
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/ag-charts-website/src/content/gallery/_examples/multiple-scatter-series/main.ts
This file contains 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should either tie this into the
package:verify
ortest
tasks as a dependency so that it is run routinely.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be tied to the tests, question is do we already want to do it or should we wait until there's actually something to test?
There's also a question whether we should already add this to the
core
andenterprise
packages.