Skip to content
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

Refactor: Lexer Variables #5

Merged
merged 11 commits into from
Dec 19, 2023
Merged

Refactor: Lexer Variables #5

merged 11 commits into from
Dec 19, 2023

Conversation

jorenrui
Copy link
Contributor

@jorenrui jorenrui commented Dec 17, 2023

Description

Changes the lexer to use acorn and codegen in updating the identifiers

📦 Published PR as canary version: 1.0.1-canary.5.ab7dcf5.0

✨ Test out this PR locally via:

npm install tonic-minijs@1.0.1-canary.5.ab7dcf5.0
# or 
yarn add tonic-minijs@1.0.1-canary.5.ab7dcf5.0

- refactor!: change lexer to use acorn and codegen instead of js-tokens.
Realized that creating our own AST reader is a huge task, make take
a lot of time and prone for errors if we want to be spec compliant.
With this, I decided to use acorn and codegen instead in terms of
identifying variables.
- fix: non-MiniJS variables are being read by Mini.js.
I made so that we are not automatically reading user
defined global variables. We now only fetch variables from
attributes and events. Currently, we can't fetch from
the scripts since we are not sure whether that script is
defined by a user or a library.
- fix: not being able to declare variables due to being read
as a proxy variable.
@jorenrui jorenrui self-assigned this Dec 17, 2023
@jorenrui jorenrui merged commit ab7dcf5 into main Dec 19, 2023
1 check passed
@jorenrui jorenrui deleted the jr.refactor!-lexer-variables branch December 19, 2023 11:43
Copy link

🚀 PR was released in v1.0.1 🚀

@github-actions github-actions bot added the released This has been released in npm label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This has been released in npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant