@native: A revolutionary new way to write Capacitor plugins

I’m happy to announce the release of @aparajita/capacitor-native-decorator for Capacitor 3.

This package revolutionizes the way we can write plugins. In the process of developing Capacitor plugins, I built up a big wish list:

  • I wish I only had to make one TypeScript version of my plugins for all platforms.

  • I wish I could pass values to a plugin without constructing an object.

  • I wish I could receive a single value from a plugin without needing to deconstruct an object.

  • I wish my plugins could leverage the full power of TypeScript code when running native.

  • I wish I could manage state and add TypeScript convenience methods in my plugin classes without having it disappear when running native.

  • I wish I didn’t have to maintain the ios/Plugin/Plugin.m file manually.

Thus was born @native. With @native, you get all of these things and more! Check it out at: GitHub - aparajita/capacitor-native-decorator: @native decorator for Capacitor that revolutionizes the way we write and call plugins

1 Like

Amazing job man! I’ll try the first occasion… Thanks!

Thanks! Let me know what you think. I can’t imagine writing plug-ins without it, it completely changes what you can do.