From bb8b9282616bd3d71d5619f5bdec7c2d0913b8e6 Mon Sep 17 00:00:00 2001 From: Wil Wade Date: Fri, 9 Feb 2024 11:18:02 -0500 Subject: [PATCH] Fix serve and update comments --- esbuild-serve.js | 35 ++++++++++++++++++----------------- examples/server/README.md | 6 +++--- lib/codec/plain.ts | 1 - 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/esbuild-serve.js b/esbuild-serve.js index 8955c4d9..f9dd3167 100644 --- a/esbuild-serve.js +++ b/esbuild-serve.js @@ -3,21 +3,22 @@ * It attaches the parquet.js exports to a "parquetjs" global variable. * See the example server for how to use it. */ -const {compressionBrowserPlugin, wasmPlugin} = require("./esbuild-plugins"); +const { compressionBrowserPlugin, wasmPlugin } = require("./esbuild-plugins"); // esbuild has TypeScript support by default. It will use .tsconfig -require('esbuild') - .serve({ - servedir: __dirname, - }, { - entryPoints: ['parquet.ts'], - outfile: 'main.js', - define: {"process.env.NODE_DEBUG": "false", "process.env.NODE_ENV": "\"production\"", global: "window" }, - platform: 'browser', - plugins: [compressionBrowserPlugin,wasmPlugin], - sourcemap: "external", - bundle: true, - globalName: 'parquetjs', - inject: ['./esbuild-shims.js'] - }).then(server => { - console.log("serving parquetjs", server) - }) +require('esbuild').context({ + entryPoints: ['parquet.ts'], + outfile: 'main.js', + define: { "process.env.NODE_DEBUG": "false", "process.env.NODE_ENV": "\"production\"", global: "window" }, + platform: 'browser', + plugins: [compressionBrowserPlugin, wasmPlugin], + sourcemap: "external", + bundle: true, + globalName: 'parquetjs', + inject: ['./esbuild-shims.js'] +}).then(context => { + context.serve({ + servedir: __dirname, + }).then(server => { + console.log("serving parquetjs", server) + }) +}) diff --git a/examples/server/README.md b/examples/server/README.md index 0ddee9c6..54cadde0 100644 --- a/examples/server/README.md +++ b/examples/server/README.md @@ -1,8 +1,8 @@ # Example Server This is a toy server that illustrates how to use the parquetjs library built with esbuild. -To run it: +To run it: 1. npm install -1. View and edit the files in `views` to taste +1. View and edit the files in `views` to taste 1. node app.js -1. Build and serve the parquetjs bundle in the main parquetjs directory: `npm run serve` +1. Build and serve the parquetjs bundle in the main parquetjs directory: `npm run serve` 1. visit `http://localhost:3000` and click buttons, do things in the console. diff --git a/lib/codec/plain.ts b/lib/codec/plain.ts index e323556b..a5fbb359 100644 --- a/lib/codec/plain.ts +++ b/lib/codec/plain.ts @@ -205,7 +205,6 @@ function decodeValues_DOUBLE(cursor: Cursor, count: number) { return values; } -// Waylands reminder to check again function encodeValues_BYTE_ARRAY(values: Array) { let buf_len = 0; const returnedValues: Array = [];