Git Product home page Git Product logo

blocks's People

Contributors

hongdajiang-at avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blocks's Issues

ExpandRecord function suddenly starts bugging

I have been working on an extension for months now and went in beta since like a month, and for a long time of this period I've been able to use the ExpandRecord() function without issues. Suddenly this week I start noticing that when my extension calls that function for a record from a certain table, then the extension crashes and I get the standard Airtable message "An error has occured - Refresh the page."

This seems like something changed in the blocks SDK causing this issue. Anyone else experiencing this?

Fail to run block-cli v2.0.0.beta 2

When I ran "block run" on my existing project, the command failed with the followin message:
Error: Cannot find module 'C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\lib\commands\run'
Require stack:
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\config\lib\plugin.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\config\lib\config.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\config\lib\index.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\command\lib\command.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\node_modules@oclif\command\lib\index.js
- C:\Users\mylaptop\AppData\Roaming\npm\node_modules@airtable\blocks-cli\bin\run
Code: MODULE_NOT_FOUND

Block-cli v0.064 can execute without any problem. Please help

ENOENT: no such file or directory, chmod

I use volta to manage my Node instances, and running into an issue installing this package. No other package is affected.

Here is the log output:

➜  air (2.5.9) npm install -g @airtable/blocks-cli
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /Users/newuser/.volta/tmp/image/packages/.tmpi7RTLM/lib/node_modules/@airtable/blocks-cli/node_modules/loose-envify/cli.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/Users/newuser/.volta/tmp/image/packages/.tmpi7RTLM/lib/node_modules/@airtable/blocks-cli/node_modules/loose-envify/cli.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/newuser/.npm/_logs/2021-11-27T19_52_58_916Z-debug.log

Babel bundling warning

Hey,

Getting this when calling block run:

[BABEL] Note: The code generator has deoptimised the styling of C:\Users\user1\AppData\Roaming\npm\node_modules\@airtable\blocks-cli\transpiled\src\builder\server\.next\static\chunks\pages\_app.js as it exceeds the max of 500KB.

Upgrade blocks-cli to work with latest node version and fix block release

Hi
I needed to write a custom bundler for my project using webpack 5, babel, antd... In the process I have upgrade the current blocks-cli source code to work with the latest version of nodejs, npm and fix the issues when running rmdirAsync function (blocks-cli/lib/helpers/system_extra.js) which causes block release to hang. The dependencies of blocks-cli are also upgrade using npm-check-updates. The whole source code is attached.

Also I extended the default bundler to work with webpack 5. The webpack config and the custom bundler are attached. Using my custom bundler, I was able to reduce bundle size from 43 Mb to 4.9 Mb.
https://drive.google.com/file/d/1ZInf3OL9sHv9lp-ZeXHnPe6Tg-wEPMQj/view?usp=sharing
webpack_airtable.zip

Cannot Install Package - ERR! Cannot read property 'split' of null

When I try to run npm install -g @airtable/blocks-cli I get ERR! Cannot read property 'split' of null error.

I am running node v14.16.1 and I am on a Mac. Here is where the error occurred in my debug log. Let me know what else I can provide to be helpful. Thanks.

4557 timing metavuln:cache:get:security-advisory:@airtable/blocks-cli:C/VB8CBFYps5hrxkx+bDeYa+ffIErGhYkhstwHUZHTBCGKjnpC6rPfK8BmDaGzjLMiSFCtFVyGpG3jhDR9+7yQ== Completed in 0ms
4558 verbose stack TypeError: Cannot read property 'split' of null

FieldType 'MULTIPLE_RECORD_LINKS' lacks relationship option (single vs. multiple foreign records)

I am using the Block API and noticed that the FieldType 'MULTIPLE_RECORD_LINKS' doesn't provide information about the relationship option (whether it allows linking to only a single foreign record or multiple records). This information can be quite important to handle the foreign key field differently.

There's also not a 'SINGLE_RECORD_LINK' FieldType either (which would be more ideal actually).

Is that a known issue, or there's anywhere I can get that information through the Block API?

Support newer version of React, at least 17

It has become easier to add external dependencies to custom apps, and that is great. However it has been limited by the version of React below 17. I am using npm v8.6.0, and it npm install fails due to peer dependency conflict when installing a module that depends on higher version of React. If I run it with --legacy-peer-deps, it looks like it worked, but then when I run block run, I get an error that blocks-cli cannot be found.

CellRenderer cropping cell Value

Version: "@airtable/blocks": "^1.11.1"

When using the CellRenderer component, we noticed that it is cropping the value of the record at around 500 characters.

To reproduce, you can use the CellRenderer with a long enough text.

<CellRenderer 
   field={f}
   cellValue="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla erat ex, ultrices at erat non, aliquam dictum mauris. 
    Nullam id libero nec nunc dapibus tempor ac id mauris. Fusce sed enim nec lacus tempus vulputate ut eget massa. Sed in 
     lorem rutrum, congue nibh eu, semper erat. Vivamus blandit posuere pulvinar. Ut aliquam sapien eget odio vehicula, ut 
     accumsan quam ullamcorper. Pellentesque non eleifend mi. Curabitur risus erat, accumsan blandit placerat id, cursus nec 
      tortor. In at viverra quam, eu dignissim nisi. In interdum iaculis ex, malesuada suscipit nisi malesuada et. Nulla placerat sit 
       amet mauris quis suscipit. Sed eleifend hendrerit nibh a cursus."/>

Same behaviour if instead of cellValue we use record={r}

Cannot load svg files into app

I have a local svg file, but I can't load it. I'm getting this error:

Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

Is it possible to add an svg loader to the webpack runtime?

webpack < 5 used to include polyfills for node.js

I'm trying to run an application using airtable tutorial, however once I run block run this error appears:

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

Since we don't have control over the webpack configuration for this, how can we fix it?

Old Firefox v52 target in preset-env breaking build

Please consider upgrading the minimum browser targets or maybe using browserslist at https://github.com/Airtable/blocks/blob/master/packages/webpack-bundler/src/javascript_config.ts#L5

In my case the latest version of Mapbox GL (v2.6) now includes an object spread operator in the build. Object spread needs Firefox 55, but the CLI is targeting >52 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax#browser_compatibility Firefox v52 is from 2017?

Alternatively, an option to skip transpilation of specific modules would also work. I tried the Webpack '!' exclude before the module name but that isn't working in this setup.

Alternatively an option to include specific modules for transpilation would work (had that backwards) I think the issue is that babel-loader expects the imports to either be compatible with the target or included for transpilation.

Support `yarn` during `block release`

I tried to release my block after having installed dependencies locally with yarn and got the following:

% block release
building
copying package.json file
copying package-lock.json file

❌ Error: package-lock.json does not exist!
Failed to build the block code!

This is using block v0.0.55.

Related, is the code for the CLI itself available on Github? It doesn't seem to be in this repo.

Typescript mismatch with `useLoadable`

In the default youtube example, useLoadable used as follows:

useLoadable(cursor, ['selectedRecordIds', 'selectedFieldIds']);

I'm getting a TS error:

The useLoadable source seems to show that the second param should indeed be an object, not a string[]:

export default function useLoadable(
models: ReadonlyArray<LoadableModel | null> | LoadableModel | null,
opts: UseLoadableOpts = {shouldSuspend: true},

localhost SSL expired

In case anyone has same issue (mac):

npm root -g
cd @airtable/blocks-cli/keys/
remove -rf server.*
openssl req -newkey rsa:2048 -x509 -nodes -keyout server.key -new -out server.crt -subj /CN=localhost -reqexts SAN -extensions SAN -config <(cat /System/Library/OpenSSL/openssl.cnf <(printf '[SAN]\nsubjectAltName=DNS:localhost')) -sha256 -days 3650

add SSL from your web browsers to key chain

Support node v16

airtable/blocks-cli only works with node v14, which is now in maintenance mode.

The current recommended version is v16:
https://nodejs.org/en/about/releases/

I'd like to build an app on the Airtable marketplace (to support ML inference), but cannot downgrade other packages that depend on node v16 to make this happen.

Would it be possible to work on node v16 support?

BTW here's the error message when installing it on node v16:

npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm ERR! Cannot read property 'split' of null

Maybe upgrading some of these packages would be enough to get v16 support.

Can't use typescript declare to re-type derived class members

Hey,

So when using typescript declare on a class member, I get the following unrelated flow error:

The 'declare' modifier is only allowed when the 'allowDeclareFields' option of @babel/plugin-transform-flow-strip-types or @babel/preset-flow is enabled.

Code to reproduce:

class Base {
  prop1: string | number = 0;
}

class Derived extends Base {
  declare prop1: string;
}

Bundle Error: ‘import’ and ‘export’ may appear only with ‘sourceType: module’

Hi, I’m using block sdk to build a custom app. But I meet an error after I install an modules @antv/x6 (repo)

Bundle Error: 'import' and 'export' may appear only with 'sourceType: module'

I have checked the antv/x6 module has a es5 version in the /lib directory. And I try to import this modules use code below

import { Graph } from '@antv/x6/lib';

But still show the bundle error

Enable WebAssembly

It'd be great if we could import WebAssembly files in Airtable Apps by default.

Currently, there's no way of overwriting the Webpack config that the block CLI uses, and WebAssembly imports need to be enabled by setting the asyncWebAssembly and syncWebAssembly experimental flags to true (see here https://webpack.js.org/configuration/experiments/). One could build a custom bundler, but that is currently a lot of work and mostly doesn't work.

The changes to do this are minimal, probably just need to add the lines

experiments: {
    asyncWebAssembly: true,
    syncWebAssembly: true,
  },
};

to the createWebpackCompilerConfig function in this file: https://github.com/Airtable/blocks/blob/master/packages/cli-next/src/bundler/webpack_config.ts. I can put up a pull request, but my guess is that this needs to be looked over carefully by and Airtable engineer anyway...

P.S.: The use case I have is running a high-speed cohort-matching algorithm for a large-scale cohort-based virtual program.

Adding react-native-web to blocks

Hello,

I'm looking into setting up airtable as a CMS for react native for my company. Looks like this would require modifying the blocks sdk to have an import for react-native-web, also possibly editing the babel config for blocks per the docs

I tried to do this in a fork to submit a PR but was unable to because of internal dependencies in a few places.

Is there any suggested approaches for enabling rn-web for blocks for the airtable sdk? Or is this something that you guys would be interested in providing support for out of the box? Looks like might only require a few lines of code on your side

Thanks!

Can't run Base.createTableAsync if one of the fields is a MULTIPLE_RECORD_LINKS field

@airtable/blocks version 1.5.1

Whenever I try to run Base.createTableAsync with a field config for a MULTIPLE_RECORD_LINKS field I run into the following error:

image

In the field options for the MULTIPLE_RECORD_LINKS field I've made sure that the linkedTableId refers to a table that exists.

I've created a repo that reproduces the issue.

Current workaround: Usingtable.createFieldAsync to create a MULTIPLE_RECORD_LINKS field works but nothing on the documentation suggests that I shouldn't also be able to do this via Base.createTableAsync

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.