Giter Club home page Giter Club logo

echo's Introduction

About me

I'm a fun, energetic, resourceful programmer with a passion for JavaScript, and particularly metaprogramming and esoteric TypeScript. I've spent the last 5 years working with TypeScript/React and the MERN stack at Anark, though programming has been a passion of mine since childhood.

echo's People

Contributors

dependabot[bot] avatar mrjacobbloom avatar

Stargazers

 avatar  avatar

Watchers

 avatar

echo's Issues

Do not autoLog if manually rendered/then'd/etc?

Possible plan:

  • Have a (global?) flag about whether to autoLog
  • calls to render() unset flag
  • autoLog's call to render() passed a secret arg (oooo a super secret symbol perhaps?) that tells it not to unset the flag

Alternative is to switch a flag in every public method, and separate render() into public and private versions

Handle newlines in strings

/* > */ Echo('foo\nbar')
/* < */ Echo('foo
bar')

Potential routes:

  • Switch delimiter to `
  • Escape newlines to \n
  • NOT line continuations, they do the opposite of what you want

Add public typings

Does it do anything besides declare a global with some confusingly circular functionality? Might be nice to expose typings for options?

Can we auto-generate these? IDK if Typescript really understands what we're trying to do here

Allow custom theme support

Not sure what this would look like?

Echo.options.theme = {
  default: 'rgba(111, 222, 123, 1)',
  /* ... */
}

Allow extension of existing theme instead of defining every token color?
Automatically calculate nearest ANSI color code? Add support for 8-bit/24-bit color? https://github.com/substack/node-x256

Meditate on options.output='ToString'

Right now the stringifier functions all pass through to their defaults if options.output='ToString'. They should probably always be overridden, and options.output='ToString' just disables automatic logging

Disable log on autocomplete/eager-eval

Does Chrome even still eager-eval Echo? What about giving the original (internal) Echo function side effects? It should never be called. Would that prevent autocomplete as well?

Autocomplete seems to stop after a construct (potentially also a call) -- or does it? Maybe there's a way to take advantage of that?

Is it worth it to specialize for Chrome's devtools?

Publish to NPM?

Why not?

Prereqs

  • set minimum node version in package.json to 10.12 (see #1 and #3) npm docs
    • also make note in README about minimum Node version
  • Write Tests #2
  • Add instructions to README for how to --require

figure out how to improve Echo.then

Right now it uses the value of Echo.render at the time of the Echo.then GET, ideally it should be grabbed at the time of apply. Maybe it could look more like

Echo.then = (...args) => Promise.prototype.then.apply(Echo.render(), args);

Write tests

  • % escaped in console text, not in other output modes
  • ansi output ends with reset character
  • 'Echo.then' behaves like a normal echo prop unless output='promise'
  • Newlines in strings rendered as template strings
  • Template tag detection, raw strings preserve escape codes, template literal args rendered correctly, etc.

Improve get access rendering

BigInt renders as Number:
image

Booleans render as keywords??
image

Empty string renders as nothing:
image
(note that other values that stringify to empty string, like [], also render this way)

Object renders as stringified object:
image

Symbol (which may actually be detectable as distinct from string!!!!) doesn't even render the square brackets:
image

Getting Echo doesn't render anything at all:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.