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

feat!: add preload and prefetch attributes to manifest #50

Merged
merged 5 commits into from
Jul 31, 2023

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Jul 30, 2023

resolves #45

This adds backwards-compatible build-time analysis on whether to prefetch/preload resources. It should be exactly compatible with current default runtime values as moves the runtime code to build-time (and defers to any custom shouldPrefetch/shouldPreload that is passed).

Refactored to be a breaking change.

@danielroe danielroe requested a review from pi0 July 30, 2023 21:57
@danielroe danielroe self-assigned this Jul 30, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 30, 2023

Codecov Report

Merging #50 (ce3b75a) into main (ad2e20e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main      #50   +/-   ##
=======================================
  Coverage   97.54%   97.55%           
=======================================
  Files           6        6           
  Lines         530      532    +2     
  Branches      112      112           
=======================================
+ Hits          517      519    +2     
  Misses         13       13           
Files Changed Coverage Δ
src/runtime.ts 99.27% <100.00%> (-0.03%) ⬇️
src/types.ts 92.59% <100.00%> (+0.59%) ⬆️
src/utils.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@danielroe
Copy link
Member Author

We could alternatively entirely remove the shouldPreload/shouldPrefetch and make a major version bump.

@pi0
Copy link
Member

pi0 commented Jul 31, 2023

I love it! I think making a mjaor version + removing runtime hooks makes sense because if someone uses resolution in runtime and does not have build-time flags (with new build), it won't work.

@pi0 pi0 changed the title feat: add preload and prefetch attributes to manifest feat!: add preload and prefetch attributes to manifest Jul 31, 2023
@danielroe
Copy link
Member Author

Let's go for major version then. Though I do think this (as-is) is backwards compatible. (We require manifests to be normalised, not just for this reason.)

@danielroe danielroe merged commit ba42132 into main Jul 31, 2023
1 check passed
@danielroe danielroe deleted the feat/build-time-preload branch July 31, 2023 08:21
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

Successfully merging this pull request may close these issues.

Support preload: false and prefetch: false in manifest
3 participants