Skip to content

Commit 8245c29

Browse files
committed
[update] changed default jet-start port to vite default; moved most of webpack related data to the Webpack configuration page
1 parent e5fa4f3 commit 8245c29

13 files changed

+301
-298
lines changed

SUMMARY.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@
2828
* [Part IV - Toolchain](part-iv-toolchain/README.md)
2929
* [Deploying and Testing](part-iv-toolchain/deploying-and-testing.md)
3030
* [Big App Development](part-iv-toolchain/big-app-development.md)
31-
* [Developing Big App with Webpack](part-iv-toolchain/developing-big-app-with-webpack.md)
3231
* [Using TypeScript](part-iv-toolchain/using-typescript.md)
33-
* [Configuring Webpack](part-iv-toolchain/webpack-configuration.md)
3432
* [Using with Vite](part-iv-toolchain/using-with-vite.md)
35-
* [Importing Webix as Module](part-iv-toolchain/importing-webix-as-module.md)
36-
* [Using Webix Jet without Webpack](part-iv-toolchain/using-webix-jet-without-webpack.md)
37-
* [Changing the Port of the Dev Server](part-iv-toolchain/working-with-package.json.md)
33+
* [Using with Webpack](part-iv-toolchain/webpack-configuration.md)
34+
* [Using Webix Jet without Vite or Webpack](part-iv-toolchain/using-webix-jet-without-webpack.md)
3835
* [\[DEPRECATED\] WJet Utility for Faster Prototyping](part-iv-toolchain/wjet-utility-for-faster-prototyping.md)
3936
* [API Reference](api/README.md)
4037
* [JetApp API](api/jetapp-api.md)

getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ yarn
2222
yarn start
2323
```
2424

25-
Next, open `http://localhost:8080` in the browser. You will see the application interface. Let's have a look at what it has inside.
25+
Next, open `http://localhost:5173` in the browser. You will see the application interface. Let's have a look at what it has inside.
2626

2727
## The Application Structure
2828

migration-from-jet-0.x.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ npm install
2222
npm start
2323
```
2424

25-
* open the app at _localhost:8080_.
25+
* open the app at _localhost:5173_.
2626

2727
## Troubleshooting
2828

29-
* If you get `can not resolve` error in webpack, make sure you add the alias and the path to the lib in question in **webpack.config.js**. [Check the docs](https://webpack.js.org/configuration/resolve/).
30-
* If something else goes wrong, use the [starter jet repo](https://github.com/webix-hub/jet-start) as the base for migration and replace the sources folder as above.
29+
* If something goes wrong, use the [starter jet repo](https://github.com/webix-hub/jet-start) as the base for migration and replace the sources folder as above.
3130

3231
## Migrating views
3332

part-i-basic-usage/creating-apps.md

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ You can read these sections of Part II:
143143
* [App Config](../part-ii-webix-jet-in-details/app-config.md)
144144
* [Routers](../part-ii-webix-jet-in-details/routers.md)
145145
* [JetApp API](../api/jetapp-api.md)
146+
* [Vite Configuration](part-iv-toolchain/using-with-vite.md)
146147
* [Webpack Configuration](../part-iv-toolchain/webpack-configuration.md)
147148

148149
### Footnotes

part-ii-webix-jet-in-details/app-config.md

-48
Original file line numberDiff line numberDiff line change
@@ -157,54 +157,6 @@ export default class TopView extends JetView {
157157

158158
[Check out the demo >>](https://github.com/webix-hub/jet-demos/blob/master/sources/viewresolve.js)
159159

160-
### Code Splitting
161-
162-
You can [split your code into bundles](https://webpack.js.org/guides/code-splitting/) and load them on demand \(lazy loading\), which can greatly influence the initial loading time of the application. Lazy loading of app code is possible in Webix Jet with the help of a custom **app.views** handler. Where you can import the bundle on demand [\[2\]](app-config.md#2).
163-
164-
```javascript
165-
// myapp.js
166-
import "./styles/app.css";
167-
import {JetApp, EmptyRouter, HashRouter } from "webix-jet";
168-
169-
export default class MyApp extends JetApp{
170-
constructor(config){
171-
const defaults = {
172-
router: BUILD_AS_MODULE ? EmptyRouter : HashRouter,
173-
debug: !PRODUCTION,
174-
start: "/top/layout",
175-
views: (name) => {
176-
if (name === "modules.clients") //sources/modules/
177-
return import("modules/clients");
178-
179-
// load all other modules with default strategy
180-
return name;
181-
}
182-
};
183-
184-
super({ ...defaults, ...config });
185-
}
186-
}
187-
188-
if (!BUILD_AS_MODULE){
189-
webix.ready(() => new MyApp().render() );
190-
}
191-
```
192-
193-
In **webpack.config.js**, you can define the chunk naming scheme \(the _chunkFilename_ property\) in **output**:
194-
195-
```javascript
196-
// webpack.config.js
197-
...
198-
output: {
199-
...
200-
filename: "[name].js",
201-
chunkFilename: "[name].bundle.js"
202-
// will be 'clients.bundle.js' in this case
203-
}
204-
```
205-
206-
[Check out the demo >>](https://github.com/webix-hub/jet-demos/blob/master/sources/bundles.js)
207-
208160
### Custom Logic of Creating Views
209161

210162
You can also implement your own logic of view creating. Define **views** as a function for that:

part-ii-webix-jet-in-details/routers.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ webix.ready(() => {
6767
});
6868
```
6969

70-
Next, configure http redirects by adding a fallback. For webpack dev server from a starter kit, this can be done in _webpack.config_:
70+
Next, configure http redirects by adding a fallback. If you use the Webpack dev server from a starter kit, this can be done in _webpack.config_:
7171

7272
```javascript
7373
// webpack.config.js
@@ -98,10 +98,10 @@ webix.ready(() => {
9898

9999
In your _index.html_ you should set the relative URL with the same prefix:
100100

101-
```markup
101+
```html
102102
<!-- index.html -->
103103
<script type="text/javascript">
104-
if(document.location.pathname == "/index.html")
104+
if (document.location.pathname == "/index.html")
105105
document.location.href = "/myapp";
106106
</script>
107107
```

part-iii-practical-tasks/creating-complex-widgets.md

-28
Original file line numberDiff line numberDiff line change
@@ -106,31 +106,3 @@ export default class MyView extends JetView {
106106
}
107107
```
108108
109-
## Dynamic Widget Loading
110-
111-
If you want to load custom widget code on demand, you can split your code and import the bundles with widget code when it is needed. For example, widgets can be imported in [config\(\)](../part-ii-webix-jet-in-details/views.md#config) of a Jet view:
112-
113-
```javascript
114-
// views/statistics.js
115-
import {JetView} from "webix-jet";
116-
export default class StatisticsView extends JetView{
117-
config(){
118-
const widgets = import(/* webpackChunkName: "widgets" */ "modules/customgrid");
119-
return widgets.then(() => {
120-
121-
return { rows:[
122-
{ type:"header", template:"Sales 2018" },
123-
{ view:"custom-grid" }
124-
]};
125-
126-
});
127-
}
128-
}
129-
```
130-
131-
{% hint style="info" %}
132-
This works for both custom Webix widgets and Jet apps as custom widgets.
133-
{% endhint %}
134-
135-
[Check out the demo &gt;&gt;](https://github.com/webix-hub/jet-demos/blob/master/sources/bundles.js)
136-

part-iv-toolchain/big-app-development.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
If you develop a large app, it has sense to split it into multiple modules, which can be developed and tested separately and combined into a single app on the last step of development.
66

7-
Starting with Webix Jet 3.0, the toolchain has been migrated to Vite, and it is now possible to build apps as modules using Vite (read about building with Webpack [here](https://webix.gitbook.io/webix-jet/part-iv-toolchain/developing-big-app-with-webpack)). If you have an existing project that uses Webpack and you wish to migrate to Vite, follow these steps:
7+
Starting with Webix Jet 3.0, the toolchain has been migrated to Vite, and it is now possible to build apps as modules using Vite (read about building with Webpack [here](part-iv-toolchain/webpack-configuration.md)). If you have an existing project that uses Webpack and you wish to migrate to Vite, follow these steps:
88

99
- provide [vite.config.js](https://github.com/webix-hub/jet-start/blob/vite-standalone/vite.config.js)
1010
- set env variables via the [.env](https://github.com/webix-hub/jet-start/blob/vite-standalone/.env) file

part-iv-toolchain/developing-big-app-with-webpack.md

-143
This file was deleted.

part-iv-toolchain/importing-webix-as-module.md

-48
This file was deleted.

part-iv-toolchain/using-webix-jet-without-webpack.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Using Webix Jet without Webpack
1+
# Using Webix Jet without Vite or Webpack
22

3-
If you really want to, you can drop Webpack and include Jet source code directly to the page. ```npm``` contains two versions of Jet JS code:
3+
If you really want to, you can drop Vite or Webpack and include Jet source code directly to the page. ```npm``` contains two versions of Jet JS code:
44

55
- ES6 in *es6/jet.js* (used by default),
66
- ES5 in *es5/jet.js* (use this).

0 commit comments

Comments
 (0)