-
Notifications
You must be signed in to change notification settings - Fork 109
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
Provide geonode-mapstore-client package #1546
Comments
Regarding this issue I think it is worth to note, that the size of this repository has grown huge (around 1GB! already). Probably, this is due to the fact, that this repo represents actually a Django app which ships all static files, i.e. the compiled JS assets. However, as the |
Is there any advice how to deal with this problem? @mattiagiupponi is this a current limitation, that we cannot implement extensions/plugins separate from the geonode-mapstore-plugin, i.e. code laying somewhere else? Do you have any idea how to approach this? Otherwise I would have to fork the whole repository just for some simple plugins. What I want to do is to separate plugin development:
The default extension (from the template) loads ok and I can see the message. However, importing common components (like the
And this from the
|
hi @ridoo, @allyoucanmap could answer your questions. In general, what we did was to develop and build an extension (with MapStore as the only dependency) with the Extensions is the approach that we will continue to pursue since it also goes in the direction of uploading and configuring extensions at runtime. MapStore already supports this with the Application Contexts. The GeoNode client will soon have them, along with an updated version of MapStore itself. The development is at a good point. What will remain to be done is implementing the backend in GeoNode to support the upload of the extensions. |
@giohappy That sound good. I saw @dsuren1 is working on that, right? To me uploading plugins is not important. I just want to implement plugins/extensions re-using stuff from geonode-mapstore-client without placing everything inside a whole fork. Would this even be possible with Application Contexts and do you have a plan, when it becomes usable?
In fact, this is what I am trying to do. The challenge is to get the geonode-mapstore-client imports right. What I tried to describe is, that there's no good dependency for the extension's However, I tried some things. For example, I linked the geonode-mapstore-client project into my
Maybe the Another hack was to comment out the All these are quite hacky try-arounds. If you do not see any other option, I fear, forking geonode-mapstore-client is the way I have to go. |
@allyoucanmap will probably be able to give some feedback and guidance on this. {
"name": "client",
"version": "1.0.0",
"description": "mapstore extension",
"eslintConfig": {
"extends": [
"@mapstore/eslint-config-mapstore"
],
"parserOptions": {
"babelOptions": {
"configFile": "./node_modules/mapstore/build/babel.config.js"
}
},
"globals": {
"__MAPSTORE_PROJECT_CONFIG__": false,
"__MAPSTORE_EXTENSION_CONFIG__": false
}
},
"browserslist": {
"production": [
">0.5%",
"not dead",
"not op_mini all",
"not IE 11",
"not UCAndroid 12.12"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"scripts": {
"compile": "mapstore-project compile extension && node ./postCompile.js",
"lint": "eslint js --ext .jsx,.js",
"start": "mapstore-project start extension",
"test": "mapstore-project test extension",
"test:watch": "mapstore-project test:watch extension"
},
"devDependencies": {
"@mapstore/project": "1.0.22"
},
"dependencies": {
"mapstore": "git+https://github.com/geosolutions-it/MapStore2.git#2022.01.xx"
},
"mapstore": {
"extensionName": "EmpiricalEquationCalculator"
}
} |
See also GeoNode/geonode-mapstore-client#1546 Need to link local geonode-mapstore-client and add the path to webpack's `@js` alias mapping within the geonode-project. See the limitations in my comment GeoNode/geonode-mapstore-client#1546 (comment)
See also GeoNode/geonode-mapstore-client#1546 Need to link local geonode-mapstore-client and add the path to webpack's `@js` alias mapping within the geonode-project. See the limitations in my comment GeoNode/geonode-mapstore-client#1546 (comment)
@giohappy @allyoucanmap In fact, this is exactly what I am doing. However, with this I am only able to create the MapStore extension. But how to integrate the extension with geonode-mapstore-client (components, state, etc.)? For example, a simple button in the As described, I have tried to push the limits but it seems that I have to create another fork for such a simple extension/plugin. Am I wrong here? FWIW is to have some importable geonode-mapstore-client API which I can use to seemlessly implement plugins for geonode-mapstore-client. As far I can see, having just a mere MapStore plugin fells short if you want to (re-)use components and state of the geonode-mapstore-client. I guess, this is not an easy task and would need deeper thoughts how to make this possible. Edit: I added the |
We will need ideas from @allyoucanmap here :) |
We have some training documentation where it's described how to include a mapstore extension inside geonode-mapstore-client. The approach described in the training doc does not allow to access directly the custom modules/components from the geonode-mapstore-client but it allows to interact with the geonode-mapstore-client state and inject components inside pages. |
Interesting. Still limited, but may be enough for my simple case. Do you have a simple example, how to interact with the state inside the extension?
To be honest, I did not expect you are thinking of making geonode-mapstore-client client part of the MapStore project itself. I always thought of it as an actual client implementation using the MapStore framework. Not sure, if moving everything to MapStore is convoluting the framework. Does MapStore organize code to separate framework from specific implementations? However, if this would be possible, I think the geonode-mapstore-client repository could be thinned to contain the python integration only. |
npmjs does not list a (to be fair a very outdated) version of the geonode-mapstore-client. I understand that this repository is actually a python contrib app which provides single page UI (based on MapStore) as compiled static assets. However, the problem is, that there is no way* to add geonode-mapstore-client as JS dependency so that I import and re-use its modules.
(* of course I could link to a local working copy of geonode-mapstore-client, but this is not the idea how this should actually work, right?)
However, my plan is to extend existing plugins (i.e.
DetailsViewer
) and adjustlocalConfig.json
to make my own changes which I can ship with another contrib module. This contrib module adds a new resource type which I want to configure on the UI side. Before, I had to make my adjustments in a geonode-mapstore-client fork, but now I want to challenge the stack (geonode => geonode-mapstore-client => contrib module) to ship the UI changes within the contrib module itself.For more context, look here: geosolutions-it/MapStore2#9354
Expected Behavior
npm install @geonode/geonode-mapstore-client
or the like works.Other things I tried
Trying to
npm install 'https://gitpkg.now.sh/geonode/geonode-mapstore-client/geonode_mapstore_client/client?4.1.1'
runs into a gateway error. The repository is so big (due to the compiled JS assets), it becomes quite unhandy.The text was updated successfully, but these errors were encountered: