Coder Social home page Coder Social logo

Comments (6)

iuioiua avatar iuioiua commented on September 24, 2024

I'm for this. Having a plainer/simpler symbol that achieves the same functionality is a good idea.

from deno_std.

timreichen avatar timreichen commented on September 24, 2024

I just wonder how to introduce this without a breaking change. Should we just deprecate the class and introduce the interface after the class removal?

from deno_std.

iuioiua avatar iuioiua commented on September 24, 2024

I'm not sure there is a way to make a non-breaking change either. However, the change seems easy-to-make, from the user's perspective, and is a small dump in design simplicity. Any thoughts, @kt3k?

Before:

...
fileHandler.handle(
  new LogRecord({
    msg: "AAA",
    args: [],
    level: LogLevels.ERROR,
    loggerName: "default",
  }),
);
...

After:

...
fileHandler.handle({
  msg: "AAA",
  args: [],
  level: LogLevels.ERROR,
  loggerName: "default",
});

from deno_std.

iuioiua avatar iuioiua commented on September 24, 2024

@kt3k, would you be in favour of doing this in v1?

from deno_std.

kt3k avatar kt3k commented on September 24, 2024

I don't understand the motivation. It doesn't seem solving any problem.

the same can be achieved with plain js object

I think this assumption is not strictly correct. The getter-only fields are currently immutable, but if we change it to plain object, they become mutable (readonly works for TypeScript, but it doesn't work for JavaScript).

from deno_std.

timreichen avatar timreichen commented on September 24, 2024

I don't understand the motivation. It doesn't seem solving any problem.

the same can be achieved with plain js object

I think this assumption is not strictly correct. The getter-only fields are currently immutable, but if we change it to plain object, they become mutable (readonly works for TypeScript, but it doesn't work for JavaScript).

That is true, but these properties have getters because the values are objects. So in the spirit of that whole class with getters and readonly properties, the object could just as well be frozen.

from deno_std.

Related Issues (20)

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.