Skip to content
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 type checking for initial startup state provided by hosting app #615

Open
gideonthomas opened this issue Feb 28, 2017 · 0 comments

Comments

@gideonthomas
Copy link

We have a bunch of state that we pass in via the hosting app or set defaults in the StartupState, particularly for UI preferences https://github.com/mozilla/brackets/blob/master/src/bramble/StartupState.js#L15. Here: https://github.com/mozilla/brackets/blob/master/src/extensions/default/bramble/main.js#L185-L195, we initialize that state blindly without checking if the values are being set to what is being expected (for e.g. booleans, objects, etc.). This results in us having to do some pretty heavy-handed type checking here: https://github.com/mozilla/brackets/blob/master/src/extensions/default/bramble/lib/UI.js#L89-L110. Let's try to move that type checking into the .ui function so that we can define properties on it and specify the types they accept. I think the way PreferencesManager does it is pretty nice (https://github.com/mozilla/brackets/blob/master/src/editor/Editor.js#L159-L222) and might be a model we want to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant