Coder Social home page Coder Social logo

Comments (2)

dd32 avatar dd32 commented on July 17, 2024

The majority of the setup time in the existing e2e tests has been bootstraping the environment, actually running the JS to parse/validate on a shared pre-setup site should be possible with minimal extra resources needed.

Generating screenshots is more complicated however, as that requires more than just a JS runtime, but a browser runtime too. Now that I say that, I'm not even entirely sure if just a JS runtime is enough to run Gutenberg?

The largest hurdle that I can think of is the security aspect, we don't want to have any execution of user-supplied JS (Blocks the pattern uses, etc) outside of a "secure sandboxed" environment.

from pattern-directory.

ryelle avatar ryelle commented on July 17, 2024

For the pattern validation task, we shouldn't need a faux-browser environment (or even a WordPress site), just a JS env for Jest should be enough. I was thinking something like the parser / validator tests — pass in the content string, check that it parses & doesn't return a missing block, etc.

I don't think we need the screenshots for patterns, since we'll be showing live previews of those.

The largest hurdle that I can think of is the security aspect, we don't want to have any execution of user-supplied JS (Blocks the pattern uses, etc) outside of a "secure sandboxed" environment.

The initial pattern directory won't load 3rd party blocks, only core blocks, so for now we can push that off -- but I think the Jest run, which is started and then terminated for each pattern, and doesn't run a browser env, should be enough of a "sandbox"

from pattern-directory.

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.