Skip to content

Commit

Permalink
fix(parquet): More robust Buffer polyfill export (#3105)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen authored Sep 30, 2024
1 parent d52f0e4 commit 5f4973a
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 13 deletions.
3 changes: 1 addition & 2 deletions modules/compression/src/lib/compression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
// Copyright (c) vis.gl contributors

// Compression interface
import {concatenateArrayBuffersAsync} from '@loaders.gl/loader-utils';
import {registerJSModules} from '@loaders.gl/loader-utils';
import {concatenateArrayBuffersAsync, registerJSModules} from '@loaders.gl/loader-utils';

/** Compression options */
export type CompressionOptions = {
Expand Down
3 changes: 1 addition & 2 deletions modules/compression/src/lib/lz4-compression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
/* eslint-disable max-statements */

// LZ4
import {toArrayBuffer} from '@loaders.gl/loader-utils';
import {registerJSModules, getJSModule} from '@loaders.gl/loader-utils';
import {toArrayBuffer, registerJSModules, getJSModule} from '@loaders.gl/loader-utils';
import type {CompressionOptions} from './compression';
import {Compression} from './compression';

Expand Down
6 changes: 3 additions & 3 deletions modules/images/test/lib/category-api/parsed-image-api.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import test from 'tape-promise/tape';
import {load} from '@loaders.gl/core';
import {ImageLoader, ImageType} from '@loaders.gl/images';

// PARSED IMAGE API
import {
ImageLoader,
ImageType,
// PARSED IMAGE API
getDefaultImageType,
isImageTypeSupported,
isImage,
Expand Down
9 changes: 7 additions & 2 deletions modules/mvt/src/lib/vector-tile/vector-tile-feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
// Copyright vis.gl contributors

// This code is forked from https://github.com/mapbox/vector-tile-js under BSD 3-clause license.
import {Feature} from '@loaders.gl/schema';
import {FlatFeature, FlatIndexedGeometry, GeojsonGeometryInfo} from '@loaders.gl/schema';

import type {
Feature,
FlatFeature,
FlatIndexedGeometry,
GeojsonGeometryInfo
} from '@loaders.gl/schema';
import Protobuf from 'pbf';
import {
classifyRings,
Expand Down
6 changes: 5 additions & 1 deletion modules/parquet/src/parquet-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ import {
parseParquetFileInColumnarBatches
} from './lib/parsers/parse-parquet-to-columns';

export {Buffer} from './polyfills/buffer/install-buffer-polyfill';
// Note: The Buffer polyfill is quite fragile
// For some reason, just exporting directly fails with some bundlers
// export {Buffer} from './polyfills/buffer/install-buffer-polyfill';
import {Buffer} from './polyfills/buffer/install-buffer-polyfill';
export {Buffer};

// __VERSION__ is injected by babel-plugin-version-inline
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
/* eslint-disable camelcase */
import {GLTFAccessorPostprocessed, GLTFMeshPrimitivePostprocessed} from '@loaders.gl/gltf';
import type {NumericArray} from '@loaders.gl/loader-utils';
import type {
GLTFAccessorPostprocessed,
GLTFMeshPrimitivePostprocessed,
GLTF_EXT_feature_metadata_FeatureIdTexture,
GLTF_EXT_feature_metadata_GLTF,
GLTF_EXT_feature_metadata_Primitive,
GLTF_EXT_mesh_features
} from '@loaders.gl/gltf';
import {EXT_MESH_FEATURES, EXT_FEATURE_METADATA} from '@loaders.gl/gltf';
import {Tiles3DTileContent} from '@loaders.gl/3d-tiles';

import {TypedArray} from '@math.gl/core';
import {TextureImageProperties} from '../types';
import {emod} from '@loaders.gl/math';
import {EXT_MESH_FEATURES, EXT_FEATURE_METADATA} from '@loaders.gl/gltf';
import {Tiles3DTileContent} from '@loaders.gl/3d-tiles';

/**
* Get featureTexture by a metadata class.
Expand Down

0 comments on commit 5f4973a

Please sign in to comment.