Comments (2)
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.
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)
- Support viewport width
- Add support for creating patterns for templates, using template types
- Expose template types as categories
- Creator: Can't update cover block background image HOT 1
- Row item justification not displaying properly in Editor
- Welcome Guide: Button text hidden
- Locale parameter cause fatal error HOT 8
- Create New Patterns Page is using post editor when it supposed to be a Site Editor when you create patterns HOT 3
- Browse All Button is not working
- Browse All Button is not working
- Browse All Button is not working HOT 1
- Removing a Quote from Paragraph Does Not Enable Save Draft Option
- Block Theme: A quick design review / Design QA HOT 5
- Block Theme: Apply the same content width.
- New layout in home, search results, and pattern details pages HOT 15
- Redesign: The "More from this author" shows up even if there are none HOT 2
- Redesign: Filtering "core" on non wporg author returns 404. HOT 3
- Change "Curated" filter to defaulted sort. HOT 9
- Breadcrumbs: rename Block Pattern Directory to Patterns HOT 1
- Header: Add missing border
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pattern-directory.