Skip to content

Commit

Permalink
FSE on WP.com: Initial explorations
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Mar 3, 2020
1 parent af0d7ff commit d54d084
Show file tree
Hide file tree
Showing 9 changed files with 416 additions and 140 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ jobs:
- prepare
- run:
name: TypeScript strict typecheck of individual subprojects
command: npm run typecheck -- --project client/landing/gutenboarding
command: |
npm run typecheck -- --project client/landing/custom-editor
&& npm run typecheck -- --project client/landing/gutenboarding
lint-and-translate:
<<: *defaults
Expand Down
13 changes: 13 additions & 0 deletions client/landing/custom-editor/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* External dependencies
*/
import config from '../../config';
import { initialize } from '@wordpress/edit-site';

window.AppBoot = () => {
if ( ! config.isEnabled( 'custom-editor' ) ) {
window.location.href = '/';
} else {
initialize( 'wpcom', {} );
}
};
8 changes: 8 additions & 0 deletions client/landing/custom-editor/section.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const CUSTOM_EDITOR_SECTION_DEFINITION = {
name: 'custom-editor',
paths: [ '/custom-editor' ],
module: 'custom-editor',
secondary: false,
group: 'custom-editor',
enableLoggedOut: true,
};
13 changes: 13 additions & 0 deletions client/landing/custom-editor/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "@automattic/calypso-build/tsconfig",
"compilerOptions": {
// Disallow features that require cross-file information for emit.
// Must be used with babel typescript
"isolatedModules": true,

"baseUrl": ".",
"paths": {
"*": [ "*", "../../*" ]
}
}
}
2 changes: 2 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@wordpress/data-controls": "1.8.0",
"@wordpress/dom": "2.8.0",
"@wordpress/edit-post": "3.13.1",
"@wordpress/edit-site": "1.3.1",
"@wordpress/editor": "9.12.1",
"@wordpress/element": "2.11.0",
"@wordpress/format-library": "1.14.1",
Expand Down Expand Up @@ -111,6 +112,7 @@
"lru": "3.1.0",
"lunr": "2.3.8",
"marked": "0.7.0",
"memize": "1.0.5",
"moment": "2.24.0",
"moment-timezone": "0.5.27",
"morgan": "1.9.1",
Expand Down
2 changes: 2 additions & 0 deletions client/server/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { logSectionResponse } from './analytics';
import analytics from 'server/lib/analytics';
import { getLanguage, filterLanguageRevisions } from 'lib/i18n-utils';
import { isWooOAuth2Client } from 'lib/oauth2-clients';
import { CUSTOM_EDITOR_SECTION_DEFINITION } from 'landing/custom-editor/section';
import { GUTENBOARDING_SECTION_DEFINITION } from 'landing/gutenboarding/section';
import { JETPACK_CLOUD_SECTION_DEFINITION } from 'landing/jetpack-cloud/section';

Expand Down Expand Up @@ -860,6 +861,7 @@ module.exports = function() {
handleSectionPath( LOGIN_SECTION_DEFINITION, '/log-in', 'entry-login' );
loginRouter( serverRouter( app, setUpRoute, null ) );

handleSectionPath( CUSTOM_EDITOR_SECTION_DEFINITION, '/custom-editor', 'entry-custom-editor' );
handleSectionPath( GUTENBOARDING_SECTION_DEFINITION, '/gutenboarding', 'entry-gutenboarding' );

// This is used to log to tracks Content Security Policy violation reports sent by browsers
Expand Down
1 change: 1 addition & 0 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ const webpackConfig = {
'entry-jetpack-cloud': [ path.join( __dirname, 'landing', 'jetpack-cloud' ) ],
'entry-login': [ path.join( __dirname, 'landing', 'login' ) ],
'entry-gutenboarding': [ path.join( __dirname, 'landing', 'gutenboarding' ) ],
'entry-custom-editor': [ path.join( __dirname, 'landing', 'custom-editor' ) ],
} ),
mode: isDevelopment ? 'development' : 'production',
devtool: process.env.SOURCEMAP || ( isDevelopment ? '#eval' : false ),
Expand Down
1 change: 1 addition & 0 deletions config/development.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"comments/management/threaded-view": false,
"composite-checkout-wpcom": false,
"coming-soon": true,
"custom-editor": true,
"desktop-promo": true,
"devdocs": true,
"devdocs/redirect-loggedout-homepage": true,
Expand Down
Loading

0 comments on commit d54d084

Please sign in to comment.