Open linegallen opened 9 months ago
Good idea :) There is a similar initiative with vite, made by an itowns user: https://github.com/dayjournal/itowns-starter
Good idea!
Following your issue and because I needed a basis for a demo, I tried to implement your proposal. There is however a couple of technical issues if we want a seamless experience:
Multiple instances of Three.js being imported
warning due to a duplication of this dependency. This can lead to multiple unexpected runtime errors (e.g. when using a custom renderer). This is caused by the webpack
resolving three
as a CJS
module when imported by itowns and as an ESM
module when imported by the final application.
Context
In order to improve their experience with iTowns, users are widely included and have been interviewed to give their feedback and requirements. This process highlighted potential enhancements, needs or issues that can be solved by collaboration between users, UX designer and developers. All the following suggestions are based on interviews with users and discussions with iTowns teams.
Getting started with iTowns for a new project assumes that the user must write all setup files, even if he/she already did that for a former project. It can be inconvenient for some reasons :
Furthermore, some users reported a complex first setup of iTowns.
Solution
We can improve and facilitate this getting-started user experience with a new Github repository. Thus, users could access with very few click a skeleton with the bare necessities to start every small project they want : demos, research or students projects.
The user will just have to fork and clone
itowns-starter
to begin iTowns handling.The repository title is open to reconsideration with the community, given that I propose several repositories : one for each bundler supported by iTowns. We should start with webpack, considering that it’s one the most used.
Like a new project on Blender display a cube to manipulate, this skeleton would contains an empty globe-view 3D scene with international aerial imagery data. Ideally, it would also contain the DEM.
Sources
,Layers
andViews
will be separated with a careful text formatting to keep it easy to understand and adapt.Widgets
.To ensure this skeleton responds to the getting-started use-case, it should be tested with users to collect feedback.
This work will involve changes on the getting-started user journey. Then, it must be taken in consideration into the documentation, especially the "Preparing the webpage" section on each tutorials. The “how to run” and “How to use it in your project?” section will be impacted too.
Example
This following code snippet illustrates what the js file could contain.