Merge pull request #2029 from overleaf/ta-build-main-recurly-3

Load Recurly JS Separately

GitOrigin-RevId: 8baa2be76fa9d8a47676bc0bd0a80f4c05cc1600
This commit is contained in:
Timothée Alby 2019-07-31 17:34:46 +02:00 committed by sharelatex
parent befa4e932e
commit 7785c7b59e
8 changed files with 10 additions and 31 deletions

View file

@ -56,9 +56,6 @@ module.exports = function(grunt) {
}, },
{ {
name: 'ace/worker-latex' name: 'ace/worker-latex'
},
{
name: 'main-recurly'
} }
] ]
} }

View file

@ -101,16 +101,16 @@ minify_css: $(CSS_FILES)
minify_es: minify_es:
npm -q run webpack:production npm -q run webpack:production
compile: $(DIST_FILES) css public/js/main.js public/js/main-recurly.js public/js/ide.js compile: $(DIST_FILES) css public/js/main.js public/js/ide.js
@$(MAKE) compile_modules @$(MAKE) compile_modules
compile_full: compile_full:
$(BABEL) public/src --out-dir public/js $(BABEL) public/src --out-dir public/js
$(BABEL) test/unit_frontend/src --out-dir test/unit_frontend/js $(BABEL) test/unit_frontend/src --out-dir test/unit_frontend/js
rm -f public/js/ide.js public/js/main.js public/js/main-recurly.js # We need to generate ide.js, main.js, main-recurly.js manually later rm -f public/js/ide.js public/js/main.js # We need to generate ide.js, main.js, manually later
$(MAKE) css_full $(MAKE) css_full
$(MAKE) compile_modules_full $(MAKE) compile_modules_full
$(MAKE) compile # ide.js, main.js, main-recurly.js, share.js, and anything missed $(MAKE) compile # ide.js, main.js, share.js, and anything missed
compile_css_full: compile_css_full:
$(MAKE) css_full $(MAKE) css_full
@ -150,7 +150,7 @@ $(MODULE_MAKEFILES): Makefile.module
clean: clean_frontend clean_css clean_tests clean: clean_frontend clean_css clean_tests
clean_frontend: clean_frontend:
rm -rf public/js/{analytics,directives,es,filters,ide,main,main-recurly,modules,services,utils} rm -rf public/js/{analytics,directives,es,filters,ide,main,modules,services,utils}
rm -f public/js/*.{js,map} rm -f public/js/*.{js,map}
clean_css: clean_css:

View file

@ -61,7 +61,6 @@ const pathList = [
`${jsPath}libs/require.js`, `${jsPath}libs/require.js`,
`${jsPath}ide.js`, `${jsPath}ide.js`,
`${jsPath}main.js`, `${jsPath}main.js`,
`${jsPath}main-recurly.js`,
`${jsPath}libraries.js`, `${jsPath}libraries.js`,
'/stylesheets/style.css', '/stylesheets/style.css',
'/stylesheets/light-style.css', '/stylesheets/light-style.css',

View file

@ -125,8 +125,7 @@ html(
"moment": "libs/#{lib('moment')}", "moment": "libs/#{lib('moment')}",
"fineuploader": "libs/#{lib('fineuploader')}", "fineuploader": "libs/#{lib('fineuploader')}",
"main": "#{buildJsPath('main.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}", "main": "#{buildJsPath('main.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}",
"libraries": "#{buildJsPath('libraries.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}", "libraries": "#{buildJsPath('libraries.js', {hashedPath:settings.useMinifiedJs, removeExtension:true})}"
"recurly": "https://js.recurly.com/v4/recurly"
}, },
"config":{ "config":{
"moment":{ "moment":{

View file

@ -2,12 +2,8 @@ extends ../layout
include ./dashboard/_team_name_mixin include ./dashboard/_team_name_mixin
block requirejs-init block scripts
script( script(src="https://js.recurly.com/v4/recurly.js")
data-main=buildJsPath("main-recurly.js", {hashedPath:false}),
baseurl=fullJsPath,
src=buildJsPath('libs/require.js', {hashedPath:true})
)
block content block content
.content.content-alt(ng-cloak) .content.content-alt(ng-cloak)

View file

@ -1,13 +1,7 @@
extends ../layout extends ../layout
block requirejs-init
script(
data-main=buildJsPath("main-recurly.js", {hashedPath:false}),
baseurl=fullJsPath,
src=buildJsPath('libs/require.js', {hashedPath:true})
)
block scripts block scripts
script(src="https://js.recurly.com/v4/recurly.js")
script(type='text/javascript'). script(type='text/javascript').
window.countryCode = '#{countryCode}' window.countryCode = '#{countryCode}'
window.plan_code = '#{plan_code}' window.plan_code = '#{plan_code}'

View file

@ -1,8 +0,0 @@
// main bundle plus recurly (loaded externaly from CDN) and all files requiring
// Recurly JS
define([
'main',
'recurly',
'main/subscription-dashboard',
'main/new-subscription'
], function() {})

View file

@ -22,6 +22,8 @@ define([
'main/bonus', 'main/bonus',
'main/system-messages', 'main/system-messages',
'main/translations', 'main/translations',
'main/subscription-dashboard',
'main/new-subscription',
'main/annual-upgrade', 'main/annual-upgrade',
'main/announcements', 'main/announcements',
'main/register-users', 'main/register-users',