-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Idea: Experimental feature flags for CesiumJS #9639
Comments
I like this idea. It reminds me of Just to make sure everyone agrees, code that's merged into Since this is mainly for developers I would guess that even I think it's worth trying and I'm curious what others think. |
Ah yes, I totally agree that we would still want good test coverage for any experimental features. |
👍 for an |
@ebogo1 That's a good point, though I think we should keep this simple, just a flat list of flags for now.
I plan to make a PR for this early next week. In the code I'll include a block comment so we can describe best practices for this from the start. Some ideas:
|
Today this came up when talking with @mramato, he was on board with the idea, but he had one big suggestion as far as best practices go:
|
One note about this that @sanjeetsuhag and I discovered while designing the new Model: Sometimes checking the flag when you construct an object is the simplest way that effectively works. This is because:
One alternate is to make a function to get function getModelClass() {
if (experimentalFeatures.enableExperimentalModel)
return ModelExperimental;
}
return Model;
}
// usage
var Model = getModelClass();
var model = new Model(options); Another is to use a factory function: function makeModel(options) {
if (experimentalFeatures.enableExperimentalModel)
return new ModelExperimental(options);
}
return new Model(options)
} In our case I'd prefer the former, since we have both |
Closing this as |
Thinking about the future of the
Model.js
refactor (a large part of #9520), one concern is migration will prove difficult, as there are many, many intertwined features there.To help avoid creating staging branches for many months on end, it would be nice if we had some standard mechanism for enabling/disabling experimental features. This way, users can try out new features before they are fully finished.
For example, for 3D Tiles it would be very helpful if the contents could do something along the lines of:
Then applications only have to specify
Cesium.ExperimentalFeatures.enable3DTilesNextModel = true
to try the new version of Model.This could be used for other large features in the future as well. The important thing would be to clearly mention that experimental features are subject to change from release to release, use at your own risk.
What are your thoughts, @sanjeetsuhag, @lilleyse, @ebogo1? Is
ExperimentalFeatures
something that would benefit CesiumJS in the long run? Are there any potential pitfalls to doing this?The text was updated successfully, but these errors were encountered: