Comments (2)
How angular dependencies are imported in OpenSearch Dashboards
This package is used to ensure that the shared libraries are bundled once, loaded once, and then used everywhere
entry.js
file is a central place where it lists all the shared dependencies.
index.js
file is mapping file to map package to shared package.
Below is a summary about how angular dependencies are imported in OpenSearch Dashboards through osd-ui-shared-deps
:
note: For angular related package in osd-ui-shared-deps
specifically, we have 1) @osd/i18n/angular
2) angular
. I will use angular
as an example.
- When webpack encounters the angular import, it looks into its configuration for how to handle the import of the
angular
. index.js
handles the mapping for webpack. For example,angular: '__osdSharedDeps__.Angular',
tells webpack thatimports 'angular'
should be replaced with the global variable__osdSharedDeps__.Angular
. The global variable__osdSharedDeps__
is defined in the bundled output due to webpack configuration:
output: {
path: UiSharedDeps.distDir,
filename: '[name].js',
sourceMapFilename: '[file].map',
devtoolModuleFilenameTemplate: (info) =>
`osd-ui-shared-deps/${Path.relative(REPO_ROOT, info.absoluteResourcePath)}`,
library: '__osdSharedDeps__',
hashFunction: 'Xxh64',
},
- The
entry.js
file specifies how angular goes into__osdSharedDeps__
:export const Angular = require('angular')
. Here, theangular
module is bundled into the__osdSharedDeps__
global variable under the.Angular
property and imports will transfer to something like below to use the shared bundle:
const angular = window.__osdSharedDeps__.Angular;
Therefore, if we don't have angular
and @osd/i18n/angular
, we could simply clean the related parts.
Impact
OpenSearch Dashboards
As long as we clean out angular
and @osd/i18n/angular
, I don't see other impacts from cleaning osd-ui-shared-deps
for OpenSearch Dashboards.
- In OpenSearch Dashboards, for angular, we are using import directly. I don't see other similar usages like
@osd/ui-shared-deps/theme
,@osd/ui-shared-deps/monaco
,UiSharedDeps.externals
,UiSharedDeps.publicPathLoader
and etc related to angular. - For Testing, we will clean out all angular related tests. Seems not a problem to me.
- For Build Process, I am not aware of build process have any Angular-specific steps.
Third-party Plugins/Modules
Some of them might still rely on Angular. As we discussed in the morning, removing Angular from shared dependencies would break those plugins but since we are on the de-angular path for a long while we should see minimal impact. But we should be ready to help users with such impacts and this requires them to either 1) de-angular or 2) report to us.
Other Libraries/Utilities
Have checked and verified that no other libraries or utilities are dependent on Angular in any way.
from opensearch-dashboards.
Fixed in #4982
from opensearch-dashboards.
Related Issues (20)
- [BUG] Failed to fetch error on Discover page HOT 1
- [BUG] percentage values are not rounded off correctly HOT 2
- Opensearch dashboard pod is being in Startup probe failure. HOT 1
- [BUG][Discover] pattern with * as prefix it is not picking hidden index in discover HOT 2
- [BUG]Datasource picker in discover sending multiple redundant requests HOT 1
- [BUG] theme:darkMode cause security plugin login page blank HOT 1
- Custom CSS/JS
- Description for Saved search visualisations are not displayed as info icon while adding them in dashboards.
- [Derived Fields] Derived fields integration with Dashboards
- Permissions on the UI are not displayed in the index permissions category [BUG]
- Support query assist in discover
- [BUG] Add security_tenant parameter for short links HOT 1
- [BUG] Can create multiple Data Source using the same Data Source Name through API
- [Multiple Datasource] Add data source selection service to support storing and getting selected data source updates HOT 1
- same visualization works in opensearch 2.13, but fails in 2.14 HOT 4
- [Workspace] Only OSD admin can create workspace
- [BUG]
- [BUG] Set default data source unstable issue
- [BUG][Discover] Updating a filter for a saved search does not show up when sharing
- [BUG] Dashboards does not properly process custom timestamp formats for index mappings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opensearch-dashboards.