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

Fix #1119 csr remove unecessary code #1170

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

JonasCir
Copy link

@JonasCir JonasCir commented Jan 10, 2025

Fixes #1119

Hi,
this PR removes unnecessary elements from the generated project in case the user selects client-side rendering.

This PR:

  • renames assets to rendering method. In my opinion this is more readable and cleaner. The user's choice of the rendering method (i.e., client-side vs. server-side) ultimately decides how assets are served.
  • fixes all the mentioned items from Selecting Saas App with client side rendering creates unecessary code #1119, namely:
    • ViewEngine initializer not necessary in src/app.rs for CSR
    • src/initializers/view_engine.rs is not needed for CSR, the file and corresponding mod declarations and imports can be removed
    • asset folder can be removed for CSR
    • fluent-templates and unic-langid can be removed from Cargo.toml when using CSR

Please note that this changes the CLI output of the tool to use the term "rendering method" instead of "assets" when creating a new project.

I hand tested all the variants by running loco new and then inspecting the files in question.

Please let me know if there is anything unclear or if there are any open questions.

All the best,
Jonas


EDIT: I just noticed that I also need to adjust docs, READMEs, and the website. Will do this after a first review pass that signs of on the CLI changes.

Copy link
Contributor

@kaplanelad kaplanelad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please revert the renaming of rendering_method? This field name is used in multiple places beyond the Loco CLI, and it would be better for us to maintain consistency across all references.

Another point, can you test the setup.rhai script??

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

Successfully merging this pull request may close these issues.

Selecting Saas App with client side rendering creates unecessary code
2 participants