This repository has been archived by the owner on Oct 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
revert: feat(css-loader): use preload when available (#631) #645
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This reverts commit 1423ca3, because the feature doesn't work as expected, as described here: liferay-frontend/liferay-portal#345 (comment) In short, our testing showed the loader producing code that correctly inserted `preload` links in the `head`, and the network pane showed the corresponding resources being fetched, and in the right order. But the associated styles were not being applied to the DOM, leading to visual inconsistencies, as well as undesirable console spew of the form: > The resource .../css/ApplicationsMenu.css was preloaded using link > preload but not used within a few seconds from the window's load > event. Please make sure it has an appropriate `as` value and it is > preloaded intentionally. To fix this, we might be able to add a second, non-`preload`-ing `link` tag, but that would defeat the purpose of our original change, which was to improve our Lighthouse metrics. So, reverting this for now. We might revisit `preload` for this or some other purpose in the future. Original PR: #632
Simple revert, and I have to release 821 packages before I can update liferay-portal, so I'm going to merge this. |
wincent
added a commit
to liferay/liferay-npm-tools
that referenced
this pull request
Sep 17, 2020
Because we need this revert: liferay/liferay-js-toolkit#645 Done with: cd packages/liferay-npm-bundler-preset-liferay-dev yarn add \ babel-preset-liferay-standard@2.19.2 \ liferay-npm-bundler-loader-css-loader@2.19.2 \ liferay-npm-bundler-plugin-{exclude-imports,inject-imports-dependencies,inject-peer-dependencies,namespace-packages,replace-browser-modules,resolve-linked-dependencies}@2.19.2 cd ../liferay-npm-scripts yarn add \ liferay-npm-bridge-generator@2.19.2 \ liferay-npm-bundler@2.19.2 Note that we have some cross-project coupling going on here that lead to duplicates in the yarn.lock file: ``` $ yarn why liferay-npm-bundler-plugin-resolve-linked-dependencies 7.97s [wincent/deps] ~/code/liferay-npm-tools [1/4] 🤔 Why do we have the module "liferay-npm-bundler-plugin-resolve-linked-dependencies"...? => Found "liferay-npm-bundler-plugin-resolve-linked-dependencies@2.19.2" - Hoisted from "_project_#liferay-npm-bundler-preset-standard#liferay-npm-bundler-plugin-resolve-linked-dependencies" - Hoisted from "_project_#liferay-npm-bundler-preset-liferay-dev#liferay-npm-bundler-plugin-resolve-linked-dependencies" => Found "liferay-theme-tasks#liferay-npm-bundler-plugin-resolve-linked-dependencies@2.19.1" - Hoisted from "_project_#liferay-npm-scripts#liferay-theme-tasks#liferay-npm-build-tools-common#liferay-npm-bundler-preset-standard#liferay-npm-bundler-plugin-resolve-linked-dependencies" ``` Neither `yarn` nor a `yarn install --force` were enough to get rid of it; had to go with `rm yarn.lock && yarn`. This gets rid of the duplicate dependencies from the liferay-js-toolkit project, but there are a bunch of others in here still, hopefully benign (eg. look at the `@storybook` dupes in there).
wincent
added a commit
to liferay/liferay-npm-tools
that referenced
this pull request
Sep 17, 2020
Release notes: https://github.com/liferay/liferay-npm-tools/releases/tag/liferay-npm-bundler-preset-liferay-dev%2Fv4.6.2 Motivating change -- getting this PR, which reverts a broken feature: liferay/liferay-js-toolkit#645 Updated with: cd packages/liferay-npm-scripts yarn add liferay-npm-bundler-preset-liferay-dev@4.6.2
brianchandotcom
pushed a commit
to brianchandotcom/liferay-portal
that referenced
this pull request
Sep 17, 2020
Release notes: https://github.com/liferay/liferay-npm-tools/releases/tag/liferay-npm-scripts%2Fv32.6.2 Principal change of interest is this revert: liferay/liferay-js-toolkit#645 Which removes the "preload" feature of the css-loader, because it didn't work as intended for reasons described here: liferay-frontend#345 (comment) Note that even though we aren't using that feature, we are keeping the changes from a couple of commits ago ("LPS-120199 Future-proof users of liferay-npm-bundler-preset-standard"), because the arguments there still apply.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This reverts commit 1423ca3, because the feature doesn't work as expected, as described in this comment.
In short, our testing showed the loader producing code that correctly inserted
preload
links in thehead
, and the network pane showed the corresponding resources being fetched, and in the right order. But the associated styles were not being applied to the DOM, leading to visual inconsistencies, as well as undesirable console spew of the form:To fix this, we might be able to add a second, non-
preload
-inglink
tag, but that would defeat the purpose of our original change, which was to improve our Lighthouse metrics.So, reverting this for now. We might revisit
preload
for this or some other purpose in the future.Original PR: #632