Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(types): Remove remaining references to /typed entrypoints #8481

Merged
merged 3 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ dist/
dist-es6/
test/
website/build/
modules/*/typed
node_modules/
workers/
dist.js
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
build/
dist/
modules/*/typed
**/*.min.js
node_modules/
coverage/
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
website/build
**/dist*/**/*
dist.js
modules/*/typed
*.min.js
**/mapbox-gl-dev.js
**/mapbox-gl.js
Expand Down
4 changes: 2 additions & 2 deletions docs/api-reference/mapbox/mapbox-overlay.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ map.addControl(overlay);
The following code demonstrates how to create a React component from `MapboxOverlay` with `react-map-gl@7.x` and Typescript:

```tsx
import {ScatterplotLayer} from '@deck.gl/layers/typed';
import {MapboxOverlay, MapboxOverlayProps} from '@deck.gl/mapbox/typed';
import {ScatterplotLayer} from '@deck.gl/layers';
import {MapboxOverlay, MapboxOverlayProps} from '@deck.gl/mapbox';
import {useControl} from 'react-map-gl';

import Map, {NavigationControl} from 'react-map-gl';
Expand Down
20 changes: 19 additions & 1 deletion docs/get-started/using-with-typescript.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Using deck.gl with TypeScript

## deck.gl v9+

Starting from v9.0, deck.gl publishes official TypeScript types for all modules. If TypeScript is enabled in your project, imports from deck.gl packages will include types. Examples:
donmccurdy marked this conversation as resolved.
Show resolved Hide resolved

```js
// Values and types.
import DeckGL from '@deck.gl/react';
import {GeoJsonLayer} from '@deck.gl/layers';

// Types only.
import type {DeckGLRef} from '@deck.gl/react';
import type {GeoJsonLayerProps} from '@deck.gl/layers';
```

Help us improve the types by reporting issues or sending suggestions on GitHub!

## deck.gl v8

Starting from v8.8, deck.gl publishes "public preview" TypeScript types via an opt-in only entry point. To use the official types in your application, find the following statements:

```js
Expand All @@ -26,7 +44,7 @@ Note that the typed exports are a work in progress. They are not exposed by defa
The typed exports will remain at the `typed` entry points throughout the rest of the 8.x releases. They will be exposed directly at the package roots starting in v9.0.


## Alternative Solution for Legacy Versions
## Legacy Versions

If you are using a version before v8.8, a third-party typings library is available.

Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/tfjs/src/demo-histogram.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Deck, OrthographicView} from '@deck.gl/core/typed';
import {Deck, OrthographicView} from '@deck.gl/core';
import {HistogramLayer} from './layers/histogram-layer';

const slider = document.createElement('input');
Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/tfjs/src/demo-spectrogram.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Deck, OrthographicView} from '@deck.gl/core/typed';
import {Deck, OrthographicView} from '@deck.gl/core';
import {SpectrogramLayer, SpectrogramSettings} from './layers/spectrogram-layer';

const SETTINGS: SpectrogramSettings = {
Expand Down
4 changes: 2 additions & 2 deletions examples/experimental/tfjs/src/layers/histogram-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
UpdateParameters,
AttributeManager,
_deepEqual
} from '@deck.gl/core/typed';
import {GridCellLayer} from '@deck.gl/layers/typed';
} from '@deck.gl/core';
import {GridCellLayer} from '@deck.gl/layers';
import {Buffer} from '@luma.gl/core';
import {Matrix4} from '@math.gl/core';

Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/tfjs/src/layers/spectrogram-layer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as tf from '@tensorflow/tfjs';

import {UpdateParameters, Layer, CompositeLayer, LayersList} from '@deck.gl/core/typed';
import {UpdateParameters, Layer, CompositeLayer, LayersList} from '@deck.gl/core';
import GL from '@luma.gl/constants';

import {Tensor2DLayer} from './tensor-2d-layer';
Expand Down
4 changes: 2 additions & 2 deletions examples/experimental/tfjs/src/layers/tensor-2d-layer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {BitmapLayer} from '@deck.gl/layers/typed';
import type {GetPickingInfoParams, Texture} from '@deck.gl/core/typed';
import {BitmapLayer} from '@deck.gl/layers';
import type {GetPickingInfoParams, Texture} from '@deck.gl/core';
import type {Texture2D} from '@luma.gl/webgl';

export class Tensor2DLayer extends BitmapLayer<{
Expand Down
6 changes: 3 additions & 3 deletions examples/website/carto-sql/app.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, {useMemo, useState, useCallback} from 'react';
import React, {useState, useCallback} from 'react';
import {createRoot} from 'react-dom/client';
import {Map, ViewState} from 'react-map-gl';
import {Map} from 'react-map-gl';
import maplibregl from 'maplibre-gl';
import DeckGL from '@deck.gl/react';
import {LinearInterpolator, PickingInfo} from '@deck.gl/core';
import {colorBins, H3TileLayer, h3QuerySource} from '@deck.gl/carto';
import {TooltipContent} from '@deck.gl/core/typed/lib/tooltip';
import { TooltipContent } from '@deck.gl/core/dist/lib/tooltip';

const INITIAL_VIEW_STATE = {
latitude: 35.7368521,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"scripts": {
"bootstrap": "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true yarn && ocular-bootstrap",
"postinstall": "./scripts/postinstall.sh",
"clean": "ocular-clean && rm -rf modules/*/typed",
"clean": "ocular-clean",
"build": "npm run clean && ocular-build && lerna run build",
"version": "ocular-build core,carto",
"lint": "ocular-lint",
Expand Down
Loading