Version 2
What is new? Migration Guide From V1
Getting Started
Understanding WinnetouJs Setting Up
Constructos
Creating Constructos Advanced Options Lazy Loading
Mutables
Constructos State Management Case: Custom State Management System Winnetou FX
Addons
Winnetou Selectors Winnetou Router App Translations CSS Sass Built-in Transpiler SVG Icons Color Themes
Extras
Useful JsDoc Syntax
Plugins
Creating Plugins SlideScreen Official Plugin Animate Official Plugin
Compiling to Production
WBR
API Change Log Git Hub Pull Requests Guidelines Get in touch
Version 2

Migration Guide

This guide will help you to migrate your WinnetouJs application from version 1 to version 2.

Changes

The main change is the configuration file. In version 1, the configuration file is a javascript file, now it is a JSON file.

The configuration file is now called win.config.json and it is located in the root of your project.

Migration Guide: win.config.js to win.config.json

This guide will help you migrate your WinnetouJs configuration file from a JavaScript-based win.config.js to a JSON-based win.config.json. The new format enhances compatibility, simplifies validation, and improves integration with other tools.

1. Understand the Differences

2. Prepare Your win.config.js for Conversion

Review your current win.config.js to identify:

base.scss

    
    // Example win.config.js
module.exports = {
    serverPort: 3197,
    constructosPath: './src/constructos',
    constructosOut: './dist/constructos',
    apps: [
        { entry: './src/app1/index.js', out: './dist/app1' },
        { entry: './src/app2/index.js', out: './dist/app2' }
    ],
    sass: [
    { 
        entryFolder: './src/styles', 
        outFolder: './dist/styles', 
        firstFile: './src/styles/_variables.scss' }
    ],
    defaultLang: 'en-us',
    publicPath: './public',
    icons: './src/assets/icons'
};
    

3. Convert to JSON Format

Replace JavaScript-specific constructs with static values and create the win.config.json file:

base.scss

{
    "$schema": "./node_modules/winnetoujs/schemas/win.config.schema.json",
    "serverPort": 3197,
    "constructosPath": "./src/constructos",
    "constructosOut": "./dist/constructos",
    "apps": [
    { "entry": "./src/app1/index.js", "out": "./dist/app1" },
    { "entry": "./src/app2/index.js", "out": "./dist/app2" }
    ],
    "sass": [
    { 
        "entryFolder": "./src/styles", 
        "outFolder": "./dist/styles", 
        "firstFile": "./src/styles/_variables.scss" }
    ],
    "defaultLang": "en-us",
    "publicPath": "./public",
    "icons": "./src/assets/icons"
}
    

4. Update Your Codebase

Replace references to win.config.js with win.config.json:

base.scss

    // From:
const config = require('./win.config.js');

// To:
const config = require('./win.config.json');
    

5. Validate the Configuration

6. Test Thoroughly

Validate all features dependent on configuration (e.g., apps, Sass paths, icons) to ensure no regressions are introduced.

7. Deprecate win.config.js

After successful migration, remove the old win.config.js file to avoid confusion and accidental usage.

8. Benefits of Using JSON

By following this guide, you can seamlessly transition to the new win.config.json format and take advantage of its benefits.

Troubleshooting

node wbr --run-server for vscode extension issues

Update your socket.io to 4.8.1+ in order to fix WinnetouJs Extension Server errors.