Skip to content

Commit

Permalink
Fix serve and update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wilwade committed Feb 9, 2024
1 parent 284c909 commit bb8b928
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
35 changes: 18 additions & 17 deletions esbuild-serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
6 changes: 3 additions & 3 deletions examples/server/README.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 0 additions & 1 deletion lib/codec/plain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ function decodeValues_DOUBLE(cursor: Cursor, count: number) {
return values;
}

// Waylands reminder to check again
function encodeValues_BYTE_ARRAY(values: Array<Uint8Array>) {
let buf_len = 0;
const returnedValues: Array<Buffer> = [];
Expand Down

0 comments on commit bb8b928

Please sign in to comment.