profile
viewpoint
Linus Unnebäck LinusU @locoapp @ctrl-alt-deseat London, UK http://linus.unnebäck.se/

Automattic/node-canvas 7405

Node canvas is a Cairo backed Canvas implementation for NodeJS.

dylang/npm-check 5688

Check for outdated, incorrect, and unused dependencies.

evanw/node-source-map-support 1744

Adds source map support to node.js (for stack traces)

badunk/multer-s3 454

multer storage engine for amazon s3

feross/clipboard-copy 430

Lightweight copy to clipboard for the web

diamondio/better-queue 309

Better Queue for NodeJS

commitizen/conventional-commit-types 258

List of conventional commit types.

kodie/md5-file 171

return an md5sum of a given file

gorillamania/package.json-validator 96

A tool/library for validating npm/node package.json files

devongovett/atom-jade 51

Jade TextMate bundle converted for Atom

issue commentAutomattic/node-canvas

Support for alpine-node?

This is my Dockerfile, which seems to work (including fixed fonts):

FROM node:alpine

RUN mkdir -p /usr/src/bot
WORKDIR /usr/src/bot

COPY package.json /usr/src/bot

RUN apk add --no-cache \
  build-base \
  g++ \
  cairo-dev \
  jpeg-dev \
  pango-dev \
  giflib-dev

RUN apk add --update  --repository http://dl-3.alpinelinux.org/alpine/edge/testing libmount ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family fontconfig

RUN npm install

COPY . /usr/src/bot

EXPOSE 3000

CMD ["node", "index.js"]
mario-mui

comment created time in a few seconds

issue commentAutomattic/node-canvas

Support for alpine-node?

My fonts appear as [], anyone manage to fix this yet?

mario-mui

comment created time in 4 minutes

pull request commenttc39/proposal-temporal

Clarify which time zones must be supported in a non-402 implementation

@cjtenny since Intl is not required, nothing in intl supports the use cases I’m asking about, which is 262 absent 402 (I’m not talking about exposing the lists to users, I’m talking about making the 262 spec text more coherent).

You’re right that my previous concern (that it would be bad if hosts changed what’s supported mid-flight) directly conflicts with @ptomato’s stated goal of allowing exactly that, but to me that seems only the difference between whether the host hook is called once, or every time (assuming a host hook is the best way to improve the spec text here).

ptomato

comment created time in 5 minutes

PR opened expressjs/multer

Handle gzip encoding
+7 -1

0 comment

1 changed file

pr created time in 7 minutes

pull request commenttc39/proposal-temporal

Specify era/eraYear.

Given there’s still a number of open review comments, I’m not sure why merging prior to addressing them is stabilizing.

Ms2ger

comment created time in 9 minutes

Pull request review commentstandard/eslint-config-standard-with-typescript

chore(deps): update to eslint-config-standard ^16.0.0

 test('export', (t): void => {           '@typescript-eslint/no-throw-literal': 'error',           '@typescript-eslint/no-unnecessary-type-assertion': 'error',           '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',-          '@typescript-eslint/no-unused-vars': ['error', { vars: 'all', args: 'none', ignoreRestSiblings: true }],+          '@typescript-eslint/no-unused-vars': ['error', { args: 'none', caughtErrors: 'none', ignoreRestSiblings: true, vars: 'all' }],

Same here; assume this is just a note; looks aligned:

// eslint-config-standard
"no-unused-vars": ["error", { "args": "none", "caughtErrors": "none", "ignoreRestSiblings": true, "vars": "all" }],

// eslint-config-standard-with-typescript (test)
'@typescript-eslint/no-unused-vars': ['error', { args: 'none', caughtErrors: 'none', ignoreRestSiblings: true, vars: 'all' }],
charles-allen

comment created time in an hour

Pull request review commentstandard/eslint-config-standard-with-typescript

chore(deps): update to eslint-config-standard ^16.0.0

 test('export', (t): void => {             ImportDeclaration: 1,             flatTernaryExpressions: false,             ignoreComments: false,-            ignoredNodes: ['TemplateLiteral *']+            ignoredNodes: ['TemplateLiteral *', 'JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXFragment', 'JSXOpeningFragment', 'JSXClosingFragment', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],+            offsetTernaryExpressions: true

Not sure what this comment wants. I assumed it was just to log where the updated values came from. Looks aligned to me:

// eslint-config-standard
"ignoredNodes": ["TemplateLiteral *", "JSXElement", "JSXElement > *", "JSXAttribute", "JSXIdentifier", "JSXNamespacedName", "JSXMemberExpression", "JSXSpreadAttribute", "JSXExpressionContainer", "JSXOpeningElement", "JSXClosingElement", "JSXFragment", "JSXOpeningFragment", "JSXClosingFragment", "JSXText", "JSXEmptyExpression", "JSXSpreadChild"],

// eslint-config-standard-with-typescript (test)
ignoredNodes: ['TemplateLiteral *', 'JSXElement', 'JSXElement > *', 'JSXAttribute', 'JSXIdentifier', 'JSXNamespacedName', 'JSXMemberExpression', 'JSXSpreadAttribute', 'JSXExpressionContainer', 'JSXOpeningElement', 'JSXClosingElement', 'JSXFragment', 'JSXOpeningFragment', 'JSXClosingFragment', 'JSXText', 'JSXEmptyExpression', 'JSXSpreadChild'],
charles-allen

comment created time in an hour

pull request commentstandard/eslint-config-standard-with-typescript

chore(deps): update to eslint-config-standard ^16.0.0

Resolve conflicts, please.

This branch has no conflicts with the base branch

Errr... what conflicts?!

charles-allen

comment created time in an hour

startednpmhub/npmhub

started time in an hour

pull request commentstandard/eslint-config-standard-with-typescript

chore(deps): update to eslint-config-standard ^16.0.0

Resolve conflicts, please.

charles-allen

comment created time in 2 hours

startedakavel/up

started time in 3 hours

pull request commenttc39/proposal-temporal

WIP: Update validation, coercion for all built-in fields.

Codecov Report

Merging #1319 (5d137a1) into main (1b86208) will decrease coverage by 4.39%. The diff coverage is 71.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1319      +/-   ##
==========================================
- Coverage   95.61%   91.21%   -4.40%     
==========================================
  Files          19       17       -2     
  Lines        9359     9487     +128     
  Branches     1435     1366      -69     
==========================================
- Hits         8949     8654     -295     
- Misses        404      819     +415     
- Partials        6       14       +8     
Flag Coverage Δ
test262 ?
tests 91.21% <71.17%> (-0.54%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
polyfill/lib/duration.mjs 93.47% <ø> (-4.41%) :arrow_down:
polyfill/lib/plaindatetime.mjs 89.98% <25.00%> (-5.49%) :arrow_down:
polyfill/lib/plainyearmonth.mjs 88.64% <40.00%> (-6.13%) :arrow_down:
polyfill/lib/calendar.mjs 80.32% <67.44%> (-10.91%) :arrow_down:
polyfill/lib/plaindate.mjs 87.80% <75.00%> (-6.83%) :arrow_down:
polyfill/lib/zoneddatetime.mjs 91.12% <75.00%> (-6.79%) :arrow_down:
polyfill/lib/ecmascript.mjs 93.67% <80.48%> (-2.19%) :arrow_down:
polyfill/lib/plainmonthday.mjs 81.97% <100.00%> (-8.73%) :arrow_down:
polyfill/lib/instant.mjs 86.19% <0.00%> (-8.90%) :arrow_down:
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1b86208...6406cc1. Read the comment docs.

cjtenny

comment created time in 3 hours

PR opened tc39/proposal-temporal

Reviewers
WIP: Update validation, coercion for all built-in fields.

Do not merge; RFC only in this state

This change does a few other things as well:

  • Implement era, eraYear for all remaining objects.
  • Implement eraYear/year split behavior for 'gregory' and 'japanese' calendars (NB: choice of anchor/default era in 'japanese' should be revisited with more cultural context).

I only included the specification for the new PrepareTemporalFields abstract operation; I'm still refactoring the spec text into all the other ToTemporal*Fields, ToRelativeTemporalObject, etc abstract operations and that's messy / incomplete at the moment. However, PrepareTemporalFields closely matches how ES.ToRecord was used throughout the polyfill already, so this brings the specification and polyfill much closer together.

There are a number of questions and FIXME comments; I'm also uncertain if the language I used around abstract operation references in a table is valid specification. Bear with me :) Will finish this up over the next day and change.

+426 -352

0 comment

18 changed files

pr created time in 3 hours

create barnchtc39/proposal-temporal

branch : calendar-1229-pt2

created branch time in 3 hours

issue openedAutomattic/node-canvas

Custom font doesnt work when building from source

When installing a prebuilt binary, custom fonts load without an issue, however when building from source, custom fonts show up as squares instead. below are my testing results and build logs. Is there an issue with my dependencies or build environment?

Code

const Canvas = require("canvas");
Canvas.registerFont(`${process.cwd()}/astro.woff`, { family: "astro" });

const canvas = Canvas.createCanvas(200, 200);
const ctx = canvas.getContext("2d");
ctx.font = "100px astro";
ctx.fillText("\uE8A8", 100, 100);
const out = canvas.createPNGStream();
// send stream to output

Tests

apt install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

nvm use v12.16.1

npm install canvas
(prebuilt downloaded, fonts work)

npm rebuild canvas --build-from-source
(builds from source, fonts dont work)

nvm use v14.15.4

npm rebuild canvas --update-binary
(prebuilt failed, builds from source, fonts dont work)

npm uninstall canvas --save
npm install automattic/node-canvas
(no prebuilt, builds from source, fonts dont work)

Your Environment

ubuntu 20.04.1 node-canvas 2.6.1 node-canvas 2.7.0 master node 12.16.1 node 14.15.4

full rebuild logs for node 14.15.4 and canvas 2.6.1

root@GalaxyGate:~/astrobot# npm rebuild canvas --update-binary

> canvas@2.6.1 install /root/astrobot/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Pre-built binaries not installable for canvas@2.6.1 and node@14.15.4 (node-v83 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error Remote end closed socket abruptly. 
make: Entering directory '/root/astrobot/node_modules/canvas/build'
  SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
  COPY Release/canvas-postbuild.node
  CXX(target) Release/obj.target/canvas/src/backend/Backend.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/backend/Backend.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/canvas/src/backend/ImageBackend.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/backend/ImageBackend.h:3,
                 from ../src/backend/ImageBackend.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/canvas/src/backend/PdfBackend.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/backend/PdfBackend.h:3,
                 from ../src/backend/PdfBackend.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/canvas/src/backend/SvgBackend.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/backend/SvgBackend.h:3,
                 from ../src/backend/SvgBackend.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/canvas/src/bmp/BMPParser.o
  CXX(target) Release/obj.target/canvas/src/Backends.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/Backends.h:3,
                 from ../src/Backends.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/canvas/src/Canvas.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/Canvas.cc:3:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../src/Canvas.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE Canvas::ToBuffer(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/Canvas.cc:415:26: warning: comparison of integer expressions of different signedness: ‘int’ and ‘const size_t’ {aka ‘const long unsigned int’} [-Wsign-compare]
  415 |     if (canvas->nBytes() > node::Buffer::kMaxLength) {
      |         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
../src/Canvas.cc:479:79: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
  479 |     uv_queue_work(uv_default_loop(), req, ToPngBufferAsync, (uv_after_work_cb)ToBufferAsyncAfter);
      |                                                                               ^~~~~~~~~~~~~~~~~~
../src/Canvas.cc:520:80: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
  520 |     uv_queue_work(uv_default_loop(), req, ToJpegBufferAsync, (uv_after_work_cb)ToBufferAsyncAfter);
      |                                                                                ^~~~~~~~~~~~~~~~~~
In file included from ../../nan/nan.h:2884,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/Canvas.cc:3:
../../nan/nan_typedarray_contents.h: In instantiation of ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>) [with T = unsigned char]’:
../src/Canvas.cc:274:65:   required from here
../../nan/nan_typedarray_contents.h:34:54: warning: ‘v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents()’ is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                   ~~~~~~~~~~~~~~~~~~~^~
In file included from /root/.cache/node-gyp/14.15.4/include/node/node.h:67,
                 from ../../nan/nan.h:54,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/Canvas.cc:3:
/root/.cache/node-gyp/14.15.4/include/node/v8.h:5273:12: note: declared here
 5273 |   Contents GetContents();
      |            ^~~~~~~~~~~
  CXX(target) Release/obj.target/canvas/src/CanvasGradient.o
In file included from ../src/CanvasGradient.h:5,
                 from ../src/CanvasGradient.cc:3:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/canvas/src/CanvasPattern.o
In file included from ../src/CanvasPattern.h:6,
                 from ../src/CanvasPattern.cc:3:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/canvas/src/CanvasRenderingContext2d.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/CanvasRenderingContext2d.h:6,
                 from ../src/CanvasRenderingContext2d.cc:3:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
In file included from ../../nan/nan.h:2884,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/CanvasRenderingContext2d.h:6,
                 from ../src/CanvasRenderingContext2d.cc:3:
../../nan/nan_typedarray_contents.h: In instantiation of ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>) [with T = unsigned char]’:
../src/CanvasRenderingContext2d.cc:1027:64:   required from here
../../nan/nan_typedarray_contents.h:34:54: warning: ‘v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents()’ is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                   ~~~~~~~~~~~~~~~~~~~^~
In file included from /root/.cache/node-gyp/14.15.4/include/node/node.h:67,
                 from ../../nan/nan.h:54,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/CanvasRenderingContext2d.h:6,
                 from ../src/CanvasRenderingContext2d.cc:3:
/root/.cache/node-gyp/14.15.4/include/node/v8.h:5273:12: note: declared here
 5273 |   Contents GetContents();
      |            ^~~~~~~~~~~
In file included from ../../nan/nan.h:2884,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/CanvasRenderingContext2d.h:6,
                 from ../src/CanvasRenderingContext2d.cc:3:
../../nan/nan_typedarray_contents.h: In instantiation of ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>) [with T = double]’:
../src/CanvasRenderingContext2d.cc:1752:43:   required from here
../../nan/nan_typedarray_contents.h:34:54: warning: ‘v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents()’ is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                   ~~~~~~~~~~~~~~~~~~~^~
In file included from /root/.cache/node-gyp/14.15.4/include/node/node.h:67,
                 from ../../nan/nan.h:54,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/CanvasRenderingContext2d.h:6,
                 from ../src/CanvasRenderingContext2d.cc:3:
/root/.cache/node-gyp/14.15.4/include/node/v8.h:5273:12: note: declared here
 5273 |   Contents GetContents();
      |            ^~~~~~~~~~~
  CXX(target) Release/obj.target/canvas/src/closure.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/closure.h:5,
                 from ../src/closure.cc:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/canvas/src/color.o
  CXX(target) Release/obj.target/canvas/src/Image.o
In file included from ../src/Image.h:8,
                 from ../src/Image.cc:3:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/canvas/src/ImageData.o
In file included from ../src/ImageData.h:5,
                 from ../src/ImageData.cc:3:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
In file included from ../../nan/nan.h:2884,
                 from ../src/ImageData.h:5,
                 from ../src/ImageData.cc:3:
../../nan/nan_typedarray_contents.h: In instantiation of ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>) [with T = unsigned char]’:
../src/ImageData.cc:116:53:   required from here
../../nan/nan_typedarray_contents.h:34:54: warning: ‘v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents()’ is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                   ~~~~~~~~~~~~~~~~~~~^~
In file included from /root/.cache/node-gyp/14.15.4/include/node/node.h:67,
                 from ../../nan/nan.h:54,
                 from ../src/ImageData.h:5,
                 from ../src/ImageData.cc:3:
/root/.cache/node-gyp/14.15.4/include/node/v8.h:5273:12: note: declared here
 5273 |   Contents GetContents();
      |            ^~~~~~~~~~~
  CXX(target) Release/obj.target/canvas/src/init.o
In file included from ../src/backend/Backend.h:6,
                 from ../src/Backends.h:3,
                 from ../src/init.cc:17:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2298 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
In file included from ../../nan/nan.h:54,
                 from ../src/backend/Backend.h:6,
                 from ../src/Backends.h:3,
                 from ../src/init.cc:17:
../src/init.cc: At global scope:
/root/.cache/node-gyp/14.15.4/include/node/node.h:758:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  758 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/root/.cache/node-gyp/14.15.4/include/node/node.h:792:3: note: in expansion of macro ‘NODE_MODULE_X’
  792 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/init.cc:88:1: note: in expansion of macro ‘NODE_MODULE’
   88 | NODE_MODULE(canvas, init);
      | ^~~~~~~~~~~
  CXX(target) Release/obj.target/canvas/src/register_font.o
  SOLINK_MODULE(target) Release/obj.target/canvas.node
  COPY Release/canvas.node
make: Leaving directory '/root/astrobot/node_modules/canvas/build'
canvas@2.6.1 /root/astrobot/node_modules/canvas

clean install logs for canvas 2.7.0 on node 14.15.4

root@GalaxyGate:~/astrobot# npm install automattic/node-canvas

> canvas@2.7.0 install /root/astrobot/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v83-linux-glibc-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for canvas@2.7.0 and node@14.15.4 (node-v83 ABI, glibc) (falling back to source compile with node-gyp) 
make: Entering directory '/root/astrobot/node_modules/canvas/build'
  SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
  COPY Release/canvas-postbuild.node
  CXX(target) Release/obj.target/canvas/src/backend/Backend.o
  CXX(target) Release/obj.target/canvas/src/backend/ImageBackend.o
  CXX(target) Release/obj.target/canvas/src/backend/PdfBackend.o
  CXX(target) Release/obj.target/canvas/src/backend/SvgBackend.o
  CXX(target) Release/obj.target/canvas/src/bmp/BMPParser.o
  CXX(target) Release/obj.target/canvas/src/Backends.o
  CXX(target) Release/obj.target/canvas/src/Canvas.o
In file included from ../../nan/nan.h:2884,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/Canvas.cc:3:
../../nan/nan_typedarray_contents.h: In instantiation of ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>) [with T = unsigned char]’:
../src/Canvas.cc:274:65:   required from here
../../nan/nan_typedarray_contents.h:34:54: warning: ‘v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents()’ is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                   ~~~~~~~~~~~~~~~~~~~^~
In file included from /root/.cache/node-gyp/14.15.4/include/node/node.h:67,
                 from ../../nan/nan.h:54,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/Canvas.cc:3:
/root/.cache/node-gyp/14.15.4/include/node/v8.h:5273:12: note: declared here
 5273 |   Contents GetContents();
      |            ^~~~~~~~~~~
  CXX(target) Release/obj.target/canvas/src/CanvasGradient.o
  CXX(target) Release/obj.target/canvas/src/CanvasPattern.o
  CXX(target) Release/obj.target/canvas/src/CanvasRenderingContext2d.o
In file included from ../../nan/nan.h:2884,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/CanvasRenderingContext2d.h:6,
                 from ../src/CanvasRenderingContext2d.cc:3:
../../nan/nan_typedarray_contents.h: In instantiation of ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>) [with T = unsigned char]’:
../src/CanvasRenderingContext2d.cc:1037:64:   required from here
../../nan/nan_typedarray_contents.h:34:54: warning: ‘v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents()’ is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                   ~~~~~~~~~~~~~~~~~~~^~
In file included from /root/.cache/node-gyp/14.15.4/include/node/node.h:67,
                 from ../../nan/nan.h:54,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/CanvasRenderingContext2d.h:6,
                 from ../src/CanvasRenderingContext2d.cc:3:
/root/.cache/node-gyp/14.15.4/include/node/v8.h:5273:12: note: declared here
 5273 |   Contents GetContents();
      |            ^~~~~~~~~~~
In file included from ../../nan/nan.h:2884,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/CanvasRenderingContext2d.h:6,
                 from ../src/CanvasRenderingContext2d.cc:3:
../../nan/nan_typedarray_contents.h: In instantiation of ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>) [with T = double]’:
../src/CanvasRenderingContext2d.cc:1762:43:   required from here
../../nan/nan_typedarray_contents.h:34:54: warning: ‘v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents()’ is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                   ~~~~~~~~~~~~~~~~~~~^~
In file included from /root/.cache/node-gyp/14.15.4/include/node/node.h:67,
                 from ../../nan/nan.h:54,
                 from ../src/backend/Backend.h:6,
                 from ../src/Canvas.h:5,
                 from ../src/CanvasRenderingContext2d.h:6,
                 from ../src/CanvasRenderingContext2d.cc:3:
/root/.cache/node-gyp/14.15.4/include/node/v8.h:5273:12: note: declared here
 5273 |   Contents GetContents();
      |            ^~~~~~~~~~~
  CXX(target) Release/obj.target/canvas/src/closure.o
  CXX(target) Release/obj.target/canvas/src/color.o
  CXX(target) Release/obj.target/canvas/src/Image.o
  CXX(target) Release/obj.target/canvas/src/ImageData.o
In file included from ../../nan/nan.h:2884,
                 from ../src/ImageData.h:5,
                 from ../src/ImageData.cc:3:
../../nan/nan_typedarray_contents.h: In instantiation of ‘Nan::TypedArrayContents<T>::TypedArrayContents(v8::Local<v8::Value>) [with T = unsigned char]’:
../src/ImageData.cc:116:53:   required from here
../../nan/nan_typedarray_contents.h:34:54: warning: ‘v8::ArrayBuffer::Contents v8::ArrayBuffer::GetContents()’ is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
   34 |       data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
      |                                   ~~~~~~~~~~~~~~~~~~~^~
In file included from /root/.cache/node-gyp/14.15.4/include/node/node.h:67,
                 from ../../nan/nan.h:54,
                 from ../src/ImageData.h:5,
                 from ../src/ImageData.cc:3:
/root/.cache/node-gyp/14.15.4/include/node/v8.h:5273:12: note: declared here
 5273 |   Contents GetContents();
      |            ^~~~~~~~~~~
  CXX(target) Release/obj.target/canvas/src/init.o
  CXX(target) Release/obj.target/canvas/src/register_font.o
  SOLINK_MODULE(target) Release/obj.target/canvas.node
  COPY Release/canvas.node
make: Leaving directory '/root/astrobot/node_modules/canvas/build'
npm WARN astrobot@2.0.0 No repository field.

+ canvas@2.7.0
added 32 packages from 16 contributors and audited 126 packages in 43.546s

5 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

created time in 3 hours

pull request commentnode-fetch/node-fetch

Removing confusingly named 'json' variable in examples

have never thought about it like you do. in a sens the variable json could also mean that the "okey this variable is part of a json response from a REST api i got earlier" data could mean mostly anything. but you are right about that it isn't "json" anymore... it's a javascript literals.

one annoying thing i find in certain api is that there response looks something like { errors: null, data: ... } then you will have data.data after calling var data = await res.json()

maybe a better more generic name would be something like dataFromJson but that is to long something better maybe would be by calling it by what the response really is. var user = await res.json() but then you need to know what you expect from it

bartdorsey

comment created time in 3 hours

pull request commenttc39/proposal-temporal

Remove getFields methods from Duration object.

Codecov Report

Merging #1318 (e68fd60) into main (1b86208) will decrease coverage by 4.01%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1318      +/-   ##
==========================================
- Coverage   95.61%   91.60%   -4.02%     
==========================================
  Files          19       17       -2     
  Lines        9359     9350       -9     
  Branches     1435     1338      -97     
==========================================
- Hits         8949     8565     -384     
- Misses        404      775     +371     
- Partials        6       10       +4     
Flag Coverage Δ
test262 ?
tests 91.60% <ø> (-0.15%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
polyfill/lib/instant.mjs 86.19% <0.00%> (-8.90%) :arrow_down:
polyfill/lib/plainmonthday.mjs 81.97% <0.00%> (-8.73%) :arrow_down:
polyfill/lib/plaindate.mjs 87.91% <0.00%> (-6.72%) :arrow_down:
polyfill/lib/zoneddatetime.mjs 91.19% <0.00%> (-6.72%) :arrow_down:
polyfill/lib/calendar.mjs 84.71% <0.00%> (-6.52%) :arrow_down:
polyfill/lib/duration.mjs 91.36% <0.00%> (-6.52%) :arrow_down:
polyfill/lib/timezone.mjs 88.47% <0.00%> (-5.77%) :arrow_down:
polyfill/lib/plainyearmonth.mjs 89.27% <0.00%> (-5.49%) :arrow_down:
polyfill/lib/plaindatetime.mjs 90.56% <0.00%> (-4.91%) :arrow_down:
polyfill/lib/plaintime.mjs 91.74% <0.00%> (-4.88%) :arrow_down:
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1b86208...90e54c1. Read the comment docs.

cjtenny

comment created time in 3 hours

pull request commenttc39/proposal-temporal

Remove getFields methods from Duration object.

I'm not sure if we also intended to remove these as well, but if so, here's a change doing so. My validation WIP broke the test262 Duration.getFields tests and I realized it might be a holdout.

cjtenny

comment created time in 3 hours

PR opened tc39/proposal-temporal

Reviewers
Remove getFields methods from Duration object.

Ref: #1306, #1312

+0 -254

0 comment

7 changed files

pr created time in 3 hours

create barnchtc39/proposal-temporal

branch : remove-duration-getfields

created branch time in 3 hours

issue commenttc39/proposal-temporal

Version of tzdata

Other languages/libraries allow showing the version of the tzdata

Hey @thojanssens do you have some examples where this is being exposed and used? What frameworks, languages etc

thojanssens

comment created time in 4 hours

issue openedcommitizen/cz-cli

when i choose type, print log repeatedly

image

node 14.15.4 npm 6.14.10

What's the problem ?

created time in 4 hours

issue openedexpressjs/session

Page session

I want to track page sessions. That means a unique session which is created for one user landing on one single endpoint, so revisiting the same endpoint in a window of time always happens in the same session.

I can establish the ordinary session (that lives as long as one user is surfing under the top-domain) and couple it with endpoints then server cache the couple (session_id, endpoint). It is not hard to achieve but I don't want to reinvent the wheel here if expressjs/session already supports this somehow.

ps: I am trying to achieve this to be able to log unique users landing on any page of my website to keep track of this.

created time in 5 hours

issue commenttc39/proposal-temporal

Version of tzdata

Other languages/libraries allow showing the version of the tzdata. Also, it is important to know for advanced users/cases.

As an example, for some reason I need to store the utc datetime of a datetime with time zone, but I store the tzdata version as well. Whenever the tzdata version changes, I recompute that stored utc datetime.

Other things in mind, my server language uses its own library with a specific tzdata version, and JS Temporal has its own tzdata version; it might be useful to check if both versions are the same, and if not emit a warning log.

More generally, if you store a datetime and a time zone, you still don't have a unique datetime; you need to add the tzdata version.

thojanssens

comment created time in 5 hours

issue commenttc39/proposal-temporal

Version of tzdata

No, and I'm not sure if that would make the implementation more vulnerable...

thojanssens

comment created time in 6 hours

issue openedtc39/proposal-temporal

Version of tzdata

Is there a function returning the version of the time zone database?

E.g. tzdata2020f

created time in 6 hours

issue commenttc39/proposal-temporal

Brevity of API

@stiff thanks for the suggestion, there have been discussions regarding built-in modules at https://github.com/tc39/proposal-built-in-modules. That said, I feel that built-in modules won't be adopted for quite some time and it's unfair to delay Temporal on it.

That said, note that something like const { now, PlainDate, ZonedDateTime } = Temporal should work just as well as the example you suggested.

RobiFerentz

comment created time in 6 hours

issue commenttc39/proposal-temporal

Brevity of API

Maybe it's worth considering this API as a part of standard library rather than default part of language?

Like in c++, there is no problem to #include <vector> , same could be here import now from 'Temporal'.

Personally I very much doubt it would be a pleasant experience to type dozens characters for basic operations. Not only in IDE, but also in REPLs and so.

RobiFerentz

comment created time in 6 hours

pull request commenttc39/proposal-temporal

Clarify which time zones must be supported in a non-402 implementation

Overall the approach LGTM, but it seems like it might be missing some kind of glue to tie everything together - perhaps a host hook that returns the available list of time zone names, which is stored on the realm and does not change throughout the realm's lifetime, and then these operations can consult that list?

@ljharb : It seems https://tc39.es/proposal-intl-enumeration/#sec-intl.supportedvaluesof covers the use cases already. From trying to understand what a host hook is (sorry, a bit new to this still), it sounds like implementing that as a host hook is appropriate because it is not technically implementation defined. Are there other benefits to using a host hook, or additional costs to the external calls?

@ptomato true - it'd be compatible as long as the host hook was repeatedly called, and not called once and cached.

Does a host hook imply or provide the consistency in the 'note 2' link @ptomato shared above [1]? From my quite limited understanding it seems repeatedly calling the host hook would create exactly the problem described, wherein changed tzdata could appear through the API in the same object lifecycle.

I would propose implementing proposal-intl-enumeration's supportedValuesOf as a host hook, and only noting consistency recommendations in Temporal. I propose that implementations only be required to support UTC.

[1] Quoting the content of the note, since the fragment doesn't take you quite to the right point:

Time zone information is subject to change, and host environments may update their time zone information at any time. At a minimum, implementations must ensure that the time zone information for each particular value of timeZone individually remains constant starting from the time it is first accessed, for the lifetime of the surrounding agent. Furthermore, it is recommended that the time zone information for all values of timeZone as a whole remains the same for the lifetime of the surrounding agent.

ptomato

comment created time in 7 hours

issue commentuuidjs/uuid

Add export const uuid = v4

@gizm0bill From the warning it looks like you use some very old version without es modules support.

syabro

comment created time in 7 hours

more