spring-projects / spring-projects/spring-framework

Add API to customize features of Spring AOT

Open
#35,498 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: core theme: aot type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

Thus far, Spring AOT is this one thing that does refresh the context, invokes contributors and then dump the state of the BeanFactory in generated code. It also write additional files such as native metadata.

We want to provide more flexibility in what Spring AOT does.

This issue is about researching what this API could look like with the following customizations hookpoint:

  • Lock down the bean factory (current behavior)
  • Record classpath scanning outcome and make it available at runtime (*)
  • Create CGLIB proxies
  • Process Runtime Hints
  • Write Runtime Hints as GraalVM metadata (**)

(*) should not be done if the bean factory is locked down. Similarly, writing runtime hints can't be enabled if they aren't processed. This shows that there are features that can't be individual options and rather needs to be linked to something else.

Such feature is linked to additional processing that happens in ApplicationContextAotGenerator. It may be a new PostProcessor, but it could also be something that needs to be enabled as part of GenericApplication#refreshForAotProcessing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading ApplicationContextAotGenerator and GenericApplication#refreshForAotProcessing to understand the existing AOT processing flow. Map the proposed customization points and their dependencies, including the bean-factory lock and runtime-hints constraints. Done means documenting a viable API design and the required processing relationships.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.