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

[epic] Deferred normalization ASTs #43

Open
rbalicki2 opened this issue Apr 8, 2024 · 0 comments
Open

[epic] Deferred normalization ASTs #43

rbalicki2 opened this issue Apr 8, 2024 · 0 comments
Assignees

Comments

@rbalicki2
Copy link
Collaborator

Background: entrypoint artifacts and normalization ASTs

  • For each iso(`entrypoint Type.Field`) literal that the compiler encounters, it will generate a Type/Field/entrypoint.ts file.
  • This file currently (i.e. pre Split entrypoint.ts artifact into two artifacts: query text and normalization AST #33) contains a query text and a normalization AST.
  • The query text is used when making the query
  • The normalization AST is (currently) only used to write the network response into the key-value store and for garbage collection (which is also only done after the network response is received).
  • Because the normalization AST is only used after a network response is received, we can fetch the normalization AST later (e.g. when making the network request).

This epic

  • This epic is to load normalization ASTs when the network request is created, via https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import or something.
  • This should be controllable with a directive on the entrypoint
    • So, the iso literal parser should be modified to include support for parsing directives
  • Whether the normalization AST is hard-loaded should be reflected in the type of the entrypoint, since the entrypoint cannot be used with an if-necessary fetch policy if the normalization AST is not present.
    • One should be able to eventually call entrypoint.loadNormalizationAst().then(entrypointWithNormalizationAst => fetchIfNecessary(...)) or the like
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