-
Notifications
You must be signed in to change notification settings - Fork 19
js-tokens: use preload source code #228
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for webkit-jetstream-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| jsTokensSourceCode = ""; | ||
|
|
||
| async init() { | ||
| this.jsTokensSourceCode = await JetStream.getString(JetStream.preload.SOURCE_CODE); |
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.
Can we eval or dynamically import this rather than have two copies of the source?
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.
rewrote it to reuse js-tokens.js as SOURCE_CODE (requires us to modify the EXPECTED_TOKEN_COUNT whenever we touch it, but thats probably ok)
|
Pending on #242 and additional refactorings to support loading a file and preload with the same URL (currently this is silently ignored) |
Function.toString is not necessarily returning the full function body per spec.
We can inject the sources with the preload mechanism which is well defined and more flexible.