Skip to content

Conversation

@ajefts
Copy link
Member

@ajefts ajefts commented May 30, 2017

No description provided.

Already configured things:
- A high-level draft of isomorphic App structure;
- A dummy client App;
- Babel with latest JS support both client- and server-side;
- ESLint (AirBnB style);
- Express server;
- Loading of .svg assets as ReactJS components with babel-plugin-inline-
react-svg
- React;
- React CSS Modules (via Babel plugin);
- SASS support;
- Stylelint for scss (standard Stylelint style);
- Webpack;
- TC Auth token is fetched at the client-side and stored into browser
cookies. Server-side, if the token is present in request, it is stored
into Redux state, along with the decoded user object, during server-side
rendering.

- A setup for isomorphic data loading into Redux store.

- Isomorphic config.
NOTE: To be successfully authenticated you should be logged in the
Topcoder accounts-app, and run the code at local.topcoder-dev.com:3000
for development backend, or local.topcoder.com for production backend.
If you run from a wrong domain, the code will fail to get auth token for
Topcoder API v2 even if you are properly logged in. In such case, if you
are using development build of the code, you'll see an error message in
console.
There is a demo/test page for fonts available at /examples/fonts-test
At the moment it works only for references to .js and .jsx files.
Winning submission from https://www.topcoder.com/challenge-
details/30056702/?type=develop is copied here from `react-components`
repository, and minimal necessary cleaning and re-structuring, to fit
into the rules of this very repo, has been performed.
Current global test coverage:
- Statements: 59.29%
- Branches: 60.61%
- Functions: 64.55%
- Lines: 63.26%
NOTE: It seems that HMR does not work properly when SCSS files
containing @include statements are modified (try on Fonts Test page to
update the styles - all text will just dissapear).
- Online Review links removed on request from TonyJ.
- Downloading of submissions is enabled with use of legacy (Studio) API,
as the new APIs don't support it yet (https://github.com/topcoder-
platform/community-app/issues/9).
- Submission previews are shown using legacy (Studio) API
(#8)
- Delete submission icon is temporarly removed, as we don't have any API
to remove them yet (https://github.com/topcoder-platform/community-
app/issues/10).
1. Fixes #5
2. Removes loading of style.css in dev environment (proper styles are
included into JS bundle in that case).
Related prop types checks and unit tests are still to be added,
but in the current state it is already safe to deploy SMP, thus
committing.
Some updates are rolled back, as their exact purpose is not clear to me.
This version of the code will be merged with the most recent dev branch,
and then all lint and unit tests issues will be cleaned out.
Clean up of unit tests.
In this commit:

1. Test coverage is incremented to:
- branches:	67.75%
- functions: 	83.00%
- lines: 	83.50%
- statements: 	82.75%

2. No unit tests fail.

3. All unit tests written in a good way (sure, there is a room for
improvement, but in absense of better ideas, the pattern of existing
tests can be followed as it is).

DISCLAIMER: Some unit tests still may fail randomly sometimes. The
reason is that when they are executed in random order they may change
process.env (environment variables) in a way which affect other tests.
If a test fails, most probably you want to:

- delete process.env.FRONT_END - this will ensure that code assumes
server-side execution, and configuration is correctly loaded.

- process.env.NODE_ENV = 'development' - this will ensure that
development configuration is loaded.

Both are necessary for consistent rendering of React components.
Probably, rather than adding these checks to all tests, we should just
ensure that those few tests that touch these variables, set them to
proper defaults in the end. To be investigated.
birdofpreyru and others added 25 commits May 27, 2017 00:41
…top view only)

__tests__/shared/containers/tc-communities/__snapshots__/Page.jsx.snap
During visitor auth check, if he is authenticated, user groups are
fetched from 'v3/groups?memberId=USER_ID&membershipType=user' and stored
into Redux state under the state.auth.profile.groups route.
__tests__/shared/containers/tc-communities/__snapshots__/Page.jsx.snap
Latest changes introduced few small problems into the standard TC
header. This is the fix. Also updates StyleFmt to v.6.0.0 and removes
dependency on `immutable`.
@ajefts ajefts requested a review from mtwomey May 30, 2017 17:26
@mtwomey mtwomey merged commit 5a56360 into master May 30, 2017
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.

5 participants