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

🏗 Replace hack to prevent inlining of cssText with a @noinline annotation #23373

Merged
merged 1 commit into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified build-system/runner/dist/runner.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ public AmpCodingConvention(CodingConvention convention) {
* delivery), this could go away there.
*/
@Override public boolean isExported(String name, boolean local) {
// Bad hack, but we should really not try to inline CSS as these strings can
// be very long.
// See https://github.com/ampproject/amphtml/issues/10118
// cssText is defined in build-system/tasks/css.js#writeCss
if (name.startsWith("cssText$$module$build$")) {
return true;
}

if (local) {
return false;
}
Expand Down
11 changes: 7 additions & 4 deletions build-system/tasks/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,13 @@ function compileCss(watch, opt_compileAll) {
*/
function writeCss(css, jsFilename, cssFilename, append) {
return toPromise(
// cssText is hardcoded in AmpCodingConvention.java
file(jsFilename, 'export const cssText = ' + JSON.stringify(css), {
src: true,
})
file(
jsFilename,
'/** @noinline */ export const cssText = ' + JSON.stringify(css),
rsimha marked this conversation as resolved.
Show resolved Hide resolved
{
src: true,
}
)
.pipe(gulp.dest('build'))
.on('end', function() {
mkdirSync('build');
Expand Down