Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs(custom-esbuild): align the HTML transformer signature#1705

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
arturovt wants to merge1 commit intomaster
base:master
Choose a base branch
Loading
fromdocs/update-esbuild

Conversation

@arturovt
Copy link
Collaborator

@arturovtarturovt commentedMar 4, 2024
edited
Loading

Closes#1690

@arturovtarturovt requested a review fromjust-jebMarch 4, 2024 21:51
@just-jeb
Copy link
Owner

Not sure if it actually closes#1690 - it does align the docs with actual implementation but from what I read there is a request for addingoptions (similarly tocustom-webpack builder).

@arturovt
Copy link
CollaboratorAuthor

We can align the docs for now and then I’ll think on implementing options as a feature.

@just-jeb
Copy link
Owner

Sure thing, just saying that aligning the docs won't close#1690 🙂

@arturovt
Copy link
CollaboratorAuthor

arturovt commentedMar 10, 2024
edited
Loading

However, how do we include target options as the first parameter when the HTML transformer is called by Angular with only the HTML content? We are not responsible for its invocation with only a single parameter.

// angular-clireturnindexHtmlTransformer&&content ?awaitindexHtmlTransformer(content) :content;

We can certainly make adjustments on our end, but I'm hesitant to modify the contract exposed by their API. If they didn't include target options for this builder, there might be a specific reason for it.

The target options only includetarget andconfiguration properties. Here,target can be eitherbuild orserver, whileconfiguration can bedevelopment,production, or any other value.

In this builder, the target is typically always set tobuild, as the application builder inherently possesses conjunctive functionality.

Which means the only property may be used is theconfiguration.

I can talk to one of the Angular CLI team members who worked on the application builder to understand the exact reasons for its removal. I'm not sure if they gonna decide to bring it back.

@shisukei
Copy link

@arturovt I'm not sure if this is ideal, but from what I've seen, at the post-bundle time, if there is an index transformation function specified, then this function is called with the index content as a parameter.

Considering that the context is available in buildCustomEsbuildApplication (or in executeCustomDevServerBuilder), wouldn't it be acceptable to wrap this in a custom function? For instance, if we take the current code of thisfile, we would replace line 30 with something like this:
return { codePlugins, indexHtmlTransformer: (indexHtml) => indexHtmlTransformer(context, indexHtml) } as ApplicationBuilderExtensions;

Not sure, but it seems to be a similar approach with custom-webpack (source code).

@just-jeb
Copy link
Owner

@arturovt Exactly what@shisukei said, we can create a wrapper function and use the target params from the closure, just like we do incustom-webpack.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@just-jebjust-jebAwaiting requested review from just-jeb

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

TargetOptions parameter is not there with custom-esbuild

4 participants

@arturovt@just-jeb@shisukei

[8]ページ先頭

©2009-2025 Movatter.jp