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

Document API methods (Closes #45) #57

Merged
merged 1 commit into from
Dec 19, 2023
Merged

Conversation

gitKrystan
Copy link
Contributor

No description provided.

@gitKrystan gitKrystan force-pushed the api-docs branch 2 times, most recently from 1659b17 to dc380f3 Compare December 19, 2023 17:24
let output = p.process('<template>Hi</template>');
```

### `Preprocessor.parse(src: string, filename?: string): Parsed[];`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't document what adding the filename does bc I don't know the answer to that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It makes the error messages nicer if you get a parse error.

Copy link

Choose a reason for hiding this comment

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

Any reason not to pass this as an option to the generated template() so it ends up in the metadata of the ultimately compiled template?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to do some design here. The old concept of template module names doesn't really map to template tag.

Templates and files are no longer one to one. It would be easy to produce a very confusing component tree in the inspector for example where multiple layers of components all have "the same name" because they're defined in the same file.

Classically the module names were ember's weird module namespace. Not real file names. If we use real file names they get unwieldy quickly and leak system information. Inventing a mapping requires design.

I really think we need to address glimmer stack debugging in a holistic way. We need to map to your actual template, not just the file the template is in.

@ef4 ef4 merged commit 384c86b into embroider-build:main Dec 19, 2023
1 check passed
@NullVoxPopuli NullVoxPopuli added the documentation Improvements or additions to documentation label Dec 19, 2023
@github-actions github-actions bot mentioned this pull request Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants