Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

benchpressjs

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

benchpressjs - npm Package Versions

1345

2.2.0

Diff

Changelog

Source

Version 2.2.0 (2020-11-15)

New: Compiler Rewrite

This release includes a rewrite of the compiler, using the parser combinator library nom.

This rewrite has drastically improved code quality and extensibility. As part of the rewrite, structures include information about source location, so warnings now display file (assuming file name was passed to precompile), line, and column.

Also a performance win: the new compiler is about 4.4 times as fast.

Deprecations

The following features are deprecated, to become errors in v3.0.0:

Keyword outside an interpolation token

You may see a warning like the following:

[benchpress] warning: keyword outside an interpolation token is deprecated
     --> tests/templates/source/loop-tokens-conditional.tpl:4:65
      |
    4 |     <!-- IF @value --> &rarr; <span class="label label-default">@value</span><!-- ENDIF @value -->
      |                                                                 ^^^^^^ help: wrap this in curly braces: `{@value}`
      | note: This will become an error in the v3.0.0

This is a legacy of backwards compatibility with templates.js, where this was supported for @key, @value, and @index.

Mixing token types

You may see a warning like the following:

[benchpress] warning: mixing token types is deprecated
     --> tests/templates/source/mixed-syntax.tpl:20:1
      |
   20 | {{{if rooms.length}}}
      | ^^^^^^^^^^^^^^^^^^^^^ `if` started with modern syntax
     ::: tests/templates/source/mixed-syntax.tpl:34:1
      |
   34 | <!-- ENDIF rooms.length -->
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ but legacy syntax used for `ENDIF`
      | note: Migrate all to modern syntax. This will become an error in v3.0.0

New Warnings

We added some new warnings to help you avoid common issues:

Output bloat due to ambiguous inner BEGIN
[benchpress] warning: output bloat due to ambiguous inner BEGIN
     --> tests/templates/source/nested-loop.tpl:1:37
      |
    1 | <!-- BEGIN animals -->{animals.name}<!-- BEGIN hobbies -->{animals.hobbies.name}<!-- END hobbies --><!-- END animals -->
      |                                     ^^^^^^^^^^^^^^^^^^^^^^ `hobbies` could refer to the top-level value `hobbies` or 
the `.hobbies` property of the current element, so compiler must emit code for both cases
      | note: Migrate to modern syntax to avoid the ambiguity. This will become an error in the future.

This exists to support backwards compatibility with templates.js, which supported this behavior. Switching to modern syntax will allow you to avoid this ambiguity, resulting in faster templates (and faster compiles).

Extra Tokens

This warning isn't actually new, just improved.

[benchpress] warning: found extra tokens
     --> tests/templates/source/extra-tokens.tpl:17:7 
      |
   17 | </div><!-- END container -->
      |       ^^^^^^^^^^^^^^^^^^^^^^ help: remove the token or make it an unambiguous comment
     --> tests/templates/source/extra-tokens.tpl:25:64 
      |
   25 |         <p class="list-group-item-text">{rooms.description}</p><!-- END description -->
      |                                                                ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove the token or make it an unambiguous comment
     --> tests/templates/source/extra-tokens.tpl:32:66 
      |
   32 |     <p class="list-group-item-text">Click here to create one!</p><!-- END -->
      |                                                                  ^^^^^^^^^^^^ help: remove the token or make it an unambiguous comment
      = note: These tokens will be passed through as text, but this will become an error in the future.

Another legacy of backwards compatibility with templates.js, which would ignore these cases due to how it worked.

pitaj
published 2.1.0 •

Changelog

Source

Version 2.1.0 (2020-11-08)

New

  • Switch to WebAssembly from a native module Provides much wider support across platforms and a single build for all versions of Node

Fixes

  • Test Node 15 (latest current) instead of Node 13
  • Add console warnings for deprecated functions .parse and .compileParse
  • Change docs to emphasize new syntax
pitaj
published 2.0.9 •

Changelog

Source

Version 2.0.9 (2020-11-07)

Fixes

  • Improve warning message when pre-build module fails to load
pitaj
published 2.0.8 •

Changelog

Source

Version 2.0.8 (2020-10-14)

Fixes

  • Fix issue where native module install failure would cause install to fail completely
pitaj
published 2.0.7 •

Changelog

Source

Version 2.0.7 (2020-10-10)

Fixes

  • Fix missing script in npm package
pitaj
published 2.0.6 •

Changelog

Source

Version 2.0.6 (2020-10-08)

New

  • Native module compiler will now provide context around extra token warnings

Fixes

  • Update dependencies
pitaj
published 2.0.4 •

Changelog

Source

Version 2.0.4 (2020-09-13)

Fixes

  • Remove old/unsupported native module binaries
  • Update dependencies
pitaj
published 2.0.3 •

Changelog

Source

Version 2.0.3 (2020-05-09)

New

  • Now pre-builds native module binaries for Node 14

Fixes

  • Native module should now build successfully on Mac OS (#86)
  • Update dependencies

Removals

  • Node 8 no longer supported by native rust compiler
pitaj
published 2.0.2 •

pitaj
published 2.0.1 •

Changelog

Source

Version 2.0.1 (2020-02-14)

New

  • Node 13 now supported by native rust compiler

Fixes

  • Update dependencies
  • Native rust compiler build script fixed to build in release mode with optimizations
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc