You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OL-Cesium was created almost 10 years ago. At that time we used the Google Closure Compiler (GCC) which was a visionary tool to organize and type-check your code. It also allowed to depend on just the code you needed and produced highly optimized builds.
Fast forward 10 years, the javascript ecosystem has evolved:
typescript has become the defacto way to write typechecked code;
bundlers are used by everyone to consume dependencies. In addition, CDNs allow to consume ES modules directly.
The OL-Cesium way has evolved with time: we no longer rely on GCC, we publish ES module build to npm, we have started migrating to typescript. It is now time to revisit our build system and move forward with the released formats.
Build system
We currently use webpack, with a complex set of configuration files.
I discussed the topic with @fredj, we propose switching to parcelJS wich is a modern and efficient bundler and developping environment. It would allow to drastically simplify the configuration (we only need to declare a few targets in package.json. Also, parceljs is fast and well maintained.
Released formats and packages
We currently release 2 packages:
ol-cesium which contains the bundled library in UMD format + commonjs + raw source code;
olcs which contains the transpiled source code (js files) put in the root directory. This is consummed by doing direct imports like `import olcsContribLazyLoader from 'olcs/contrib/LazyLoader.js'.
The package.json specification now allows to do this in a single package. I discussed the topic with @fredj, we propose to only release the olcs package with 2 modes: direct access (as before + access to the ts source) and bundled (similar to what was done wi ol-cesium, but as an ES module 2022).
The future olcs package would thus allow these to patterns: import olcsContribLazyLoader from 'olcs/contrib/LazyLoader.js'; import {olcsContribLazyLoader} from 'olcs'.
The ol-cesium package will be deprecated and receive no more update.
The UMD and commonjs formats will be abandonned.
Proposed actions
switch from webpack to parcelJS
have a module dist/olcs.js target to publish the library as an ES2022 bundle
have an exports: (olcs/*: dist/olcs/ to expose the transpiled source code as pure JS), we need to fix the js (like done currently for the olcs package) Open question: can parcel do that for us?
have a examples examples/ target to allow developers to incrementally work on the features
have a packages/demo to be able to test the generated package in real condition / ideally we can reuse / test the same examples
deprecate ol-cesium package, only publish "olcs" -> rename ol-cesium to olcs in the commited package.json
expose the typescript types in package.json
Feedback
I think it is a good evolution for the library and its users.
I welcome your feedback on this breaking change.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
OL-Cesium was created almost 10 years ago. At that time we used the Google Closure Compiler (GCC) which was a visionary tool to organize and type-check your code. It also allowed to depend on just the code you needed and produced highly optimized builds.
Fast forward 10 years, the javascript ecosystem has evolved:
The OL-Cesium way has evolved with time: we no longer rely on GCC, we publish ES module build to npm, we have started migrating to typescript. It is now time to revisit our build system and move forward with the released formats.
Build system
We currently use webpack, with a complex set of configuration files.
I discussed the topic with @fredj, we propose switching to parcelJS wich is a modern and efficient bundler and developping environment. It would allow to drastically simplify the configuration (we only need to declare a few targets in
package.json
. Also, parceljs is fast and well maintained.Released formats and packages
We currently release 2 packages:
ol-cesium
which contains the bundled library in UMD format + commonjs + raw source code;olcs
which contains the transpiled source code (js files) put in the root directory. This is consummed by doing direct imports like `import olcsContribLazyLoader from 'olcs/contrib/LazyLoader.js'.The package.json specification now allows to do this in a single package. I discussed the topic with @fredj, we propose to only release the
olcs
package with 2 modes: direct access (as before + access to the ts source) and bundled (similar to what was done wiol-cesium
, but as an ES module 2022).The future
olcs
package would thus allow these to patterns:import olcsContribLazyLoader from 'olcs/contrib/LazyLoader.js';
import {olcsContribLazyLoader} from 'olcs'.The
ol-cesium
package will be deprecated and receive no more update.The
UMD
andcommonjs
formats will be abandonned.Proposed actions
Feedback
I think it is a good evolution for the library and its users.
I welcome your feedback on this breaking change.
Beta Was this translation helpful? Give feedback.
All reactions