Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Add Type Checking API#230

Open
MisterUncloaked wants to merge 16 commits intoRoblox:masterfrom
MisterUncloaked:type-checking-api
Open

Add Type Checking API#230
MisterUncloaked wants to merge 16 commits intoRoblox:masterfrom
MisterUncloaked:type-checking-api

Conversation

@MisterUncloaked
Copy link
Contributor

Closes #227

Added a public API for type checking in Roact

  • Added nameOf function to Type to lookup the string name for any Type
  • Added TypeMirror module which exposes a subset of types in Type without exposing the internal Roact symbols
  • Added Roact.Type and Roact.typeOf to expose a type checking API for external use

Checklist before submitting:

  • Added entry to CHANGELOG.md
  • Added/updated relevant tests
  • Added/updated documentation
Added a public API for type checking in Roact - Added nameOf function to Type to lookup the string name for any Type - Added TypeMirror module which exposes a subset of types in Type without exposing the internal Roact symbols - Added Roact.Type and Roact.typeOf to expose a type checking API for external use
@coveralls
Copy link

coveralls commented Aug 9, 2019

Coverage Status

Coverage increased (+0.4%) to 93.683% when pulling 666d7a9 on MisterUncloaked:type-checking-api into 9493406 on Roblox:master.

- removed userdata dance in TypeMirror.lua - removed redundant checks in TypeMirror.lua - removed redundant declaration of allowed Roact types
@MisterUncloaked
Copy link
Contributor Author

This PR is ready for another pass - tests and docs are updated with Roact.isComponent (formerly Roact.isValidElementType)

@MisterUncloaked
Copy link
Contributor Author

This PR should be ready to go at this point.

- removed Without Type Checking example that used undocumented internals - removed info blurb about only accepting component classes for additional safety
@jeparlefrancais jeparlefrancais mentioned this pull request Aug 21, 2019
4 tasks
@MisterUncloaked
Copy link
Contributor Author

@LPGhatguy anything else you'd like to see here before we get this merged?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.