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

[FEATURE] bigger program structure best practice #392

Closed
2 tasks done
HaveF opened this issue Sep 3, 2024 · 1 comment
Closed
2 tasks done

[FEATURE] bigger program structure best practice #392

HaveF opened this issue Sep 3, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@HaveF
Copy link

HaveF commented Sep 3, 2024

Is your feature request related to a problem? Please describe.
I love working with fasthtml, and I'm grateful to Jeremy and his team for their efforts.

Although I haven't delved deeply into fasthtml yet, I have a general understanding of its capabilities. If I've misunderstood any aspect, please feel free to correct me.

For small-scale applications, fasthtml is excellent. It significantly reduces development friction, which I really appreciate, and I'm eager to explore it further. However, for larger projects, fasthtml might lack some structural constraints that could be beneficial when planned in advance. For instance:

  • Next.js uses file-based routing, which clearly defines the routing structure through its folder setup.
  • In React, there’s usually a dedicated components folder that organizes custom or project-specific components.
  • nbdev uses an nbs folder, where we can simply mark cells with #|export, letting it handle the complex parts of building. We can also write tests like test_eq directly within the notebook, which I find incredibly efficient.

Among the fasthtml examples I’ve seen, the most complex structure is the code editor example. While impressive, it still seems insufficient for managing larger-scale projects.

For more complex applications, could fasthtml benefit from a more standardized structure? Imagine if we could organize all project-related content—components, routes, styles, and tests—within an nbs folder, then have nbdev compile these into structured Python files and folders (like routes and components). We could reference these in main.py, making the development and publishing of fasthtml components as seamless as publishing pip packages with nbdev. That sounds like an exciting direction. Of course, everyone can customize the project structure using nbdev and then use the final result in main.py, but I think it would be more beneficial if this thing was bound up in advance, in all projects about fasthtml.

If someone doesn't like nbdev (it must be because he hasn't experienced nbdev in depth), then he can also use the relatively fixed constraints we may have, put py files into corresponding folders, and also reference them in main.py.

Actually, #345 is a sub-question of this problem.

Confirmation
Please confirm the following:

  • I have checked the existing issues and pull requests to ensure this feature hasn't been requested before.
  • I have read the project's documentation to ensure this feature doesn't already exist.
@HaveF HaveF added the enhancement New feature or request label Sep 3, 2024
@jph00
Copy link
Contributor

jph00 commented Sep 5, 2024

Closing as a dupe of #345.

@jph00 jph00 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants