Repository code style #1612

Closed
opened 2025-08-09 17:20:54 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @laskoviymishka on 5/20/2016

Hi i'm trying to implement couple enhancement into this repository but faced with couple code style problems.
It reaaaaly hard to jump into code when it bad formated. Right now there is total mess in couple areas:

  1. Where to place {. Some code written in java style, some code in c#. Sometime both this aproach live in really same file.
  2. Single file agreement. It really not really usefull when you have more than one class in single file.

Also there is couple light problems with library design:

  1. To much static stuff, which could be easily replaced by DI. It not hard to fix actually.
  2. Total count of unit tests - 0. At this point nothing to say, but threre is already issue for these (#9).

In a fact there is a reference to aspnet contributing guide which is not followed.
I understand that this repository is mostly playground for experiments, but such problems make it really hard to perform any reasonable contribution in it for anyone except author.

I'm not blaming anyone for this. I just try to help made this tools production ready (I have big plan for this technology).

So i propose to perform some refactor for this code.

  1. Reformat all code according to common aspnet standarts (4 space, private field with _, c# style of { bla-bla).
  2. Extract all classes and interfaces into separate files
  3. Remove dependency Prerenderer static class inside of tag helper to some IPrerenderer interface, which be injected via standart DI process (and could be mocked for testing purpose). And remove all possible static accessors and classes for better testability and extensibility.
  4. Add unit tests for all this stuff (well this issue already exist).

Any thoughts on this @SteveSandersonMS ?

*Originally created by @laskoviymishka on 5/20/2016* Hi i'm trying to implement couple enhancement into this repository but faced with couple code style problems. It reaaaaly hard to jump into code when it bad formated. Right now there is total mess in couple areas: 1. Where to place `{`. Some code written in java style, some code in c#. Sometime both this aproach live in really same file. 2. Single file agreement. It really not really usefull when you have more than one class in single file. Also there is couple light problems with library design: 1. To much static stuff, which could be easily replaced by DI. It not hard to fix actually. 2. Total count of unit tests - 0. At this point nothing to say, but threre is already issue for these (#9). In a fact there is a reference to aspnet contributing guide which is not followed. I understand that this repository is mostly playground for experiments, but such problems make it really hard to perform any reasonable contribution in it for anyone except author. I'm not blaming anyone for this. I just try to help made this tools production ready (I have big plan for this technology). So i propose to perform some refactor for this code. 1. Reformat all code according to common aspnet standarts (4 space, private field with _, c# style of `{` bla-bla). 2. Extract all classes and interfaces into separate files 3. Remove dependency `Prerenderer` static class inside of tag helper to some `IPrerenderer` interface, which be injected via standart DI process (and could be mocked for testing purpose). And remove all possible static accessors and classes for better testability and extensibility. 4. Add unit tests for all this stuff (well this issue already exist). Any thoughts on this @SteveSandersonMS ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1612
No description provided.