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

Define public API #473

Open
JuroOravec opened this issue May 2, 2024 · 1 comment
Open

Define public API #473

JuroOravec opened this issue May 2, 2024 · 1 comment
Milestone

Comments

@JuroOravec
Copy link
Collaborator

Currently it's not entirely clear what interfaces (files/variables) are part of public API. Before v1.0, it would be also good to clear this up, so we know which things we can change internally, and which need to be maintained.

This project also doesn't have very big surface area, so I think that for now it could be sufficient to expose the "public" parts via src/__init__.py, so it can be imported as

from django_components import bla_bla

The exception to the above are middleware and template tags, which can be used in Django settings and referenced via filepath (e.g. "django_components.templatetags.component_tags"

@JuroOravec JuroOravec added this to the Version 1.0 milestone May 2, 2024
@EmilStenstrom
Copy link
Owner

EmilStenstrom commented May 8, 2024

Before deciding on how to expose the public API, let's just start by listing out all the concepts that we expect people to understand to use components in their projects:

  • The component template tag, the slot and fill tags (with all their options and parameters, how they nest and how they interplay with extends, blocks, defaults, reusing content and so on)
  • Management commands to create and upgrade components
  • Installed app to make py files in staticfiles safe again
  • Middleware to make components load dynamically
  • Installed app to load the library
  • Directory structure you need for a component
  • Components registry, and the register function
  • Component class, its methods that you override, it's class variables that you config
  • The Media metaclass where you define your CSS
  • How template autodiscovery works or how you automatically load your components
  • component_dependencies, component_js_dependencies, component_css_dependencies
  • Single file components, and the custom types that we define
  • How to call a component as a view
  • Render_to_response helper method, with the escape_slots_content param
  • component_vars.is_filled and it's subkeys
  • The COMPONENTS setting dict and all it's keys

Anything else?

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

No branches or pull requests

2 participants