-
Notifications
You must be signed in to change notification settings - Fork 47
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
Explicit dependency on jquery is not necessary, should be removed IMHO #52
Comments
beta.9 was not installing jquery at all Resulting in this error during the "yarn prod" process: That's why it's re-introduced in beta.10 |
That's because we still are on admin-lte 2.3 As soon as we fixed the issue #25, we could only depend on admin-lte 2.4 (and its own subdependencies for jquery and bootstrap) |
I see, so the goal is the same, just not achievable with admin-lte 2.3.x. |
About transitive dependency matter, can I ask you a question? I'm trying to build a coreProject that imports ngx-admin-lte and add other some services and components of mine that I should use in all my projects. I build coreProject and export it. In all my projects that include coreProject (with embedded ngx-admin-lte) I would like:
But... I got error building the projects, because they have not access to components and services of ngx-admin-lte. Is there a way to have ngx-admin-lte passing through my coreProject ? |
@fabioformosa Excellent points you bring up. Just the last two days I had to put in a hack, just to override the HTML template of the user-box. I wished there was a way to specify either a different Component or at least just provide a different layout, similar to your first bullet point. |
On the menu and routes, I was able to define my own menu, along with routes to my own components. Can you be more specific about the errors, I am afraid I cannot follow your concern. Show us the error, please. Does project A which inherits from Is that a case ? Because there is a solution for that, it is called re-exporting. |
Ideally, you should not have to export components from Rather, have services from |
Hi @catull , Answering to your request of further details, I have: I would like to carry-out this scenario:
ProjectA should use theme offered by coreThemeModule "as-is", except for menu and header/footer customization.
ProjectA shouldn't have ngx-admin-lte in package.json, neither admin-lte, bootstrap. I think that should be transitive dependencies. At the moment the error I got compiling ProjectA is: Should coreProject export ngx-admin-lte modules? Should CoreProject wrap ngx-admin-lte modules? (I'm interested at your hack to customize user profile box, it will be my next task as well. Maybe it's worth to open an other issue to address this one) |
My setup is a bit simpler, I have "styles": [
"styles.css",
"assets/integrator-theme.css",
"../node_modules/bootstrap/dist/css/bootstrap.css",
"../node_modules/ionicons/dist/css/ionicons.css",
"../node_modules/admin-lte/dist/css/AdminLTE.css",
"../node_modules/admin-lte/dist/css/skins/_all-skins.css",
"../node_modules/@swimlane/ngx-datatable/release/index.css",
"../node_modules/@swimlane/ngx-datatable/release/themes/material.css",
"../node_modules/@swimlane/ngx-datatable/release/assets/icons.css",
"../node_modules/font-awesome/css/font-awesome.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/admin-lte/plugins/jQueryUI/jquery-ui.js",
"../node_modules/bootstrap/dist/js/bootstrap.js",
"../node_modules/ace-builds/src/ace.js",
"../node_modules/ace-builds/src/ext-language_tools.js",
"../node_modules/ace-builds/src/ext-split.js",
"../node_modules/ace-builds/src/mode-java.js",
"../node_modules/ace-builds/src/mode-json.js",
"../node_modules/ace-builds/src/mode-xml.js",
"../node_modules/ace-builds/src/theme-idle_fingers.js",
"../node_modules/ace-builds/src/theme-github.js",
"../node_modules/ace-builds/src/theme-xcode.js",
"../node_modules/admin-lte/dist/js/app.js",
"assets/js/scripts.js"
], |
What does |
ok. ProjectA needs to use LogoService of ngx-admin-lte but currently ProjectA can't use it. At the moment, only CoreProject can use LogoService. I tried
but it seems it's not the way |
import {
User,
MenuService,
LogoService,
FooterService
} from 'ngx-admin-lte';
@NgModule({
imports: [
CommonModule,
RouterModule,
NgxAdminLteModule
],
declarations: [coreProjectComponent],
exports: [
coreProjectComponent,
User
],
providers: [
MenuService,
LogoService,
FooterService
]
})
export class CoreProjectModule { } Any better ? |
Services and guards are provided, components are exported. |
Oops a little oversight. However I don't get the target yet.
simple-kaishi -> kaishi (coreProject) -> ngx-admin-lte I've opened an issue to avoid OT at this issue Any help is appreciated. I've not published kaishi in npm registry, so you should:
|
Update: Kaishi is now a core library that wraps ngx-admin-lte and it could export other core service as well. Getting back to the subject of this issue, as far as you know, is there a way thorugh ngx-admin-lte can include resources (styles, and others) in its bundle? |
As we're now providing APF format, we could maybe do something with the main "style.css", and probably manage to import that. In the same way, we can probably import jquery,bootstrap js etc... in a main js file, for this import to be hidden. |
In 2.0.0-beta.9
jquery
was removed as a direct dependency, it is an indirect dependency.In 2.0.0-beta.10
jquery
was re-introduced.Fact is, you don't need to specify this dependency.
Because if you leave it out,
admin-lte
has a dependency onjqeury
and will pick it up.You end up having
node_modules/jquery
anyway.For the same reason, we should NOT explicitly include
bootstrap
.Why not ?
Because
jquery
andbootstrap
are transitive dependencies of our dependencies, most likelyadmin-lte
.[email protected]
depends on a specificbootstrap
andjquery
version.[email protected]
depends on slightly differentbootstrap
andjquery
version.All I am saying is, let
[email protected]
figure out which sub-dependencies it has.If we specify a certain version, we are only asking for more maintenance on OUR side.
Where is the benefit of that ?
My web app has never specified
jquery
EXPLICITLY, becauseadmin-lte
and/orbootstrap
has always had that responsibility.Guess what,
bootstrap
4 apparently has no more direct dependency onjquery
.It has a peerDependency relationship though, see: bootstrap dependency on jquery
The text was updated successfully, but these errors were encountered: