Comments (7)
There's an ownKeys handler: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys
Might be able to find a solution to #14 that complements this one
from echo.
What if simply getting global.Echo
didn't trigger an autolog, but instead it waited until the first call/construct/get? Could just change the condition from maxTokensLength > 0
to 1
.
Only makes sense if we've already figured out how to disable autocomplete
Breaks most trivial usage of Echo, which could lead to confusion
from echo.
There's an ownKeys handler
DevTools doesn't use the ownKeys handler, it hooks into v8 to inspect the object directly :/
- at
runtimeAgent.invoke_getProperties
(as in, hook into v8 stuff) - at
RemoteObjectImpl#getOwnProperties()
- at
JavaScriptAutoComplete#completionsOnGlobal
- at
JavaScriptAutoComplete#_completionsForExpression
from echo.
Does Chrome even still eager-eval Echo?
It does not, and afaict adding side-effects to the internal Echo function causes no change in functionality
from echo.
Autocomplete seems to stop after a construct (potentially also a call) -- or does it? Maybe there's a way to take advantage of that?
It looks like autocomplete decides whether something has side effects based solely on the token types: https://github.com/ChromeDevTools/devtools-frontend/blob/e43879a5a25ec7bfaaedeb1e4d860181db696d09/front_end/formatter_worker/FormatterWorker.js#L463 Autocomplete is aborted if the expression contains anything that is not one of the "safe" types 'MemberExpression', 'Identifier', 'BinaryExpression', 'Literal', 'TemplateLiteral', 'TemplateElement', 'ObjectExpression', 'ArrayExpression', 'Property', 'ThisExpression'
from echo.
It looks like throwing an error could abort autocomplete -- is there a way to throw an error during the get handler without disrupting functionality?
from echo.
Oh god now new versions of Node (I'm playing with 14.15) do autocomplete too and it's so much worse in a CLI
from echo.
Related Issues (20)
- Handle newlines in strings
- Add public typings
- Figure out parentheses ambiguities and exactly what functionality is wanted
- Meditate on options.output='ToString'
- Detect if called as tagged template literal
- Better rendering of array passed as arg
- Avoid restating same style in browser and ansi modes
- Do not autoLog if manually rendered/then'd/etc? HOT 2
- come up with a better name fore renderTokens/handleArgs
- figure out how to improve Echo.then
- Add separate internal typing for EchoProxy
- Namespace typings
- Add more devtools' themes
- Allow custom theme support HOT 2
- Add min operationstack length to log, for demo purposes
- Make calledAsTemplateTag a custom type guard
- Add RunKit link to readme as alternative to installation
- Improve get access rendering HOT 2
- Ambiguous parens issue with construct+template tag
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from echo.