iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.07k stars 290 forks source link

Monorepo structure #2300

Open gchoqueux opened 3 months ago

gchoqueux commented 3 months ago

Description

Refactoring iTowns to monorepo structure.

The goal is to split itowns down into feature packages. As an example, I've started with the geodesy functionalities. (@itowns/geodesy) ~I use lerna to watch and build packages while the dev server is in use, but I'm not completely satisfied because the files aren't supplied via memory and files are also transpiled into the browser's debugger. Lerna is also used to test packages.~

For the moment Debug and Widget modules are private.

Motivation and Context

Split code in packages for clearly structured code. Simplifies development and facilitates contributions. Increases the scope of users who only want to use a few functions. This structure makes it necessary to make functions independent

gchoqueux commented 3 months ago

@Desplandis I resolve some issues

Desplandis commented 3 months ago

@gchoqueux Nice! I will take a quick look of your changes and write a todo list of things that should absolutely be tested before reviewing more thoroughly this PR. Expect it for tomorrow or next tuesday!

@jailln @mgermerie @ftoromanoff @AnthonyGlt I think we'll need your inputs on this change! ;)

This should be a good start to fix #2197, #1930, #2201 (list not exhaustive, feel free to complete). Shall we create a meta-issue to aggregate all those issues?

AnthonyGlt commented 2 months ago

I'll we check it out once the PR is reopen, thanks for the work

Desplandis commented 2 months ago

@gchoqueux I managed to correctly configure babel without having to resort to non-standard configurations in webpack. With my fixes, we just need to add an alias in the webpack configuration.

Shall I wait for further changes to push those commits?

P.S.: I even managed to convert one of the subpackages to typescript by changing its local babel configuration.

gchoqueux commented 2 weeks ago

note that the Debug package is in private

gchoqueux commented 2 weeks ago

I propose a live presentation to explain this PR

gchoqueux commented 1 week ago

Branch rebase on master Webpack serve was fixed

jailln commented 2 days ago

I propose a live presentation to explain this PR

In my opinion the first thing to do is to agree together on the modules separation (i.e. on a final expected list of sub modules) and on the way / order in which it should be done to avoid going back and forth and so that anyone can contribute to this subject. We can discuss it all together in a call first if you want but I think it will need to end up in an issue eventually. WDYT?

Desplandis commented 2 days ago

Yeah, I agree with @jailln and think we should start an issue/proposal where we could centralize all discussions on package splitting (use-cases, explanation of architectural/tooling changes, a sort of informal roadmap, ...). As long as we discuss those topics, I'm all in for a presentation.

@ftoromanoff, @mgermerie and @AnthonyGlt, I think you should participate too. =)

gchoqueux commented 2 days ago

in this PR the modules follow the itowns structure

jailln commented 2 days ago

in this PR the modules follow the itowns structure

  • itowns : already existing module
  • widget : already in separate structure in src/Utils/guiand a specific bundle itowns_widgets, in this PR this module is private and it isn't published
  • debug : already in separate structure in utils/debug and a specific bundle debug, in this PR this module is private and it isn't published
  • geodesy : new module to measure and represente the geometry, gravity, and spatial orientation of the Earth in temporally varying 3D.

Ok thanks, this is fine by me. I would just rename geodesy to geographic, WDYT? What we should discuss/list in an issue is what are the next steps (next modules) and in which order we should split them

gchoqueux commented 1 day ago

geodesy includes gravity, orientation, coordinates. Even if the name is less well-known, it's the right term used by professionals. I think it's worth communicating about these rare features.