Skip to content
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

Article about the Engineering Process behind this project: Js Generator in a Nutshell #171

Open
FanJups opened this issue Oct 20, 2022 · 11 comments
Assignees
Labels

Comments

@FanJups
Copy link
Member

FanJups commented Oct 20, 2022

This article will be published when the whole project will be released. The first things we are doing here is to write down some ideas, difficulties.... that will be used to build the article later.

Js Generator in a Nutshell

#124

from a simple maven project to a multi module project

The goal was to have a with a simple maven project for the library then create other github repositories for the clients. We would end up a with a github repo and other repos for clients. It would be difficult to maintain, imagine that we change the version of the library then we would be forced to change manually on clients, difficult to maintain... Then Salathiel come and said let's use one repo for the whole project, use of a multi module maven project in order to manage easily to whole stuff, deploy easily, have a deployment pipeline for all, if there is a new release of the library it will be updated everywhere....

GraalVM

Salathiel came up with GraalVM for building native images for CLI tool then we also use GraalVM for the Desktop app.

From Java 11 to Java 17

We started with Java 11 but we migrate to 17 because of the desktop module. I suggested to the team to make that move because building a cross platform app with JavaFX will be easier with 17, good documentation, a book describing everything....

Text blocks...

https://twitter.com/xpvit/status/1600101000823676928?s=20&t=81AEFlX_VPEyENIi2BNjcQ

Self discipline

Working on Open Source project requires discipline, it's very important to know how to balance activities, stay focus until the end. Not easy to stay committed till the end. Well, we use to wake up at 5:00 AM on the weekend and code all day because from momday to friday we were really busy, what a commitment!

The Order of Instructions

When processing the DOM, the browser renders elements as often as the DOM changes. A performance optimization commonly used in front-end framework (React, Angular, Vue, etc)and libraries (jQuery) is to append children in the shadow DOM and only append root elements to the document once - this save the browser unnecessary round trips.

We take advantage of such technique in this project. As consequence, the order of the appendChild statements in generated code might not look as what one may have expected intuitively.

@FanJups
Copy link
Member Author

FanJups commented Nov 9, 2022

Maven could not resolve jsgenrator-core dependency

Failed to execute goal on project jsgenerator-desktop: Could not resolve dependencies for project com.osscameroon:jsgenerator-desktop:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at com.osscameroon:jsgenerator-core:jar:0.0.1-SNAPSHOT: Failed to read artifact descriptor for com.osscameroon:jsgenerator-core:jar:0.0.1-SNAPSHOT: com.osscameroon:jsgenerator:pom:${revision} was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]

https://www.google.com/search?q=maven+cannot+resolve+dependency+from+local+repository&rlz=1C1UEAD_enFR1017__1017&oq=maven+can+not+resolve+dependnecy+from+&aqs=chrome.1.69i57j0i13i19i512j0i19i22i30.27449j1j7&sourceid=chrome&ie=UTF-8

https://stackoverflow.com/questions/16866978/maven-cant-find-my-local-artifacts/16870552#16870552

https://stackoverflow.com/questions/12517129/maven-fails-to-find-local-artifact

I was using maven 3.8.6 then @SalathielGenese suggested maven 4, finally it works. We choose the module to run with this new feature from maven 4 --projects https://maven.apache.org/guides/mini/guide-multiple-modules-4.html

https://maarten.mulders.it/2020/11/whats-new-in-maven-4/

To download https://downloads.apache.org/maven/maven-4/

@FanJups FanJups pinned this issue Nov 9, 2022
@FanJups FanJups changed the title Article about the Engineering Process of Js Generator Article about the Engineering Process behind this project: Js Generator in a Nutshell Nov 24, 2022
@FanJups
Copy link
Member Author

FanJups commented Nov 26, 2022

Text Blocks

We deal with a lot of text, we have to take care about identation, formatting, concatenations....

Using Text Blocks helps to manage strings in top-notch way

https://www.baeldung.com/java-text-blocks

https://www.wearedevelopers.com/magazine/modern-java-text-blocks

@FanJups
Copy link
Member Author

FanJups commented Nov 26, 2022

We should also do some demo videos

@FanJups
Copy link
Member Author

FanJups commented Nov 26, 2022

(Social Media Post (linkedin (personal post, osscameroon post, linkedin article), dzone, medium, twitter, osscameroon blog Article )

Web app: jsgenerator.com jsgeneratorfromhtml.com jsfromhtml.com

(Should we have a twitter @ jsfromhtml ? )

Why Js Generator is so special ?

Obviously, we are not inventing something new. After searching, you will get so many sites for that purpose.

So, the question is what's the added value ?

First, We are not only building a web app but a family of Apps / APIs: Maven & Gradle Library, REST APIs, Web & Desktop Apps and Command Line Interface.

Secondly, you have the option to choose variable declaration you want, whether is LET, CONST or VAR.

Thirdly, in order to verify that the output matches your input, we add query selector by default (but you can choose to add it or not, it's up to you). Then you copy and paste on JsFiddle, CodePen or Console Browser.

It looks really simple, isn't it ? Yeah, but trust me, we face so many challenges ( Cross Platfform deployment, Strings Management, Mutlti module project.... ) that are explained in this article : Js Generator in a Nutshell

See Also:

@FanJups FanJups added the todo Ticket that has to be done label Apr 22, 2023
@FanJups
Copy link
Member Author

FanJups commented Apr 22, 2023

@FanJups
Copy link
Member Author

FanJups commented Apr 23, 2023

Why slim modules ?

@FanJups
Copy link
Member Author

FanJups commented May 7, 2023

My introduction in Maintainers community https://github.com/community/maintainers/discussions/3#discussioncomment-5809500

Hello World 😊, I am Fanon Jupkwo, Java Software Engineer living in Fundao, Portugal. It's a pleasure to be amongst such great maintainers to learn and share my experiences. In 2019, I started contributing to Open Source. My first motivation was getting more experience, showing my skills to get a job. Then I started loving and having fun while contributing again and again. Another motivation driving me to continue to contribute is that it runs the software industry and it's a way to give back to the community. Finally, I decided to focus on the growth of Open Source Society Cameroon.

Today, I'm maintaining Open Source Society Cameroon's jsgenerator. I join this maintainers group in order to stay up to date with tools that will improve the project workflow. The goal of this project is converting HTML to JS. There are already some tools for the same purpose but they lack precision and options, we are deeply converting HTML into JS code by creating each element and appending each child to its parent. By default, copying and pasting the JS output on websites like JSFiddle and CodePen will show nothing, this is why we add an optional selector in order that the end user can verify if the output matches input. We also provide other options that's make it unique.

We want to help newbies in programming and provide a feature to experienced devs to use whenever they need to reuse an HTML structure but in Js context. In order to achieve that goal, first we are buiding a Java library used by clients such as Rest APIs, Web, CLI and Desktop apps. Each client is a project's module, sub project with its own pipeline, releases & tags process. I am trying to figure out how to make it. Currently, we are focused on building the library first.

Follow me on LinkedIn & Twitter

@FanJups
Copy link
Member Author

FanJups commented Jul 12, 2023

Trying to solve bug requiring more time than expected

Thinking about starting to work at 6pm and telling me that I will not sleep if it doesn't work in order to motivate me. hhahahaaha do you know what happens ? 😂. I finally slept at 5am without solving the encoding bug #238 but I stay positive that I will solve it hahahahaa 🤣. I did my best but nothing.

@FanJups FanJups self-assigned this Dec 26, 2023
@FanJups
Copy link
Member Author

FanJups commented Mar 8, 2024

pull_request_target VS pull_request

Spent a hard time on March 5th 2024 because I noticed that the workflow never used the PR code on the feature branch , instead it was using main. We did not notice before because we always run our tests locally and push if everything is ok. I got an unexpected idea to push a feature without tests. I was supposed to see tests failures but instead all tests were succesful then I knew something is not working the right way.

#266

@FanJups
Copy link
Member Author

FanJups commented Jul 6, 2024

Migrate fron Spring Boot 2.7.3 to 3.3.1 and from Java 17 to 21 #250

Update Pipeline from 17 to 21 #269

Migrating to 21 forced us to not use Lombok anymore

See https://github.com/osscameroon/js-generator/actions/runs/9818758901/job/27111623226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant