-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Internalize @handlebars/parser #21069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
NullVoxPopuli
wants to merge
7
commits into
main
Choose a base branch
from
nvp/bringin-handlebars-parser
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5356c6e
Bring in @handlebars/parser
NullVoxPopuli 1de8a8e
Add to workspace
NullVoxPopuli 5539817
Add tests to ci-jobs'
NullVoxPopuli 3f948b5
Lockfile
NullVoxPopuli 343836d
fix: update hidden dependencies and add @handlebars/parser to package…
NullVoxPopuli 0286b5e
Simplify the handlebars/parser build and add it in to to the set of t…
NullVoxPopuli 4122009
lint:fix
NullVoxPopuli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Changelog | ||
|
|
||
| ## Release (2025-11-29) | ||
|
|
||
| * @handlebars/parser 2.2.2 (patch) | ||
|
|
||
| #### :bug: Bug Fix | ||
| * `@handlebars/parser` | ||
| * [#27](https://github.com/handlebars-lang/handlebars-parser/pull/27) Fix commonjs build ([@kaermorchen](https://github.com/kaermorchen)) | ||
|
|
||
| #### Committers: 1 | ||
| - Stanislav Romanov ([@kaermorchen](https://github.com/kaermorchen)) | ||
|
|
||
| ## Release (2025-08-01) | ||
|
|
||
| * @handlebars/parser 2.2.1 (patch) | ||
|
|
||
| #### :bug: Bug Fix | ||
| * `@handlebars/parser` | ||
| * [#24](https://github.com/handlebars-lang/handlebars-parser/pull/24) fix node engine and create a test matrix in CI ([@mansona](https://github.com/mansona)) | ||
|
|
||
| #### Committers: 1 | ||
| - Chris Manson ([@mansona](https://github.com/mansona)) | ||
|
|
||
| ## Release (2025-03-19) | ||
|
|
||
| * @handlebars/parser 2.2.0 (minor) | ||
|
|
||
| #### :rocket: Enhancement | ||
| * `@handlebars/parser` | ||
| * [#15](https://github.com/handlebars-lang/handlebars-parser/pull/15) Implement hash and array literal syntax ([@wycats](https://github.com/wycats)) | ||
| * [#14](https://github.com/handlebars-lang/handlebars-parser/pull/14) Add support for a `#` prefix in path segments ([@wycats](https://github.com/wycats)) | ||
|
|
||
| #### :bug: Bug Fix | ||
| * `@handlebars/parser` | ||
| * [#6](https://github.com/handlebars-lang/handlebars-parser/pull/6) [bugfix] Don't emit `parts: [undefined]` for `{{this}}` ([@dfreeman](https://github.com/dfreeman)) | ||
|
|
||
| #### :house: Internal | ||
| * `@handlebars/parser` | ||
| * [#17](https://github.com/handlebars-lang/handlebars-parser/pull/17) Add release plan, remove release-it ([@NullVoxPopuli](https://github.com/NullVoxPopuli)) | ||
|
|
||
| #### Committers: 3 | ||
| - Dan Freeman ([@dfreeman](https://github.com/dfreeman)) | ||
| - Yehuda Katz ([@wycats](https://github.com/wycats)) | ||
| - [@NullVoxPopuli](https://github.com/NullVoxPopuli) | ||
|
|
||
| ## v2.1.0 (2021-02-22) | ||
|
|
||
| #### :rocket: Enhancement | ||
| * [#4](https://github.com/handlebars-lang/handlebars-parser/pull/4) [FEATURE] Allows SubExpressions to be PathExpression roots ([@pzuraq](https://github.com/pzuraq)) | ||
|
|
||
| #### Committers: 1 | ||
| - Chris Garrett ([@pzuraq](https://github.com/pzuraq)) | ||
|
|
||
| ## v2.0.0 (2020-12-09) | ||
|
|
||
| #### :boom: Breaking Change | ||
| * [#3](https://github.com/handlebars-lang/handlebars-parser/pull/3) Make sub-expressions callable ([@pzuraq](https://github.com/pzuraq)) | ||
|
|
||
| #### Committers: 1 | ||
| - Chris Garrett ([@pzuraq](https://github.com/pzuraq)) | ||
|
|
||
| ## v1.1.0 (2020-09-18) | ||
|
|
||
| #### :rocket: Enhancement | ||
| * [#2](https://github.com/handlebars-lang/handlebars-parser/pull/2) [FEAT] Adds types ([@pzuraq](https://github.com/pzuraq)) | ||
|
|
||
| #### Committers: 1 | ||
| - Chris Garrett ([@pzuraq](https://github.com/pzuraq)) | ||
|
|
||
|
|
||
| ## v1.0.0 (2020-09-14) | ||
|
|
||
| #### :rocket: Enhancement | ||
| * [#1](https://github.com/handlebars-lang/handlebars-parser/pull/1) [FEAT] Adds initial setup, lint, ci ([@pzuraq](https://github.com/pzuraq)) | ||
|
|
||
| #### Committers: 1 | ||
| - Chris Garrett ([@pzuraq](https://github.com/pzuraq)) | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Handlebars Parser | ||
|
|
||
| The official Handlebars.js parser. This package contains the definition for | ||
| for the Handlebars language AST, and the parser for parsing into that AST. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| const errorProps = [ | ||
| 'description', | ||
| 'fileName', | ||
| 'lineNumber', | ||
| 'endLineNumber', | ||
| 'message', | ||
| 'name', | ||
| 'number', | ||
| 'stack', | ||
| ]; | ||
|
|
||
| function Exception(message, node) { | ||
| let loc = node && node.loc, | ||
| line, | ||
| endLineNumber, | ||
| column, | ||
| endColumn; | ||
|
|
||
| if (loc) { | ||
| line = loc.start.line; | ||
| endLineNumber = loc.end.line; | ||
| column = loc.start.column; | ||
| endColumn = loc.end.column; | ||
|
|
||
| message += ' - ' + line + ':' + column; | ||
| } | ||
|
|
||
| let tmp = Error.prototype.constructor.call(this, message); | ||
|
|
||
| // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. | ||
| for (let idx = 0; idx < errorProps.length; idx++) { | ||
| this[errorProps[idx]] = tmp[errorProps[idx]]; | ||
| } | ||
|
|
||
| /* istanbul ignore else */ | ||
| if (Error.captureStackTrace) { | ||
| Error.captureStackTrace(this, Exception); | ||
| } | ||
|
|
||
| try { | ||
| if (loc) { | ||
| this.lineNumber = line; | ||
| this.endLineNumber = endLineNumber; | ||
|
|
||
| // Work around issue under safari where we can't directly set the column value | ||
| /* istanbul ignore next */ | ||
| if (Object.defineProperty) { | ||
| Object.defineProperty(this, 'column', { | ||
| value: column, | ||
| enumerable: true, | ||
| }); | ||
| Object.defineProperty(this, 'endColumn', { | ||
| value: endColumn, | ||
| enumerable: true, | ||
| }); | ||
| } else { | ||
| this.column = column; | ||
| this.endColumn = endColumn; | ||
| } | ||
| } | ||
| } catch (nop) { | ||
| /* Ignore if the browser is very particular */ | ||
| } | ||
| } | ||
|
|
||
| Exception.prototype = new Error(); | ||
|
|
||
| export default Exception; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copied from the handlebars repo