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

Remove Node as dependency #431

Open
caherrerapa opened this issue Jul 5, 2023 · 4 comments
Open

Remove Node as dependency #431

caherrerapa opened this issue Jul 5, 2023 · 4 comments
Assignees

Comments

@caherrerapa
Copy link
Contributor

Why

The new rails way removes any dependency from NodeJS

Who Benefits?

Anyone using our template as we won't have to deal with the rabbit hole of dependencies and tools

@andyduong1920
Copy link
Member

andyduong1920 commented Jul 11, 2023

I have some concerns about the Node linter tools that we use in the development environment like

These tools help to keep the CSS and JS files consistent in code format and rule; without Node, we won't have that, so it's the trade-off here.

Another issue is, as we will rely on the CDN (Rails default uses https://jspm.org/) for the third-party package, for example, Bootstrap, it's rare, but the CDN could be down, and for that, our app won't work as expected. That is another trade-off as well.

➡️  This could be solved by downloading the ESM module and keeping it in our `public/` folder.

@malparty
Copy link
Member

While there are indeed some big concerns to tackle, it could be interesting to create an Engineering Showcase about it. This way we can better experiment with the ways to handle that.

Looking at the Signup page of hey.com (which applies the "No Build" approach), all the JS/CSS files are not built, yet loaded from the assets folder (no CDN).

As for code lint, 80% of the conventions can be applied with Prettier (even if this is NOT a linter!). It is a big topic, but worth exploring too 👍

I'll see this after noon if there are people interested in exploring this topic a bit more :)

@olivierobert
Copy link
Member

There are two topics:

  1. No build tool, such as WebPack or Esbuild. That removes the need to have Node.JS to deploy an application, i.e., Node.JS does not need to installed in Docker images or CD servers. With Rails 7 (namely with rails/importmap-rails), it is achievable. Likely, the Web is moving in that direction too, as a whole.
  2. Not having Node.JS for development: It would remove lots of tooling (including Prettier) that improves DX for Web development. That friction point is minimal at Nimble thanks to the laptop script standardizing the dev environment. It could be further improved by using containerized dev environments (https://containers.dev/).

I would split 1. and 2. as they have very different scope and goals.

@malparty malparty self-assigned this May 2, 2024
@malparty
Copy link
Member

malparty commented May 2, 2024

FYI I'm drafting an Engineering Initiative so we can work on each dependency with good follow up. This will be done on an internal project first (for fast feedback) and step by step be included in the Rails Template.

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

No branches or pull requests

4 participants