GithubHelp home page GithubHelp logo

Comments (2)

acb avatar acb commented on June 1, 2024

I've been playing around with it a bit more to try to figure this out, including deleting my entire Riot project and reducing it to just this tag that I have as an example to eliminate any chance that we were doing something weird in the project.

I've found that toggling inputs to empty strings works fine on Riot 2.6.9 but breaks as soon as I update to 3.0.0 or higher (I tried 4+ as well, all the way up to 9). Additionally, something interesting, when I installed riot-compiler in order to compile 4+ when I downgraded back to 2.6.9 the text input issue persisted even after a fresh recompile. I had to uninstall riot-compiler before 2.6.9 would start working again.

Now I'm wondering if this is some issue with the compiler? We've been using riotify through grunt to do our build. The relevant part of the compiler function is here in case it helps:

        var projectDir = SOURCE_DIR + '/projects/' + project
        var projectFile = projectDir + '/index.js'
        var out = DEST_DIR + '/' + target + '/js/' + project + '.js'

        var componentFiles = grunt.file.expand(projectDir + '/**/*.tag')
        if(allComps) {
            componentFiles = componentFiles.concat(grunt.file.expand(SOURCE_DIR + '/components/**/*.tag'))
        }

        var componentRequire = ';'
        for (var i = 0; i < componentFiles.length; i++) {
          componentRequire = componentRequire + 'require("'+componentFiles[i]+'");'
        }

        var fs = require('fs');
        var browserify = require('browserify');
        var watchify = require('watchify');
        var riotify = require('riotify');

        var b = watchify(browserify({
          cache: {},
          packageCache: {},
          fullPaths: true,
          debug: sourcemap,
        }))
          .external(['riot'])
          .transform(riotify, { expr: true })
          .transform(function (file, o) {
            var content = '';
            return file.match(projectDir+'/tags.js') == null ? through() : through(
              function (chunk) { // write
                content += chunk.toString();
              },
              function () { // end
                try {
                  this.queue(
                      '"use strict"\n\n' +
                      '\n\n' +
                      componentRequire +
                      '\n\n' +
                      content
                    );
                  this.emit('end');
                } catch (e) {
                  this.emit('error', e);
                }
              }
            );
          })
          .require(projectFile, { entry: true })
          .require(componentFiles)
          .on('update', bundle)
          .on('log', function(msg) {
                console.log((new Date).toString() + ': ' + msg);
            })
          .on('error', console.log);

        function bundle () {
          b.bundle()
          .on('error', function (err) { console.log('Error: ' + err.message); })
          .pipe(fs.createWriteStream(out));
        }

        bundle();

from riot.

GianlucaGuarini avatar GianlucaGuarini commented on June 1, 2024

Duplicate of #1773

from riot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.