Skip to content

Commit

Permalink
feat: remove deprecated functionality
Browse files Browse the repository at this point in the history
BREAKING CHANGE: removed deprecared `forceDockerBundling` and `localBundling`
  • Loading branch information
mrgrain committed May 13, 2021
1 parent 7059f78 commit cc40b90
Show file tree
Hide file tree
Showing 5 changed files with 886 additions and 808 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ Underlying classes the power the other features. You normally won't have to use
**⚠️ Experimental** - _Likely to change once esbuild supports this natively_ \
Relative path to a directory copied to the output before the build is run (i.e esbuild will overwrite existing files).
- **⚠️ Deprecated in favour of `props.bundlerPriority`** `props.forceDockerBundling: boolean (false)` \
Force use of Docker bundling and skip local bundling. This can be useful in CI environments. The `absWorkingDir` path (or current working directory) will be mounted into the container as context. By default bundling with a locally installed binary is preferred and Docker will only be used if the local bundling fails.
- `props.bundlerPriority?: BundlerPriority (BundlerPriority.AttemptLocal)` \
Set the priority order of available bundlers. It can be useful to limit use to one of the bundlers. For Docker, the `absWorkingDir` path (or current working directory) will be mounted into the container as context. By default bundling with a locally installed binary is attempted first and Docker will only be used if the local bundling fails.
Expand Down Expand Up @@ -222,9 +219,6 @@ Bundles the entry points and creates a CDK asset which is uploaded to the bootst
**⚠️ Experimental** - _Likely to change once esbuild supports this natively_ \
Relative path to a directory copied to the output before the build is run (i.e esbuild will overwrite existing files).
- **⚠️ Deprecated in favour of `props.bundlerPriority`** `props.forceDockerBundling: boolean (false)` \
Force use of Docker bundling and skip local bundling. This can be useful in CI environments. The `absWorkingDir` path (or current working directory) will be mounted into the container as context. By default bundling with a locally installed binary is preferred and Docker will only be used if the local bundling fails.
- `props.bundlerPriority?: BundlerPriority (BundlerPriority.AttemptLocal)` \
Set the priority order of available bundlers. It can be useful to limit use to one of the bundlers. For Docker, the `absWorkingDir` path (or current working directory) will be mounted into the container as context. By default bundling with a locally installed binary is attempted first and Docker will only be used if the local bundling fails.
Expand Down
12 changes: 1 addition & 11 deletions lib/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ export interface EsbuildAssetProps extends Partial<IAsset> {
*/
copyDir?: string;

/**
* Force the asset to use Docker bundling (and skip local bundling).
*
* @deprecated please use `bundlerPriority`
*/
forceDockerBundling?: boolean;

/**
* Priority order of available bundlers. Defaults to attempt local first, then docker.
*
Expand All @@ -44,10 +37,7 @@ abstract class Asset<Props extends EsbuildAssetProps> extends S3Asset {
{
entryPoints: propEntryPoints,
assetHash,
forceDockerBundling = false,
bundlerPriority = forceDockerBundling === true
? BundlerPriority.DockerOnly
: BundlerPriority.AttemptLocal,
bundlerPriority = BundlerPriority.AttemptLocal,
copyDir,
buildOptions: options = {},
}: Props
Expand Down
16 changes: 2 additions & 14 deletions lib/bundling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ import {

export { BundlerPriority } from "./bundlers";

interface BundlingProps extends BundlerProps {
/**
* Use local bundling over Docker bundling.
* Deprecated. If providerPriority is set, will be ignored.
*
* @default true
* @deprecated use `BundlingProps.providerPriority` instead
*/
localBundling?: boolean;
}
interface BundlingProps extends BundlerProps {}

const getEsbuildVersion = (workingDir: string): string => {
function esbuildVersion<T>(
Expand Down Expand Up @@ -60,10 +51,7 @@ export class EsbuildBundling extends DockerBundler implements BundlingOptions {
public constructor(
buildOptions: BuildOptions,
{
localBundling,
priority = localBundling === false
? BundlerPriority.DockerOnly
: BundlerPriority.AttemptLocal,
priority = BundlerPriority.AttemptLocal,
copyDir,
esbuildVersion,
}: BundlingProps = {}
Expand Down
Loading

0 comments on commit cc40b90

Please sign in to comment.