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

feat: add support for link preload/prefetch#1043

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

Merged
alexander-akait merged 9 commits intowebpack-contrib:masterfromFogelAI:master
Apr 16, 2024

Conversation

FogelAI
Copy link
Contributor

This PR contains a:

  • bugfix
  • newfeature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

This pull request addswebpackPrefetch and webpackPreload magic comments support of webpack at import() for css files, per this issue:#142.

It is also an alternative realization of#344 and#488 pull requests, which are not merged and are not active.

See alsowebpack/webpack#7056 pull request of webpack repository.

Breaking Changes

No breaking changes.

Additional Info

@linux-foundation-easycla
Copy link

linux-foundation-easyclabot commentedJul 14, 2023
edited
Loading

CLA Not Signed

@grybykm
Copy link

@alexander-akait is it ok to merge this one?

@alexander-akait
Copy link
Member

@grybykm@FogelAI Sorry for delay, yes, code is fine, but we need tests for it

@FogelAI
Copy link
ContributorAuthor

Hi@alexander-akait
I have added the tests.
Please note that the commitb785fd8 is the CSS version ofwebpack/webpack@f5dab1b.

@alexander-akait
Copy link
Member

@FogelAI Can you accept CLA?

]),
"}",
])};`
: "// no preloaded",

Choose a reason for hiding this comment

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

Did you copy this code from webpack?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Yes, with adjustments to CSS.
Except for thegetLinkElements function that I added (b785fd8).

Choose a reason for hiding this comment

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

I want to finish -webpack/webpack#18190, i.e. for built-in CSS support, then I will check code here, regaridng -getLinkElements, it is an intresting question, because I think browsers make different things -webpack/webpack#17497, we need to report about to chrome bug tracker, if it is a bug, they need to fix it, if not - I will improve our code late

src/index.js Outdated
`}`,
`return loadedLinks;`,
]),
`};`,

Choose a reason for hiding this comment

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

Let's removegetLinkElements from here too

Choose a reason for hiding this comment

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

It will be another investigation

src/index.js Outdated
} = /** @type {Compilation} */ (this.compilation);
const chunkMap = getCssChunkObject(
/** @type {Chunk} */ (chunk),
/** @type {Compilation} */ (this.compilation)
);
const { globalObject } = runtimeTemplate;
const { linkPreload, linkPrefetch } =
JsonpChunkLoadingRuntimeModule.getCompilationHooks(compilation);

Choose a reason for hiding this comment

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

Please put these hooks here, i.e. just copy/paste, because this plugin can work not only with Jsonp, also with ESM modules

@alexander-akaitalexander-akait merged commitee25e51 intowebpack-contrib:masterApr 16, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@alexander-akaitalexander-akaitalexander-akait approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@FogelAI@grybykm@alexander-akait

[8]ページ先頭

©2009-2025 Movatter.jp