Jun 22, 2020 10:27 AM
The Custom Blocks contest deadline is approaching! Do you have questions about releasing or debugging your block? We’re hosting our third live Ask Me Anything (AMA) session in this thread on Wednesday (6/24) at 11am PT.
Billy Littlefield and Tim Deng from our platform engineering team will be ready to answer any development questions you have.
We’ll be picking 3 questions at random to win a $40 Amazon gift card. Any solutions offered by the community will be included in the draw as well. You can even start posting your questions now, and we’ll be answering questions live from 11am - 11:30am PT on Wednesday. See you there!
Jun 23, 2020 10:45 PM
The block I’m building will require an external library’s CSS to be imported/loaded. My original plan was to install Webpack to do this, but there weren’t any Blocks examples that use it. To your knowledge, would I be able to install webpack as I would with any other React app, or would the Custom Blocks setup require a different approach? Does the way Blocks are transpiled interfere with Webpack?
Jun 24, 2020 05:19 AM
I’m aware that there are official airtable widgets for building UI, but can I use 3rd-party UI widgets library? (MIT licensed)
Jun 24, 2020 07:15 AM
There was some discussion about writing tests for custom blocks a while ago. I’m still finding the most success with the “test mode” that I had suggested to the original poster, but I’m curious if you could expand on Kasra’s second idea:
If I have a
layout function that makes calls to Custom Block APIs, wouldn’t I still need access to those functions outside of the Airtable environment to perform a unit test? Or was Kasra’s suggestion more along the lines of a
layout function would be called before passing to an Airtable API and the unit test could be used as a way to ensure valid information is being passed in?
Jun 24, 2020 07:22 AM
Do you have any advice or guidelines on how to present errors to users? I know some of the examples include permissions and other checks before performing operations for Airtable-specific API calls. More generally though, can you share best practices, UI-wise, on how to present users with error information?
Some ideas I can think of are:
Obviously, some/all/none of these might work for different use cases. I’m trying to see if there’s any built-in UI components (I don’t think so?) or best ways to incorporate custom components (like
Jun 24, 2020 08:07 AM
I’ve just finished a very first version of Image Annotation block. Here is a demo: https://www.youtube.com/watch?v=1O6hSDny2TA. Could you give me some feedback on what to improve before releasing it?
And some more quesitons:
Jun 24, 2020 08:42 AM
I have a button that creates a new record using
createRecordAsync() when clicked. I would like to open the newly created record once this is done using
createRecordAsync() only provides the record ID and not the record object. Loading the new record using
useRecordById() seems to break hook rules; this is all in an async function. Any advice?
Jun 24, 2020 09:21 AM
I think you’ll need to do those as separate actions. So create the record and close out that
async action. You have your recordID, so in a new action use that record to expand it. Trying to access a newly created record within the same
async block that it is being created generally isn’t going to work because you aren’t guaranteed to have the record available yet. But once you’ve
awaited the return of the
async function, you can be guaranteed to have that recordID to work with.
It’s also just generally good practice to segment out actions like this. It’s the universal temptation for developers to get as much done in a single go or block of code as possible. It feels more efficient, and it feels quicker, like you can get more done with fewer lines of code. That’s probably true; but in the long run, using more lines of code, and more tedious-feeling cycles of “doing an action --> saving the result --> doing some new action on that result” will result in generally more resilient and easier to understand/modify/expand code.
Jun 24, 2020 10:12 AM
Thank you for implementing my suggestion use a random drawing for awarding the gift card!
Jun 24, 2020 10:16 AM
Is there a way for a block to put up an alert outside the context of the block itself?
For example, if a block is monitoring a table and notices an error condition, is there some way for the block to notify the user, even if the user does not look at the block? Modal dialog boxes seem to work only in the context of the block, and
alert is very ugly and probably best for debugging purposes.
Jun 24, 2020 10:20 AM
It appears that in order to have a remote release of a block, the block author needs to be a collaborator with creator permissions in the target base. Can you confirm this?
Is there a way to install a custom block without the developer being a creator?
Does the block remain after the developer/creator is no longer a collaborator?
Jun 24, 2020 10:45 AM
There was a little discussion about external CSS files and Webpack in this topic thread and the answer seems to be: not currently possible. It seems like external CSS can only be loaded using
I’m curious to hear from the Airtable folks how block transpiling interacts with Webpack and/or other command-line tools.
Jun 24, 2020 10:45 AM
I noticed that when I click the “Custom” button next to the name of a custom block, it shows
Is all of this information set automatically? Can we change it to display a different name or email address?
Jun 24, 2020 10:46 AM
I noticed that there is a version number in
block.json. Is this version number displayed to the block user anywhere?
Are there guidelines for where to display version information to the user?
Could it be included along with the contact info for the block developer when the “Custom” button is clicked?
Jun 24, 2020 10:47 AM
It looks like the
.block folder lists remotes, including base app ids. I’d rather not include my app ids in a public git repository.
However, this folder is not included in the .gitignore file by default.
What are the implications of adding this folder to the .gitignore file?
How hard will it be for someone to re-create my custom block if I add this folder to .gitignore?
Jun 24, 2020 11:02 AM
Hey y’all, Billy and I will be live for the next 30 minutes to answer your questions!
Jun 24, 2020 11:05 AM
Yes, you can use third party open source packages in the contest as long as you are using it in accordance with their license terms. You can refer to our contest rules if you have any further queries!
Jun 24, 2020 11:07 AM
Several times when I try to create a new block from the command line, I get
npm enoent errors, and can’t create the new block. I can’t tell any difference between when it works and when it doesn’t. Sometimes I have to come back hours later and try again.
Jun 24, 2020 11:07 AM
Hi Kamille! The way that the
@airtable/blocks-cli builds the blocks is currently not configurable, so the webpack approach won’t work in the current state. The SDK provides a couple of ways to include CSS, though – loadCSSFromString & loadCSSFromURLAsync
Jun 24, 2020 11:13 AM
Some good guidelines to follow:
We have a number of UI components that can help with some of these interactions this built into the SDK:
iconprop which can help illustrate intent, and
You’re also welcome to use third-party libraries as you would in other apps (e.g.
npm install cool-ui-library ). If you have any feedback about the UI components that do exist in the SDK (see the docs site for a full list) we’d love to hear it!