Skip to content

Commit

Permalink
pull origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhanaslan committed Jan 3, 2022
2 parents 8350797 + cadadbf commit 837bbd7
Show file tree
Hide file tree
Showing 10 changed files with 216 additions and 147 deletions.
49 changes: 48 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,59 @@
# Changelog

## [1.0.10](https://github.com/hepsiburada/VoltranJS/compare/1.0.9...1.0.10)
## [v1.0.18](https://github.com/hepsiburada/VoltranJS/compare/v1.0.17...v1.0.18)

### Merged

- fixed regenerator-runtime [`#26`](https://github.com/hepsiburada/VoltranJS/pull/26)

### Commits

- chore: update changelog [`3a6f319`](https://github.com/hepsiburada/VoltranJS/commit/3a6f3196100385e25b8d08085b4f5e034564db56)

## [v1.0.17](https://github.com/hepsiburada/VoltranJS/compare/v1.0.11...v1.0.17) - 2021-09-06

### Merged

- pass headers in fragments [`#27`](https://github.com/hepsiburada/VoltranJS/pull/27)
- set-cookie header imported to cookies [`#25`](https://github.com/hepsiburada/VoltranJS/pull/25)
- Undefined SassResources bug [`#23`](https://github.com/hepsiburada/VoltranJS/pull/23)
- sass-resources-loader implementation. [`#22`](https://github.com/hepsiburada/VoltranJS/pull/22)
- VoltranJS serverConfig file fixed. [`#21`](https://github.com/hepsiburada/VoltranJS/pull/21)

### Commits

- sass-resource-loader implementation is done. Updated read me according to new config. [`cc97ef5`](https://github.com/hepsiburada/VoltranJS/commit/cc97ef506b03be4db82c0044b12301a22eb97085)
- voltranConfig.sassResources undefined bug fixed. [`acb50ef`](https://github.com/hepsiburada/VoltranJS/commit/acb50efb72227a759663eef15be48afc4b26e132)
- chore: update changelog [`f3501ad`](https://github.com/hepsiburada/VoltranJS/commit/f3501ad944fe8f186acdce498e82ec131e09ff51)
- chore: update changelog [`05955c3`](https://github.com/hepsiburada/VoltranJS/commit/05955c343471d27e797c472c09811410d56fdb7d)
- chore: update changelog [`94a3f7a`](https://github.com/hepsiburada/VoltranJS/commit/94a3f7a0e76363fd6fc7fb22bd80dd5f34b228d9)
- chore: update changelog [`19134e7`](https://github.com/hepsiburada/VoltranJS/commit/19134e71989fe79328c8157b7ceb46bbc9afb7ef)
- Update changelog [`717c909`](https://github.com/hepsiburada/VoltranJS/commit/717c9090983e84d29346a43ccdaf4d3fdc6c858d)
- Version upgrade [`b4aad6f`](https://github.com/hepsiburada/VoltranJS/commit/b4aad6f1cbc30c22c547529e9f86bd267f0559b1)

## [v1.0.11](https://github.com/hepsiburada/VoltranJS/compare/1.0.10...v1.0.11) - 2021-06-08

### Merged

- feature: added without state parameter [`#20`](https://github.com/hepsiburada/VoltranJS/pull/20)
- feat: jest library setup [`#19`](https://github.com/hepsiburada/VoltranJS/pull/19)

### Commits

- Create CODE_OF_CONDUCT.md [`6da53eb`](https://github.com/hepsiburada/VoltranJS/commit/6da53ebcf849a8460619e77173cda485b6267c89)
- Update issue templates [`6d1d122`](https://github.com/hepsiburada/VoltranJS/commit/6d1d122c790a1a1fe5f66f6c1f2c337ced793e16)

## [1.0.10](https://github.com/hepsiburada/VoltranJS/compare/1.0.9...1.0.10) - 2021-05-27

### Merged

- feat: add changelog generator service [`#18`](https://github.com/hepsiburada/VoltranJS/pull/18)
- use @babel/polyfill/noConflict instead @babel/polyfill [`#16`](https://github.com/hepsiburada/VoltranJS/pull/16)

### Commits

- chore: add changelog [`b8662b0`](https://github.com/hepsiburada/VoltranJS/commit/b8662b05673537883ba45576cf1e2d357bb0e5e0)

## [1.0.9](https://github.com/hepsiburada/VoltranJS/compare/1.0.8...1.0.9) - 2021-04-29

## [1.0.8](https://github.com/hepsiburada/VoltranJS/compare/1.0.7...1.0.8) - 2021-04-29
Expand Down
122 changes: 64 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,16 @@
<a href="#contributing">Contributing</a>
</p>


### Key Features

You can use Voltran if you need a micro frontend framework that provides following features:

- Lightweight and fast API
- Serves single and multiple components
- Preview (to visualize components)
- SEO friendly (if needed)
- CSS & SCSS support
- Supports only React (for now)
- Lightweight and fast API
- Serves single and multiple components
- Preview (to visualize components)
- SEO friendly (if needed)
- CSS & SCSS support
- Supports only React (for now)

## Installation

Expand All @@ -45,11 +44,13 @@ Voltran requires [Node.js](https://nodejs.org/) v10.15.0+ to run.
Install the Voltran.

#### Yarn

```sh
$ yarn add voltranjs
```

#### Npm

```sh
$ npm install voltranjs
```
Expand All @@ -62,67 +63,52 @@ First of all, you should import `@voltran/core`.

After that we can write the component's code.


**HelloWorld.js**


```jsx

const voltran = require('@voltran/core');

import React from 'react';

const ROUTE_PATHS = {
HELLOWORLDPAGE: '/HelloWorld',
HELLOWORLDPAGE: '/HelloWorld'
};

const HelloWorld = ({initialState}) => {

return (
<>
Hello World!
</>
);
const HelloWorld = ({ initialState }) => {
return <>Hello World!</>;
};

const component = voltran.default.withBaseComponent(HelloWorld, ROUTE_PATHS.HELLOWORLDPAGE);

export default component;

```

If you want to fetch data from server side, you should add `getInitialState`.


**./conf/local.config.js**


```js

const port = 3578;

module.exports = {
port: port,
baseUrl: `http://localhost:${port}`,
mediaUrl: '',
services: {
'voltranapi': {
'clientUrl': 'http://voltran-api.qa.hepsiburada.com',
'serverUrl': 'http://voltran-api.qa.hepsiburada.com'
voltranapi: {
clientUrl: 'http://voltran-api.qa.hepsiburada.com',
serverUrl: 'http://voltran-api.qa.hepsiburada.com'
}
},
timeouts: {
clientApiManager: 20 * 1000,
serverApiManager: 20 * 1000
}
};

```


**HelloWorld.js**


```jsx

const voltran = require('@voltran/core');
Expand Down Expand Up @@ -157,7 +143,6 @@ export default component;

```


**Output For Preview**

```
Expand All @@ -179,32 +164,32 @@ Hello World. My Name is Volkan!
}
```


## Configs

Voltran requires following configurations:

| **Config** | **Type** |
| ------ | ------ |
| [appConfigFile](#appConfigFile) | Object |
| [dev](#dev) | Boolean |
| [distFolder](#distFolder) | String |
| [publicDistFolder](#publicDistFolder) | String |
| [inputFolder](#inputFolder) | String * `required` |
| [monitoring](#monitoring) | Object |
| [port](#port) | Number - String |
| [prefix](#prefix) | String * `required` |
| [ssr](#ssr) | String |
| [styles](#styles) | Array |
| [output](#output) | Object |
| [staticProps](#staticProps) | Array |
| [routing](#routing) | Object |
| [webpackConfiguration](#webpackConfiguration) | Object |

| **Config** | **Type** |
| --------------------------------------------- | -------------------- |
| [appConfigFile](#appConfigFile) | Object |
| [dev](#dev) | Boolean |
| [distFolder](#distFolder) | String |
| [publicDistFolder](#publicDistFolder) | String |
| [inputFolder](#inputFolder) | String \* `required` |
| [monitoring](#monitoring) | Object |
| [port](#port) | Number - String |
| [prefix](#prefix) | String \* `required` |
| [ssr](#ssr) | String |
| [styles](#styles) | Array |
| [output](#output) | Object |
| [staticProps](#staticProps) | Array |
| [routing](#routing) | Object |
| [webpackConfiguration](#webpackConfiguration) | Object |
| [sassResources](#sassResources) | Array |

#### appConfigFile

It should contain environment specific configurations (test, production ...).

```
appConfigFile: {
entry: path.resolve(__dirname, './yourConfigFolder/'),
Expand All @@ -214,35 +199,43 @@ appConfigFile: {
}
}
```

#### dev

Development mode. Set to `true` if you need to debug.

`Default`: `false`

#### distFolder

The path to the folder where bundled scripts will be placed after the build.

`Default`: `./dist`

#### publicDistFolder

The path to the folder where asset files will be placed after the build.

`Default`: `./dist/assets`

#### inputFolder

The path to the folder that contains script files. It's required.

Passes this config to Babel Loader where it reads all js files under this folder.

'Voltran' converts your files to the appropriate format and optimizes them.

#### monitoring

For now, only prometheus is supported.

```
monitoring: {
prometheus: false
}
```

> or you can set your custom js file.
```
Expand All @@ -252,23 +245,29 @@ monitoring: {
```

#### port

`Default`: `3578`

> If you want to change the port
> you may need to change the port in appConfigFiles
#### prefix

`It is required.`

There may be different components owned by different teams using voltrans on the same page. Voltran needs to use a prefix in order to avoid conflicts issues.
This prefix is prepended to initial states and CSS class names.

> We recommend that each team use their own acronyms/prefixes.
#### ssr

`Default`: `true`
Voltran supports server side rendering.
Applications that need 'SEO' features needs to set this parameter to `true`.

#### styles

This field's value should be an array of strings. Array values should be the paths to the global CSS files.

```
Expand All @@ -279,6 +278,7 @@ styles: [
```

### output

```
output: {
client: {
Expand All @@ -295,6 +295,7 @@ output: {
```

#### staticProps

You can pass static props to all components at the same time.

```
Expand All @@ -304,6 +305,7 @@ staticProps: [
```

#### routing

Voltran need two files to set routing.

```
Expand All @@ -314,26 +316,32 @@ routing: {
```

Example files can be found here:
- [components.js](https://github.com/hepsiburada/VoltranJS-Starter-Kit/blob/master/src/appRoute/components.js)
- [dictionary.js](https://github.com/hepsiburada/VoltranJS-Starter-Kit/blob/master/src/appRoute/dictionary.js)

- [components.js](https://github.com/hepsiburada/VoltranJS-Starter-Kit/blob/master/src/appRoute/components.js)
- [dictionary.js](https://github.com/hepsiburada/VoltranJS-Starter-Kit/blob/master/src/appRoute/dictionary.js)

#### webpackConfiguration

You can add your webpack configuration. They will be merged with the voltran configs.

You can access the starter kit we created from the [link](https://github.com/hepsiburada/VoltranJS-Starter-Kit).

#### sassResources

You can add sass resources to this field as string array. sass-resource-loader gonna inject those files in every sass files so you won't need to import them.

You can check [sass-resource-loader](https://github.com/shakacode/sass-resources-loader) for usage.

## Tech

Voltran uses a number of open source projects to work properly:

* [ReactJS] - A JavaScript library for building user interfaces!
* [Webpack] - Module bundler
* [babel] - The compiler for next generation JavaScript.
* [node.js] - evented I/O for the backend
* [hiddie] - fast node.js network app framework (friendly fork of [middie](https://github.com/fastify/middie))
* [Yarn] - the streaming build system

- [ReactJS] - A JavaScript library for building user interfaces!
- [Webpack] - Module bundler
- [babel] - The compiler for next generation JavaScript.
- [node.js] - evented I/O for the backend
- [hiddie] - fast node.js network app framework (friendly fork of [middie](https://github.com/fastify/middie))
- [Yarn] - the streaming build system

## Contributing

Expand All @@ -343,8 +351,6 @@ Voltran uses a number of open source projects to work properly:
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D


<p align="center">
<a href="https://medium.com/hepsiburadatech"><img src="./src/assets/hepsitech.png" alt="hepsitech"></a>
</p>

Loading

0 comments on commit 837bbd7

Please sign in to comment.