Hey Airtable Community,
We’re excited to announce the newest version 2.0.0 of our command line tool for custom block development, @airtable/blocks-cli.Thank you to the developers and community forum members that provided feedback and beta tested this version prior to release.
What new features can you expect?
We heard feedback that it was difficult to share code between block projects, and the inability to customize the way block’s code was bundled limited what developers could build with blocks. To that end, we’ve worked to release the following features.
Use code from other directories: This version allows the bundling of “sibling directories” outside the source directory. Those directories can include npm imports based on link or file.
Using a custom bundler: This version uses webpack and allows you to swap out our built-in bundler for your own, custom, bundler. You can provide a complete custom bundler implementation, or you can start with the Webpack bundler package and tweak the configuration to suit your needs.
What if I don’t want to upgrade to version 2?
That’s fine! This is not a forced upgrade, and these new features are purely additive. Feel free to revert back to older versions if v2 is not for you.
We’re very excited about our plans for the developer platform in 2022 - stay tuned!
Hey @Albrey_Bristo-Brown, great news. Questions:
Does the new cli support an external tsconfig.json file? We always need to add support for experimentalDecorators due to mobx. If not, can you please add an example on how to use our own custom tsconfig.json file in a custom bundler in the webpack bundler package readme?
Can we add the latest version of the
@airtable/blocks package to a non-airtable project without it complaining that it needs to run within a context of a base? We have a shared npm package we use for both airtable and non-airtable apps that depends on the blocks package and we needed to patch it in order to use it in non-airtable apps. If not straight out of the box, can we somehow accomplish this using the new custom bundler? If yes, can you also please provide an example for that?
Hey @Kevin_Wilde , this is great. Just checked it out, and everything works. Thanks!
Question - will it also work with monorepos and code from other directories?
Regarding my 2nd question, we were able to work around that by using patch-package, but if a better solution using a custom bundler exists, would be great.
It should work with monorepos and shared code. I think I’d need to see an example of what you are trying to achieve with adding
@airtable/blocks to a non-airtable project – not sure I quite follow. If you can share a simplified example of your code and how you’ve patched
@airtable/blocks that might help me understand.
We do have a simple example of sharing code with yarn workspaces here GitHub - Airtable/apps-shared-code: Shared code app examples, although I think you have seen this already.
Hey @Kevin_Wilde , I’ll work on an example repo and let you know once done.
I do have another important question that is relevant to many app creators - we’d like to integrate sentry.io error monitoring into our app. Sentry has a webpack plugin, see here. It needs to be configured with an include param that specifies (from the documentation):
One or more paths that Sentry CLI should scan recursively for sources. It will upload all
.map files and match associated
Can you please provide guidelines on how to use this plugin together with the typescript custom bundler? Would be highly appreciated.