Skip to content

Conversation

@thet
Copy link
Member

@thet thet commented Dec 19, 2022

No description provided.

@thet thet force-pushed the separate-modernizr branch 2 times, most recently from 77165b0 to 6bc51ca Compare December 19, 2022 23:44
thet added 6 commits December 20, 2022 00:51
Since Patternslib 9.0.0-alpha.0 where we introduced webpack module
federation for our bundles, Modernizr is loaded asynchronously and
applying it's CSS classes a tick too late. For example, the change from
the `no-js` to the `js` class was done while the tiles have already been
drawn and visible on the screen, resulting in screen flickering. There
are a number of projects which depend on Modernizr being applied early.

This change now fixes the problem by separating the Modernizr build from
the Patternslib bundle.

If you depend on Modernzir, please include the new `modernizr.min.js` bundle in
a script tag, preferably before the Patternslib bundle `bundle.min.js`.

The global switch "window.__patternslib_disable_modernizr" is also removed, as
it got useless.
Remove unnecessary tests in .modernizrrc.js and slim down the build size.
Do not use an webpack entry to build the modernizr bundle with an
webpack runtime overhead. Instead, build it directly but abusing the
webpack CopyPlugin transform mechanism. We could also build the
modernizr bundle from the Makefile but that wouldn't provide the file
when watching or when running webpack-dev-server.
@thet thet force-pushed the separate-modernizr branch from 6bc51ca to 2bc52dd Compare December 19, 2022 23:51
@thet thet merged commit 16ca0ad into master Dec 19, 2022
@thet thet deleted the separate-modernizr branch December 19, 2022 23:53
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.

2 participants